Port-Hamiltonian systems
dynax.ISPHS
Input-State port-Hamiltonian Systems (ISPHS).
Implementation of a output-less port-Hamiltonian system:
$$ \dot{x} = (J(x)-R(x))\frac{\partial \mathcal{H}}{\partial x} + B(x)u $$
where:
\(x(t)\) is the state vector,
\(u(t)\) is the input vector,
\(\mathcal{H}(x)\) is the Hamiltonian function given by hamiltonian
,
\(J\) is the structure matrix given by structure_matrix
,
\(R\) is the dissipation matrix given by dissipation_matrix
,
and \(B\) is the input matrix given by input_matrix
.
__init__(hamiltonian, structure_matrix, dissipation_matrix=None, input_matrix=None)
Initialize the ISPHS.
PARAMETER | DESCRIPTION |
---|---|
hamiltonian
|
Function or submodel computing the Hamiltonian \(\mathcal{H}(x)\) as a function of the state vector.
TYPE:
|
structure_matrix
|
Function or submodel computing the structure matrix \(J(x)\) as a function of the state vector. From the port-Hamiltonian modeling view the structure matrix is required to be skew-symmetric, i.e., \(J = -J^T\).
TYPE:
|
dissipation_matrix
|
Function or submodel computing the dissipation matrix \(R(x)\)
as a function of the state vector. From the port-Hamiltonian modeling view
the dissipation matrix is required to be symmetric positive semi-definite,
i.e., \(R = R^T,\,R\succ0\). Alternatively,
TYPE:
|
input_matrix
|
Function or submodel computing the input matrix \(G(x)\) as a
function of the state vector. Alternatively,
TYPE:
|
Tipp
Consider using klax for convenient implementations of matrix valued functions.
__call__(t, x, u=None)
Return the time derivative of the state vector \(x\).
PARAMETER | DESCRIPTION |
---|---|
t
|
Scalar time for evaluation. This argument is unused, but required to
comply with the
TYPE:
|
x
|
State vector at time
TYPE:
|
u
|
Input vector at time
TYPE:
|
RAISES | DESCRIPTION |
---|---|
ValueError
|
If a input is provided but the system does not have an input matrix. |
RETURNS | DESCRIPTION |
---|---|
Array
|
Time derivative of the state vector \(x\) as a 1D array of shape |