How to calculate ode45 of system of equations with particular initial conditions?
1 次查看(过去 30 天)
显示 更早的评论
Let's say that we have system of equations (I put some random values) such as:
for
I don't know how to type initial conditions different than these for t=0 in ode45. Is there an easy way to calculate ode45 with this or any similar system of equations?
0 个评论
采纳的回答
Jan
2021-5-15
编辑:Jan
2021-5-15
This looks trivial actually. Your initial values are:
y0 = [5, 12]
It is not required, that the initial time is 0. You can start at t=1 also without any limitations.
But if you do need the trajectory from t=0 to t=tEnd, start at t=1 with the known initial conditions and integrate backwards:
y0 = [5, 12];
[t, y] = ode45(@YourODE, [1, 0], y0);
Now t(end) = 0 and y(end, :) is the trajectory for t=0.
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!