Solving system of second order differential equations with ode45
Show older comments
I have two second equations
theta1''= [-29.4sin(theta1)- 9.8sin(theta1 -2*theta2) - 2*sin(theta1-theta2)*(theta1'^(2)*cos(theta1-theta2)]/(3-cos(2*theta1-2*theta2))
theta2''=[2*sin(theta1-theta2)[(2*theta1')+19.6cos(theta1)+theta2'*cos(theta1-theta2)]]/(3-cos(2*theta1-2*theta1))
I think these should be written as a system of 4 first order equations, recast as a matrix and put into ode45 but I cannot figure out hwo to write these equatuons as 4 first first order due to the trig functions. I think I know to use ode45 once I have them in this form. Any help on how to rewrite these would be appreaciated.
2 Comments
Thomas Holmes
on 29 Apr 2019
Star Strider
on 29 Apr 2019
The angles will be the ‘y’ output of your ode45 call:
[t,y] = ode45(odesfcn, tspan, theta0);
With those and the geometry of your system, you can plot the trajectories of the point masses. You would have to model the masses as functions of the angles.
That is the best I can do in terms of a description.
Accepted Answer
More Answers (0)
Categories
Find more on Ordinary Differential Equations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!