y''' + 41y'' + 360y' + 900y = 600x' + 1200x;
y(0)= 2 ; y'(0)= 1 ; y''(0) = -0.05
How can I solve this equation using the ODE45 function?
I tried this:
==>
function dydt=f(t,y)
dydt = [y(2) ; y(3) ; -41*y(3)-360*y(2)- 900*y(1)]
==>
clear all;
timerange=[0 1.4]; %seconds
initialvalues=[2 1 -0.05];
[t,y]=ode45(@dydt, timerange, initialvalues)
plot(t,y(:,1));
But I need put the X part in the equation – I don’t know how…
To use ODE45 (or similar) you need to convert the third order ODE into a system of first order ODEs.
To do so, let
Then
and
you can now use ODE45 to integrate the system by nesting the function where x(t) and dx(t) are available.