Options for Model Learning
General Setup Options
System Structure
This package works with model reduction for polynomial systems with affine control taking a generel form of
\[\dot{\mathbf{x}} = \mathbf{A}_1\mathbf{x} + \mathbf{A}_2(\mathbf{x}\otimes\mathbf{x}) + \cdots + \mathbf{A}_n(\underbrace{\mathbf{x}\otimes\cdots\otimes\mathbf{x}}_{n-\text{times}}) + \sum_{i=1}^m N_{1,i}\mathbf{x}\mathbf{u}_i + \cdots + \sum_{i=1}^m N_{k,i}(\underbrace{\mathbf{x}\otimes\cdots\otimes\mathbf{x}}_{k-\text{times}})\mathbf{u}_i + \mathbf{B}\mathbf{u} +\mathbf{K}~.\]
With the current version we have only implemented up to quartic states and bilinear controls. We plan to implement linear-quadratic controls and other-higher order systems in the future, as these types of systems are observed in many applications.
For such structures, use SystemStructure
struct to define the system.
LiftAndLearn.SystemStructure
— Typemutable struct SystemStructure
Structure of the given system.
Fields
state::Union{Array{<:Int,1},Int}
: the state variablescontrol::Union{Array{<:Int,1},Int}
: the control variablesoutput::Union{Array{<:Int,1},Int}
: the output variablescoupled_input::Union{Array{<:Int,1},Int}
: the coupled input variablescoupled_output::Union{Array{<:Int,1},Int}
: the coupled output variablesconstant::Int
: the constant variablesconstant_output::Int
: the constant output variables
Note
- The variables are represented as integers or arrays of integers.
Variable info
This structure allows you to input information about the variables in the system. For example, the Fitzhugh-Nagumo system has two main variables: a fast-recovery variable (usually denoted as v) and a slow-activating variable (usually denoted as w). The Fitzhugh-Nagumo equation is given by:
\[\begin{align*} \frac{dv}{dt} &= v - \frac{v^3}{3} - w + I \\ \frac{dw}{dt} &= \epsilon (v + a - bw) \end{align*}\]
Additionally, if we lift this system, it becomes a lifted system of 3 variables. For the VariableStructure
you can define the number of unlifted state variables N=2
and the number of lifted state variables Nl=3
.
LiftAndLearn.VariableStructure
— Typemutable struct VariableStructure
Information about the system variables.
Fields
N::Int64
: the number of system variablesN_lift::Int64
: the number of lifted system variables
Data Info
With the DataStructure
struct, the user will define the time-step $\Delta t$ and optionally the down-sampling and type of numerical scheme used for the Partial Differential Equation.
LiftAndLearn.DataStructure
— Typemutable struct DataStructure
Information about the data.
Fields
Δt::Float64
: the time step or temporal discretizationDS::Int64
: the downsampling ratederiv_type::String
: the derivative scheme, e.g. "F"orward "E"uler
Optimization Settings
This options is only required if you are dealing with the optimization based model reduction methods (e.g., Energy-Preserving Operator Inference) in which you must select some options for the optimization.
LiftAndLearn.OptimizationSetting
— Typemutable struct OptimizationSetting
Information about the optimization.
Fields
verbose::Bool
: enable the verbose output for optimizationinitial_guess::Bool
: use initial guesses for optimizationmax_iter::Int64
: the maximum number of iterations for the optimizationnonredundant_operators::Bool
: use nonredundant operatorsreproject::Bool
: use reprojection method for derivative dataSIGE::Bool
: use successive initial guess estimationwith_bnds::Bool
: add bounds to the variableslinear_solver::String
: the linear solver to use for optimizationHSL_lib_path::String
: the path to the HSL library
Reprojection
Reprojection is a sampling scheme used to increase the accuracy of the recovered reduced model. For further details and mathematical proofs refer to [1] and [2].
Successive Initial Guess Estimation (SIGE)
The SIGE
option is used to run the optimization successive from a lower reduced dimension and increasing the dimensions sequentially by using the solution of the lower dimensional operator as the initial guess for the next optimization. For example, you will solve the optimization for r=2
and then use the solution to solve for the optimization of r=3
.
# r = 2
options.optim.initial_guess = false # turn off initial guess for the first iteration
op_tmp = LnL.opinf(Xdata, Vr[:,1:2], options; U=zeros(100), Y=zeros(100), Xdot=Xdotdata) # compute the first operator
op[1] = op_tmp # store the first operator
# r =3
options.optim.initial_guess = true # turn on initial guess for the next step
op_tmp = LnL.opinf(Xdata, Vr[:,1:3], options; U=zeros(100), Y=zeros(100), Xdot=Xdotdata, IG=LnL.Operators(A=op_tmp.A, F=op_tmp.F)) # compute the second operator
op[2] = op_tmp
Linear Solvers
For the optimization we use Ipopt, and for its linear solvers it is possible to use the default solvers like MUMPS
and HSL solvers (e.g., ma77
, ma86
, and ma97
).
To use HSL linear solvers you will need to obtain a license from here. Then set the path to the solvers using the option HSL_lib_path
:
import HSL_jll
OptimizationSetting.HSL_lib_path = HSL_jll.libhsl_path
Regularization
Using the TikhonovParameter
struct you will define the Tikhonov regularization matrix. This will be a diagonal matrix with diagonal entries having different values corresponding to the operators that it is regulating (e.g., linear, quadratic, bilinear).
The Tikhonov regulated optimization problem is defined as
\[\text{min}~\|\|\mathbf{D}\mathbf{O}^\top - \dot{\mathbf{\hat{X}}}\|\|^2_F + \|\|\mathbf{\Gamma}\mathbf{O}^\top\|\|^2_F\]
where $\mathbf{D}$, $\mathbf{O}^\top$, $\dot{\hat{\mathbf{X}}}$ are the data matrix, operator matrix (with minimizers), and time derivative snapshot matrix, respectively. The linear least-squares solution of this becomes
\[\mathbf{O}^\top = (\mathbf{D}^\top\mathbf{D} + \mathbf{\Gamma}^\top\mathbf{\Gamma})^\dag \mathbf{D}\dot{\mathbf{\hat{X}}}\]
LiftAndLearn.TikhonovParameter
— Typestruct TikhonovParameter
Tikhonov regularization parameters.
Fields
A::Union{Real, AbstractArray{Real}}
: the Tikhonov regularization parameter for the linear state operatorA2::Real
: the Tikhonov regularization parameter for the quadratic state operatorA3::Real
: the Tikhonov regularization parameter for the cubic state operatorA4::Real
: the Tikhonov regularization parameter for the quartic state operatorB::Real
: the Tikhonov regularization parameter for the linear input operatorN::Real
: the Tikhonov regularization parameter for the bilinear state-input operatorC::Real
: the Tikhonov regularization parameter for the constant operatorK::Real
: the Tikhonov regularization parameter for the constant output operator
Model Reduction Specific Options
These options are all specific to each solution method of Operator Inference. All of the options below are a subtype of AbstractOption
.
LiftAndLearn.AbstractOption
— TypeAbstractOption
Abstract type for the options.
Standard Operator Inference
This option is required when using the standard Operator Inference method.
LiftAndLearn.LSOpInfOption
— Typemutable struct LSOpInfOption <: LiftAndLearn.AbstractOption
Standard least-squares Operator Inference.
Fields
method::Symbol
: the name of the methodsystem::SystemStructure
: the system structurevars::VariableStructure
: the system variablesdata::DataStructure
: the dataoptim::OptimizationSetting
: the optimization settingsλ::TikhonovParameter
: the Tikhonov regularization parameterswith_tol::Bool
: the option to use tolerance for the least square pseudo inversewith_reg::Bool
: the option to use Tikhonov regularizationpinv_tol::Real
: the tolerance for the least square pseudo inverse
The option with_tol
turns on/off the settings to truncate ill-posed singular values with order of pinv_tol
.
Energy-Preserving Operator Inference Options
The three options below are for the energy-preserving Operator Inference approaches: hard equality constraint, soft inequality constraint, and penalty. For details of each parameter please check out the documentation of EP-OpInf Manual
LiftAndLearn.EPHECOpInfOption
— Typemutable struct EPHECOpInfOption <: LiftAndLearn.AbstractOption
Energy-Preserving Hard Equality Constraint Operator Inference.
Fields
method::Symbol
: the name of the methodsystem::SystemStructure
: the system structurevars::VariableStructure
: the system variablesdata::DataStructure
: the dataoptim::OptimizationSetting
: the optimization settingsλ_lin::Real
: the Tikhonov regularization parameter for linear state operatorλ_quad::Real
: the Tikhonov regularization parameter for quadratic state operatorlinear_operator_bounds::Tuple{Float64, Float64}
: the bounds for the linear operatorquad_operator_bounds::Tuple{Float64, Float64}
: the bounds for the quadratic operator
LiftAndLearn.EPSICOpInfOption
— Typemutable struct EPSICOpInfOption <: LiftAndLearn.AbstractOption
Energy-Preserving Soft Inequality Constraint Operator Inference.
Fields
method::Symbol
: the name of the methodsystem::SystemStructure
: the system structurevars::VariableStructure
: the system variablesdata::DataStructure
: the dataoptim::OptimizationSetting
: the optimization settingsλ_lin::Real
: the Tikhonov regularization parameter for linear state operatorλ_quad::Real
: the Tikhonov regularization parameter for quadratic state operatorϵ::Real
: soft constraint radiuslinear_operator_bounds::Tuple{Float64, Float64}
: the bounds for the linear operatorquad_operator_bounds::Tuple{Float64, Float64}
: the bounds for the quadratic operator
LiftAndLearn.EPPOpInfOption
— Typemutable struct EPPOpInfOption <: LiftAndLearn.AbstractOption
Energy-Preserving Penalty Operator Inference.
Fields
method::Symbol
: the name of the methodsystem::SystemStructure
: the system structurevars::VariableStructure
: the system variablesdata::DataStructure
: the dataoptim::OptimizationSetting
: the optimization settingsλ_lin::Real
: the Tikhonov regularization parameter for linear state operatorλ_quad::Real
: the Tikhonov regularization parameter for quadratic state operatorα::Float64
: the weight for the energy-preserving term in the cost functionlinear_operator_bounds::Tuple{Float64, Float64}
: the bounds for the linear operatorquad_operator_bounds::Tuple{Float64, Float64}
: the bounds for the quadratic operator