I am trying to solve a fourth order Differential Equation (no previous Diff Q experience) and I'm running into issues with the ode45 function. I think I have entered the differential equations correctly in order for MATLAB to see them as first order equations. Any help is welcome. The equation would be f = f2 below.
if true %clear all
clc
t = [0 9]; syms y y0
yx = y^3; y1 = diff(y0,1);
y2 = diff(y0,2);
y3 = diff(y0,3);
y4 = diff(y0,4);
f=y4+5.*(1-y0)*y3+2.*y2+3*y1+yx;
f2 = 10.*sin(pi.*t);
z = [y0 y1 y2 y3]; Z = transpose(z);
y0=0; [t,y] = ode45(@(z,y)f2,t,y0); end
Best Answer