To use ODE45 (or similar), you need to convert a third-order ODE to a first-order ODE system.
To do this, let
y0 = y y1 = y0' y2 = y1' y3 = y2'
Then
y0' = y1 y1' = y2 y2' = y3
and
y3' = y''' = -41*y2-360y1-900y0+600dx+1200x
Now you can use ODE45 to integrate the system by inserting a function where x (t) and dx (t) are available.
function test() % some random x function x = @(t) exp(-t); dx = @(t) -exp(-t); % integrate numerically [T, Y] = ode45(@linearized, [0 1], [2 1 -0.05 0]); % plot the result plot(T, Y(:,1)) % linearized ode function dy = linearized(t,y) dy = zeros(4,1); dy(1) = y(2); dy(2) = y(3); dy(3) = y(4); dy(4) = -41*y(3)-360*y(2)-900*y(1)+600*dx(t)+1200*x(t); end end

source share