lstsq_size()#
- lstsq_size(modelform, r, m=0, affines=None) int [source]#
Compute the number of columns in the operator matrix \(\Ohat\) in the Operator Inference least-squares problem. This is also the number of columns in the data matrix \(\D\).
- Parameters:
- modelformstr containing ‘c’, ‘A’, ‘H’, ‘G’, and/or ‘B’
The structure of the desired reduced-order model. Each character indicates the presence of a different term in the model: ‘c’ : Constant term c ‘A’ : Linear state term Ax. ‘H’ : Quadratic state term H(x⊗x). ‘G’ : Cubic state term G(x⊗x⊗x). ‘B’ : Input term Bu. For example, modelform==”AB” means f(x,u) = Ax + Bu.
- rint
The dimension of the reduced order model.
- mint
The dimension of the inputs of the model. Must be zero unless ‘B’ is in modelform.
- affinesdict(str -> list(callables))
Functions that define the structures of the affine operators. Keys must match the modelform: * ‘c’: Constant term c(µ). * ‘A’: Linear state matrix A(µ). * ‘H’: Quadratic state matrix H(µ). * ‘G’: Cubic state matrix G(µ). * ‘B’: linear Input matrix B(µ). For example, if the constant term has the affine structure c(µ) = θ1(µ)c1 + θ2(µ)c2 + θ3(µ)c3, then ‘c’ -> [θ1, θ2, θ3].
- Returns:
- ncolsint
The number of columns in the Operator Inference least-squares problem.