Skip to content

Class KoopmanMPCSolver

Ths class KoopmanMPCSolver is used to solve the optimal control problem using Koopman operator and model predictive control (MPC).

API Documentation

__init__(dynamics, koopman, dictionary, ref_traj, time_horizon, observable_pos, lambda_param)

Initializes an instance of the KoopmanMPCSolver class.

Parameters:

Name Type Description Default
dynamics KoopmanDynamics

The Koopman dynamics system.

required
koopman ParamKoopman

The parametric Koopman operator.

required
dictionary TrainableDictionary or Dictionary

A function that maps the state to the dictionary of observables.

required
ref_traj Tensor

A tensor containing the reference trajectory, with shape (trajectory_length, state_dimension).

required
time_horizon int

The time horizon for model predictive control.

required
observable_pos int

The position(s) of target observables in dictionary.

required
lambda_param float

A regularization parameter used to balance the control error and tracking error.

required

solve(state0, control_min, control_max, method='powell', disp=False)

Solve the optimal control problem for a given initial state and control bounds. Args: state0 (torch.Tensor): The initial state of the system. control_min (float or list of floats): Minimum allowable value(s) for the control input(s). control_max (float or list of floats): Maximum allowable value(s) for the control input(s). method (str, optional): Optimization method to use. Defaults to 'powell'. disp (bool, optional): Whether to print convergence messages. Defaults to False.

Returns:

Type Description
Tensor

The optimal control sequence over the given time horizon.