How to use previous results of a non-linear function as the initial "guess" for the next step?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
N/A
am 1 Okt. 2014
Beantwortet: Mohammad Abouali
am 1 Okt. 2014
Hi all,
I am working on a model that requires 21 initial guesses, right now I have my initial guess set at what works best for the very first instance (i = 1). However, over the course of this model, the non-linear function solver is run 500+ times using the same initial guess.
My question is, is there anyway that I can use the previous results ( = i - 1) as the initial guess for subsequent solving of the function. I would like to do this because my values change very little from step to step.
Thanks!
0 Kommentare
Akzeptierte Antwort
Mohammad Abouali
am 1 Okt. 2014
Instead of hard coding the initial guess take that in as an input
P=[initial values]
P=myNLfuction(someinput, P) % this uses the initial values for your first
some more code here
P=myNLfuction(someinput, P) % this uses the last output for as initial value.
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Nonlinear Optimization finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!