How can I plot ode 45 for different values of a constant after specific time?
2 ビュー (過去 30 日間)
古いコメントを表示
I want to change the value of del after given time interval.
T = 1:1:3500;
del = 0; % For T=1:1:3100
del = 1; % For T=3100:1:3500
[t,y] = ode45(@f_1,T,C);
This is the only line of the function which contains del.
dy(4,1)=(y(1)*k(1))/V(4) - (y(4)*(k(1) + k(2) + k(3) + del*k_clear))/V(4) + (y(2)*k(2))/V(4) + (y(3)*k(3))/V(4);
I want to plot this graph
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/202649/image.png)
But was able to construct this.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/202650/image.png)
1 件のコメント
madhan ravi
2019 年 2 月 4 日
編集済み: madhan ravi
2019 年 2 月 4 日
Share your ode function.Why not?
function dydt = myod(t,y)
.....
if t <= 3100
del = 0;
else
del = 1;
end
.... rest of the code
end
採用された回答
その他の回答 (0 件)
参考
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!