Solving coupled system of second order differential equations symbolically

7 views (last 30 days)
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.

Accepted Answer

Bjorn Gustavsson
Bjorn Gustavsson on 2 Nov 2021
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

More Answers (0)

Community Treasure Hunt

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

Start Hunting!