How to impose constraint in ode45 on output variable?
1 回表示 (過去 30 日間)
古いコメントを表示
I have a system of this type
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/167663/image.jpeg)
to solve with ode45. I already built the mass matrix (several terms of this matrix depend on the x unknowns), the unknown vector x and the f vector (several terms of this vector depend on the x unknowns). My code is something like this:
options_ODE = odeset('AbsTol',1e-6,'Mass',@MassStickFree);
[vTime,vX] = ode45(@eqLongDynamicStickFree,[0 t_fin],x0',options_ODE);
where the M matrix has been built in the MassStickFree file and the f vector in the eqLongDynamicStickFree file. I would impose that the term x(8) will satisfy a certain condition, for example x(8)=0. How can I do?
5 件のコメント
Torsten
2017 年 9 月 29 日
What's wrong about setting x0(8)=0, f(8)=0 and leave everything else unchanged ?
Best wishes
Torsten.
回答 (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!