Solve your ODE up to time t = 0.01. Use the solution at time t = 0.01 to generate a new initial vector for the system of ODEs. Call the ODE solver again with the new initial vector to calculate the solution on the interval from t = 0.01 to your new endpoint.
How to modify output of an ode?
2 次查看(过去 30 天)
显示 更早的评论
Hello,
my ODE looks like:
function [sol] = ode(t,z)
A = z(1);
B = z(2);
C = z(3);
if t = 0.01
B=2;
end
dAdz = B;
....
I like to modify my solution z(1) on the time stept t = 0.01. However, in the next step is A = 0 ( A = z(1) in next step) like the hole time before.
Do you know how I can manipulate the solution of the step t+dt?
Thank you
0 个评论
采纳的回答
更多回答(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!