GeezerVison is showing github.com — Optimal control results should include the final cost achieved · Issue #694 · python-control/python-control
Optimal control results should include the final cost achieved #694
Description
The the optimal control module (ct.optimal), it would be useful if the functions that compute an optimal trajectory returned the cost associated with the final trajectory that is returned, so that it doesn't have to be recomputed. (Perhaps also a function to compute the cost along a curve according to an arbitrary cost function.)
Activity
ThomasGiavasopoulos commented on Mar 2, 2022
Is there currently an option to return the value of the cost associated with a final trajectory given a time horizon?
murrayrm commented on Mar 3, 2022
The return object from ct.optimal.solve_ocp is a OptimizeResult object, so result.fun will get you the value of the function. Whoever handles this enhancement should change that to be something more meaningful (eg, result.cost as a property that maps to result.fun).
murrayrm commented on Mar 18, 2022
FYI, I have added this to an upcoming PR.
ThomasGiavasopoulos commented on Mar 19, 2022
FYI, I have added this to an upcoming PR.
That sounds really useful. Hope that it gets added soon!
Metadata
Metadata
Development
No branches or pull requestsIssue actions