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.