convert continuous time ODE into discrete ODE
1 次查看(过去 30 天)
显示 更早的评论
Hi, I have a continuous time ODE like dy(t)/dt=f(y(t),t) and I want to make the equation discrete like y(k+1)=f(y(k)). I know function c2d can do this but I don't know how to apply this function to a ODE equation. in the help page there is nothing about ODEs.
0 个评论
回答(1 个)
Star Strider
2016-2-19
If you want your differential equation solved (or the results reported) at specific, predetermined times, give it a vector of specific times instead of simply a range.
For example:
t_min = ...; % Start time
t_max = ...; % End time
n_points = ...; % Number Of Points In Time Vector
tspan = linspace(t_min, t_max, n_points);
Then use this ‘tspan’ vector in your differential equation solver call.
1 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Ordinary Differential Equations 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!