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
There are two ways ...with "odeset" in Events section or using "Parameterizing Functions" ...you should check this two topics

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Ordinary Differential Equations 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by