Using ode45 on conditioned equations

1 次查看(过去 30 天)
Alex B
Alex B 2023-4-12
评论: Torsten 2023-4-13
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
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 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