FullOrderModel
Types for full-order mechanical systems: NDOrderModel (N-th order ODE) and FirstOrderModel (first-order form). Both support multilinear nonlinear terms and polynomial external forcing.
MORFE.FullOrderModel.FirstOrderModel — Type
FirstOrderModel{MT, N_NL} <: AbstractFullOrderModelOptimised representation of a first‑order dynamical system
B₁ ẋ + B₀ x = F(x)where F(x) is a polynomial/multilinear function of x.
Fields
n_fom: dimension of the full‑order state vector x.B0,B1: the linear coefficient matrices.nonlinear_terms: tuple ofMultilinearMap{1}representing nonlinear contributions.
Construction
FirstOrderModel((B0, B1), nonlinear_terms)nonlinear_terms can be any iterable of MultilinearMap{1}.
MORFE.FullOrderModel.NDOrderModel — Type
NDOrderModel{ORD, ORDP1, N_NL, MT} <: AbstractFullOrderModelRepresentation of an ORD-th (ORDP1=ORD+1) order dynamical system of the form
B_ORD x^(ORD) + ... + B_1 x^(1) + B_0 x = F(x^(ORD-1), …, x^(1), x, r, …, r)where:
- x^(n) is the n-th derivative of x (x^(n) = d_t^n x)
- x^(0) = x is the state vector
- B_i are the coefficient matrices
- F is a multilinear polynomial function of the derivatives and the external state vector r
- The external state r satisfies its own first‑order dynamics r' = g(r)
Generic type parameters
ORDdefines the order of the ODE.ORDP1is the number of linear terms (from 0 through ORD). It must satisfy ORDP1 == ORD+1.N_NLis the number of nonlinear terms in the tuple nonlinear_terms.N_EXTis the size of the external system.Tis the numeric type.MTis the matrix type that forms the ORDP1-tuple of linear_terms.
Fields
n_fom: dimension of the full‑order state vector x.linear_terms: tuple of linear coefficient matrices (B0, …, BORD).nonlinear_terms: tuple ofMultilinearMaprepresenting nonlinear contributions.external_system: object of tyleExternalSystemdefining the external dynamics.
Representation
- Linear terms are stored as a tuple
(B_0, …, B_ORD) - Nonlinear terms are represented as a collection of
MultilinearMaps
Each MultilinearMap defines:
- which derivatives are involved (via
multiindex) - how many times the external state appears as an argument (via
multiplicity_external) - the combined degree
deg = sum(multiindex) + multiplicity_external
Notes
- All matrices must have identical size.
- The nonlinear structure is stored in sparse form (only active terms).
- TODO For large
K, aVectormay be more appropriate than anNTuple.
MORFE.FullOrderModel.evaluate_nonlinear_terms! — Method
evaluate_nonlinear_terms!(res, model::FirstOrderModel, order, state_vectors)Evaluate all nonlinear terms of given order and accumulate into res. state_vectors must be a 1‑tuple (x,).
MORFE.FullOrderModel.evaluate_nonlinear_terms! — Method
evaluate_nonlinear_terms!(res, model, order, state_vectors, r = nothing)Evaluate all nonlinear terms of a given polynomial degree for an NDOrderModel.
Arguments
res: output vector (modified in-place)model: theNDOrderModelorder: degree of the nonlinear terms to evaluatestate_vectors: tuple(x, x^(1), …, x^(ORD-1))of state derivativesr: external state vector (defaultnothing). Must be provided if any term uses external variables.
MORFE.FullOrderModel.linear_first_order_matrices — Method
linear_first_order_matrices(model::FirstOrderModel)Return the matrices (A, B) of the equivalent linear first‑order system B Ẋ = A X. Because the model is already first order, X = x and
A = -B₀, B = B₁.MORFE.FullOrderModel.linear_first_order_matrices — Method
linear_first_order_matrices(model::NDOrderModel)Construct the matrices A and B of the equivalent linear first-order system:
B Ẋ = A Xobtained from the ORD-th order model
B_ORD x^(ORD) + ... + B_1 x^(1) + B_0 x = F(...)by introducing the augmented state vector
X = [x, x^(1), ..., x^(ORD-1)].and the (ORDn_fom x ORDn_fom)-block matrices
B = [ I 0 0 ⋯ 0
0 I 0 ⋯ 0
⋮ ⋱
0 0 0 ⋯ B_ORD ]and
A = [ 0 I 0 ⋯ 0
0 0 I ⋯ 0
⋮ ⋱
-B₀ -B₁ -B₂ ⋯ -B_{ORD-1} ]where I is the n_fom × n_fom identity matrix.