My code is giving me zeros everywhere for my solution vectors but I don't know why. I've decomposed a coupled second order ODE into 4 1st order ODE's.
I have my function defined as xp.m
function zprime = f(t,z)
a = 1;
b = 1;
c = 1.5;
zprime = zeros(4,1);
zprime(1) = z(2);
zprime(2) = -a*z(1) + b*(z(3) - z(1));
zprime(3) = z(4);
zprime(4) = -c*(z(3) - z(1));
end
I run it in matlab with the following command:
[t,z] = ode45('xp',[1,100],[0 0 0 0]);
since my initial conditions are all 0. Is it that my initial conditions give the 0 solution or something else? When I change the ic's, the solutions change, as expected.
Thanks