I have the equation of this form below to be solved and I have written the attached code.
syms x(t) A(t) B(t) C(t) D y(t) t Y x(t) = 20e-3:100e-3;A(t) = 1./x(t);B(t) = diff(x(t),t);C(t) = diff(x(t),t,t);D = 50;D1y(t) = diff(y(t),t);D2y(t) = diff(y(t),t,t);D3y(t) = diff(y(t),t,t,t);Eqn3 = D3y(t) + A(t)*D2y(t) + B(t)*D1y(t) + C(t)*y(t) + D == 0;[VF3,Subs3] = odeToVectorField(Eqn3);IC = [0;0;15e3]; % initial conditions
R = matlabFunction(VF3, 'Vars',{t,Y}); [T,I] = ode45(R,time,IC);plot(T,I),grid
Just to be sure the code I have written is doing what I think, I would appreciate if someone could go through it.
Best Answer