Solving coupled system of second order differential equations symbolically
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Luke Weston
le 2 Nov 2021
Réponse apportée : Bjorn Gustavsson
le 2 Nov 2021
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.
0 commentaires
Réponse acceptée
Bjorn Gustavsson
le 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
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Assumptions dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!