Solving an ODE with restriction on states
1 次查看(过去 30 天)
显示 更早的评论
Hi I have a set of equations and I am solving them with ode45. everything is working fine and the results are as expected. Now I want to apply a restriction to one of the states and I don't know how should I do that. the system has 10 states and the restriction is as follows:
I want to apply the restriction to my second state, I want it to be equal to first state when it's less than the first state and be itself when it's greater. something like this:
if x(2) < x(1) x(2) = x(1) end
Does anybody know how I should apply this to my code? should I write an event for the ode45?
Thanks
1 个评论
Antonio Garcia-Martinez
2016-3-28
There are two ways ...with "odeset" in Events section or using "Parameterizing Functions" ...you should check this two topics
回答(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!