Using ode45 on conditioned equations
1 view (last 30 days)
Show older comments
I'm designing a control law that works off a modified version of Newton Method, so:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1353813/image.png)
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.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1353818/image.png)
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 Comment
Torsten
on 13 Apr 2023
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 ?
Answers (0)
See Also
Categories
Find more on Ordinary Differential Equations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!