Solving coupled system of second order differential equations symbolically

3 次查看(过去 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