modelling IVPs in MATLAB

37 Views Asked by At

I am trying to get the following ODE model dx/dt = 2x, x(0)=10 to start from the initial condition but it keeps starting from zero instead of 10 image of the code and its run Can anyone advise?

1

There are 1 best solutions below

3
On

@Lutzl is right.If you look at the workspace variable $xx$ generated after you pass $x$ to the eval function the solution starts from the point 10. The only reason you aren't seeing this is because of the axis limits that you are working with.

Try the following: axis([0 10 0 100]) and you can see the IVP solution rising from 10.