ODE45 for a System of Second-Order Equations

1 view (last 30 days)
I need to solve these equations and plot the solutions for theta(t) and phi(t) when 0<t<4. I'm not super familiar with ode45, can anybody help? Thank you

Answers (1)

Star Strider
Star Strider on 8 Apr 2021
I didn’t see this earlier.
I’m sure you will find the odeToVectorField and matlabFunction functions helpful.
  4 Comments
Caleb Rudick
Caleb Rudick on 9 Apr 2021
Thanks, still having issues. Am I missing something?
Star Strider
Star Strider on 9 Apr 2021
My pleasure!
I cannot read that image, and obviously I cannot run the code to check it.
However the problem is likely that ‘eqnSystem’ needs to be presented to ode45 as:
[t,y] = ode45(@t,y)eqnSystem(t,y,theta,phi,omega_C), [0 4], initVals);
then:
figure
plot(t,y)
grid
legend(string(Subs))
to see the results.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!