Time dependent parameters in ode
1 次查看(过去 30 天)
显示 更早的评论
Let’s say an non-linear first order ode...> dy_dt= c1-c2*e^y+1
- define t_span as t= 1:10 and initial value is 0.1
- c1=[1 1 2 2 3 4 4 3 1 0] and c2=[1 1 2 2 3 4 4 3 1 1]
- c1 & c2 is also vector of 1*10
- For every change in value of t from t_i-1 to t_i, c1 and c2 values should be updated in ode and final value of iteration t_i-1 should be initial value to t_i .Please suggest me how to proceed
3 个评论
John D'Errico
2016-10-30
So use a spline. WTP? Or use interp1.
In your objective function, you know the value of t.
c1spl = spline(1:100,c1);
Pass it in and use it.
回答(1 个)
winkmal
2019-11-13
Note that interp1 does linear interpolation by default, so you might need to change that.
0 个评论
另请参阅
类别
在 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!