control.optimal.OptimalControlResult
- class control.optimal.OptimalControlResult(ocp, res, return_states=True, print_summary=False, transpose=None, squeeze=None)[source]
Bases:
OptimizeResult
Result from solving an optimal control problem.
This class is a subclass of
scipy.optimize.OptimizeResult
with additional attributes associated with solving optimal control problems.- inputs
The optimal inputs associated with the optimal control problem.
- Type
ndarray
- states
If return_states was set to true, stores the state trajectory associated with the optimal input.
- Type
ndarray
- success
Whether or not the optimizer exited successful.
- Type
bool
- problem
Optimal control problem that generated this solution.
- cost
Final cost of the return solution.
- Type
float
- system_simulations, {cost, constraint, eqconst}_evaluations
Number of system simulations and evaluations of the cost function, (inequality) constraint function, and equality constraint function performed during the optimzation.
- Type
int
- {cost, constraint, eqconst}_process_time
If logging was enabled, the amount of time spent evaluating the cost and constraint functions.
- Type
float
Methods
Create a new dictionary with keys from iterable and values set to value.
Return the value for key if key is in the dictionary, else default.
If the key is not found, return the default if given; otherwise, raise a KeyError.
Remove and return a (key, value) pair as a 2-tuple.
Insert key with a value of default if key is not in the dictionary.
If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]
- __class_getitem__()
See PEP 585
- __contains__(key, /)
True if the dictionary has the specified key, else False.
- __delattr__(key, /)
Delete self[key].
- __delitem__(key, /)
Delete self[key].
- __dir__()
Default dir() implementation.
- __eq__(value, /)
Return self==value.
- __ge__(value, /)
Return self>=value.
- __getattribute__(name, /)
Return getattr(self, name).
- __getitem__(key, /)
Return self[key].
- __gt__(value, /)
Return self>value.
- __hash__ = None
- __ior__(value, /)
Return self|=value.
- __iter__(/)
Implement iter(self).
- __le__(value, /)
Return self<=value.
- __len__(/)
Return len(self).
- __lt__(value, /)
Return self<value.
- __ne__(value, /)
Return self!=value.
- __new__(*args, **kwargs)
- __or__(value, /)
Return self|value.
- __reversed__(/)
Return a reverse iterator over the dict keys.
- __ror__(value, /)
Return value|self.
- __setattr__(key, value, /)
Set self[key] to value.
- __setitem__(key, value, /)
Set self[key] to value.
- __sizeof__() size of D in memory, in bytes
- clear() None. Remove all items from D.
- copy() a shallow copy of D
- fromkeys(iterable, value=None, /)
Create a new dictionary with keys from iterable and values set to value.
- get(key, default=None, /)
Return the value for key if key is in the dictionary, else default.
- items() a set-like object providing a view on D's items
- keys() a set-like object providing a view on D's keys
- pop(key, default=<unrepresentable>, /)
If the key is not found, return the default if given; otherwise, raise a KeyError.
- popitem(/)
Remove and return a (key, value) pair as a 2-tuple.
Pairs are returned in LIFO (last-in, first-out) order. Raises KeyError if the dict is empty.
- setdefault(key, default=None, /)
Insert key with a value of default if key is not in the dictionary.
Return the value for key if key is in the dictionary, else default.
- update([E, ]**F) None. Update D from dict/iterable E and F.
If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]
- values() an object providing a view on D's values