Change Weight values each iteration

Hi All:

I am trying to change the weights for the optimisation process each iteration. Following the discussion:

I am using “NONLINEAR_LS”, but I don’t know how to change the matrices W and We each run step.

On the other hand, following the discussion in:

seems that it is possible to change the weights using “EXTERNAL” too, by using parameters.

What is the preferable approach?

Thanks in advance


Hi again:

I have been investigating further and I see that we can use cost_set function for changing the weighting matrix W.

I haven’t found equivalent function for changing the Mayer cost matrix We.

Then, this way is more simple to implemented than using parameters.



W_e is just W at the terminal shooting node.
So you can use cost_set with stage N and field "W".


Ah, ok, it’s true.

Thanks a lot!