Solving coupled system of second order differential equations symbolically

조회 수: 8 (최근 30일)
Hey, I am performing an analysis of the wilberforce pendulum, and was wondering if there is a way to solve coupled second order differential equations symbolically. I have browsed around some other questions, but they all seem to be numeric solutions, with the program spitting out a graph, while I am looking for equations for y and z motion. My equations of motion are: (with all derivatives being with respect to time) y'' = k/m * y + w/m * z, z'' = J/I * z + w/I * y, where k, m, w, J, and I are constants.

채택된 답변

Bjorn Gustavsson
Bjorn Gustavsson 2021년 11월 2일
Like the Greek godess used to say: Just do it!:
y'' = k/m * y + w/m * z, z'' = J/I * z + w/I * y,
syms t
syms y(t) z(t)
syms k m w J I
odes = [diff(y,2)==k/m*y+w/m*z;diff(z,2)==J/I*z+w/I*y];
qwe = dsolve(odes);
pretty(qwe.y)
pretty(qwe.z)
wilberforce_y = matlabFunction(qwe.y);
wilberforce_z = matlabFunction(qwe.z);
You will have to set a couple of constants fo start off from your desired initial conditions - or specify them at the call of dsolve.
HTH

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Assumptions에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by