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.FirstOrderModelType
FirstOrderModel{MT, N_NL} <: AbstractFullOrderModel

Optimised 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 of MultilinearMap{1} representing nonlinear contributions.

Construction

FirstOrderModel((B0, B1), nonlinear_terms)

nonlinear_terms can be any iterable of MultilinearMap{1}.

source
MORFE.FullOrderModel.NDOrderModelType
NDOrderModel{ORD, ORDP1, N_NL, MT} <: AbstractFullOrderModel

Representation 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

  • ORD defines the order of the ODE.
  • ORDP1 is the number of linear terms (from 0 through ORD). It must satisfy ORDP1 == ORD+1.
  • N_NL is the number of nonlinear terms in the tuple nonlinear_terms.
  • N_EXT is the size of the external system.
  • T is the numeric type.
  • MT is 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 of MultilinearMap representing nonlinear contributions.
  • external_system: object of tyle ExternalSystem defining 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, a Vector may be more appropriate than an NTuple.
source
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: the NDOrderModel
  • order: degree of the nonlinear terms to evaluate
  • state_vectors: tuple (x, x^(1), …, x^(ORD-1)) of state derivatives
  • r: external state vector (default nothing). Must be provided if any term uses external variables.
source
MORFE.FullOrderModel.linear_first_order_matricesMethod
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₁.
source
MORFE.FullOrderModel.linear_first_order_matricesMethod
linear_first_order_matrices(model::NDOrderModel)

Construct the matrices A and B of the equivalent linear first-order system:

B Ẋ = A X

obtained 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.

source