csu-hmc / opty

A library for using direct collocation in the optimization of dynamic systems.
http://opty.readthedocs.io
Other
86 stars 20 forks source link

a Question concerning the info dictionary #134

Closed Peter230655 closed 3 months ago

Peter230655 commented 3 months ago

The info dict has a key g. I am unsure I understand what it contains. Is says constraints at the optimal solution.

My 'problem' has 12 state_symbols, and num_nodes =300. It also has two configuration constraints.

len(info[g]) = 3602, so I assumed, it contains the errors of the state symbols at each node. When I plot it under this assumption, it looks 'reasonable', the values are in the range 10^(-10).....10^(-16).

My questions: 1. Is my assumption about the content of info[g] correct? 2. If yes, what are the additional two entries?

Sorry for all these questions - and thanks for any help!

moorepants commented 3 months ago

Yes your assumption is correct.

Did you have "instance constraints"? If so, maybe the 2 extra are those.

Peter230655 commented 3 months ago

Yes, I have two instance constraints, which would match. Those would be the last entries in info['g'], right? Thanks!

moorepants commented 3 months ago

Yes. We try to explain that here: https://opty.readthedocs.io/en/latest/api.html#opty.direct_collocation.Problem.constraints but maybe it needs more clarity.

Peter230655 commented 3 months ago

This is even printed on my desk - but I did not make the connection. Thanks, all clear now!