MATLAB: Runge-Kutta method related

ode45runge-kutta method

Hi
I have a doubt (rather a confusion) in Ruge-Kutta method. I want to time integrate an equation of the form
dy/dt = g*n-0.5*(u^2+v^2)
Where g,n,u and v are known. So I can put equation in the form
dy/dt = a constant
I want to time integrate it in the time span [ti tf]. As the equation have constant on right side and no time, no y variable, how I can time integrate it? I have initial conditions for y. If I use ode45 how I can call ode45? How the equation should be fed to ode45?
Thanks in advance
Sreenu

Best Answer

Why are you bothering to use ode45 at all?
Your solution for any t >= ti is just
y = y0 + (t - ti) * (g*n-0.5*(u^2+v^2));
Related Question