Troubles using fminsearch, fminunc with Simulink model
Show older comments
I'm trying to optimize a multi-burn rocket trajectory by calling a Simulink model from a Matlab optimizer (I have the Opt Toolbox). I seek to optimize payload by adjusting the thrust on-off times. I'm passing the times as the X vector to be optimized. A payoff function accepts the optimizer's trial values, and calls a payoff function which calls the Simulink model and returns the negative of the burnout mass.
My first try used fminsearch, and it worked great except for using a lot of iterations. But when I increased the numbers of burns, the program choked on the X0 array.
The problem is that the on-off times table must be ordered, lowest time first. As the number of burns go up, so does the next ignition time. fminsearch builds its simplex by varying the X0 elements by 5%, but for times several hours away, this is much too large a step. Short of rewriting the code for fminsearch, I've found no way to limit the change between steps.
So I just switched to fminunc, which should be much more well-behaved. But I think its problem is that it's not taking steps that are large ENOUGH. Looking at debug print, I see that the optimizer is passing the same value, X0, for each function evaluation. Soon enough, it decides that the gradient is all zeroes. Then I get a divide-by-zero error in the Matlab function fminunsub. Frustratingly, the optimizer and declares victory and returns X unchanged.
It's also giving me the error message that goes something like "One or more return parameters has not been set."
Can anyone suggest how I can make fminsearch take smaller steps, or fminunc take larger ones?
Jack Crenshaw
Answers (0)
Categories
Find more on Simulink Design Optimization 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!