Using ode45 on conditioned equations
3 ビュー (過去 30 日間)
古いコメントを表示
I'm designing a control law that works off a modified version of Newton Method, so:
(the actual equations for f and g are long and don't really matter here)
where P is a conditioner matrix that needs to update as the algorithm runs. The problem is that, if we let x have n members, P has entries. In the past I was numerically integrating with a script I wrote, which meant I could guaruntee the matrix would update how I wanted.
However, now that I've started using ode45 for this I have a problem; because ode45 will adpatively vary the timestep and step backwards in time to recalculate if the error gets too high, updating P becomes hard (as in I can't do the quick and easy thing of evalin/assignout). Right now I'm getting around this by making every entry of P a part of my state space (meaning my state space went from n elements to 4n^2 + n), but this slows my algorithm down by a lot.
I know there's no real way to get around the speed loss from having that large of a matrix, does anyone know of a better way to do this? I feel like there has to be a smarter way to update this matrix than making my state space absolutely gigantic.
1 件のコメント
Torsten
2023 年 4 月 13 日
If the elements of P are given by Pdot = g(x,f(x)), you need to solve 4*n^2 differential equations for them. There is no easier way here.
What do you mean by "In the past I was numerically integrating with a script I wrote, which meant I could guaruntee the matrix would update how I wanted." ? Are there algebraic relations for the elements of P besides the differential formulation ?
回答 (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!