control.optimal.solve_optimal_estimate

control.optimal.solve_optimal_estimate(sys, timepts, outputs=None, inputs=None, integral_cost=None, initial_state=None, trajectory_constraints=None, initial_guess=None, squeeze=None, print_summary=True, **kwargs)[source]

Compute the solution to a finite horizon estimation problem.

This function computes the maximum likelihood estimate of a system state given the input and output over a fixed horizon. The likelihood is evaluated according to a cost function whose value is minimized to compute the maximum likelihood estimate.

Parameters
sysInputOutputSystem

I/O system for which the optimal input will be computed.

timepts1D array_like

List of times at which the optimal input should be computed.

outputs (or Y)2D array_like

Values of the outputs at each time point.

inputs (or U)2D array_like

Values of the inputs at each time point.

integral_cost (or cost)callable

Function that returns the cost given the current state and input. Called as cost(y, u, x0).

initial_state (or X0)1D array_like, optional

Mean value of the initial condition (defaults to 0).

trajectory_constraintslist of tuples, optional

List of constraints that should hold at each point in the time vector. See solve_optimal_trajectory for more information.

control_indicesint, slice, or list of int or string, optional

Specify the indices in the system input vector that correspond to the control inputs. For more information on possible values, see OptimalEstimationProblem.

disturbance_indicesint, list of int, or slice, optional

Specify the indices in the system input vector that correspond to the input disturbances. For more information on possible values, see OptimalEstimationProblem.

initial_guess2D array_like, optional

Initial guess for the state estimate at each time point.

print_summarybool, optional

If True (default), print a short summary of the computation.

squeezebool, optional

If True and if the system has a single output, return the system output as a 1D array rather than a 2D array. If False, return the system output as a 2D array even if the system is SISO. Default value set by config.defaults['control.squeeze_time_response'].

Returns
resTimeResponseData

Bundle object with the estimated state and noise values.

res.successbool

Boolean flag indicating whether the optimization was successful.

res.timearray

Time values of the input.

res.inputsarray

Disturbance values corresponding to the estimated state. If the system is SISO and squeeze is not True, the array is 1D (indexed by time). If the system is not SISO or squeeze is False, the array is 2D (indexed by the output number and time).

res.statesarray

Estimated state vector over the given time points.

res.outputsarray

Noise values corresponding to the estimated state. If the system is SISO and squeeze is not True, the array is 1D (indexed by time). If the system is not SISO or squeeze is False, the array is 2D (indexed by the output number and time).

Notes

Additional keyword parameters can be used to fine-tune the behavior of the underlying optimization and integration functions. See OptimalControlProblem for more information.