ComponentLibrary

StorageComponentLibrary

EPHS.ComponentLibrary.StorageComponentLibrary.ideal_gasMethod
ideal_gas(c₁::Float64, c₂::Float64, v₀::Float64, c::Float64) -> StorageComponent

Create an ideal gas model. The energy function is given by $E(s, \, v) = c_1 \, \exp(\frac{s}{c_2}) \, {(\frac{v_0}{v})}^{\frac{1}{c}}$, where $s$ is the entropy variable, $v$ is the volume variable, and $c_1$, $c_2$, $v_0$ and $c$ are constitutive parameters.

source

ReversibleComponentLibrary

EPHS.ComponentLibrary.ReversibleComponentLibrary.emcConstant

Electromagnetic coupling: Reversible coupling of an electric energy domain at port $\mathtt{q}$ (charge) and a magnetic enregy domain at port $\mathtt{b}$ (magnetic flux). The Dirac structure is given by

\[\begin{bmatrix} \mathtt{q.f} \\ \mathtt{b.f} \end{bmatrix} \: = \: \begin{bmatrix} 0 & +1 \\ -1 & 0 \end{bmatrix} \, \begin{bmatrix} \mathtt{q.e} \\ \mathtt{b.e} \end{bmatrix} \,.\]

source
EPHS.ComponentLibrary.ReversibleComponentLibrary.pkcConstant

Potential-kinetic coupling: Reversible coupling of a potential energy domain at port $\mathtt{q}$ (displacement) and a kinetic enregy domain at port $\mathtt{p}$ (momentum). The Dirac structure is given by

\[\begin{bmatrix} \mathtt{q.f} \\ \mathtt{p.f} \end{bmatrix} \: = \: \begin{bmatrix} 0 & -1 \\ +1 & 0 \end{bmatrix} \, \begin{bmatrix} \mathtt{q.e} \\ \mathtt{p.e} \end{bmatrix} \,.\]

source
EPHS.ComponentLibrary.ReversibleComponentLibrary.two_masses_rigid_connectionConstant

Dirac structure for a rigid connection of two masses:

\[\begin{bmatrix} \mathtt{p.f} \\ \mathtt{p_2.f} \\ 0 \end{bmatrix} \: = \: \begin{bmatrix} 0 & 0 & +1 \\ 0 & 0 & -1 \\ -1 & +1 & 0 \end{bmatrix} \, \begin{bmatrix} \mathtt{p.e} \\ \mathtt{p_2.e} \\ \lambda \end{bmatrix}\]

The constraint variable $\lambda$ distributes the rates of change of the momentum variables $\mathtt{p.f}$ and $\mathtt{p_2.f}$ such that the velocities $\mathtt{p.e}$ and $\mathtt{p_2.e}$ are equal.

source
EPHS.ComponentLibrary.ReversibleComponentLibrary.two_springs_series_connectionConstant

Dirac structure for connecting two springs in series:

\[\begin{bmatrix} \mathtt{q.f} \\ \mathtt{q_2.f} \\ 0 \end{bmatrix} \: = \: \begin{bmatrix} 0 & 0 & +1 \\ 0 & 0 & -1 \\ -1 & +1 & 0 \end{bmatrix} \, \begin{bmatrix} \mathtt{q.e} \\ \mathtt{q_2.e} \\ \lambda \end{bmatrix}\]

The constraint variable $\lambda$ distributes the rates of change of the displacement variables $\mathtt{q.f}$ and $\mathtt{q_2.f}$ such that the forces $\mathtt{q.e}$ and $\mathtt{q_2.e}$ are equal.

source
EPHS.ComponentLibrary.ReversibleComponentLibrary.hkcMethod
hkc(a::Float64) -> ReversibleComponent

Hydraulic-kinetic coupling: Create a reversible coupling between the two hydraulic energy domains on either side of a piston (ports $\mathtt{v_1}$ and $\mathtt{v_2}$) and the kinetic energy domain of the piston itself (port $\mathtt{p}$). The Dirac structure is given by

\[\begin{bmatrix} \mathtt{p.f} \\ \mathtt{v_1.f} \\ \mathtt{v_2.f} \end{bmatrix} \: = \: \begin{bmatrix} 0 & +a & -a \\ -a & 0 & 0 \\ +a & 0 & 0 \\ \end{bmatrix} \, \begin{bmatrix} \mathtt{p.e} \\ \mathtt{v_1.e} \\ \mathtt{v_2.e} \end{bmatrix} \,,\]

where the parameter $a$ is the cross-sectional area of the piston.

source
EPHS.ComponentLibrary.ReversibleComponentLibrary.mechanical_leverMethod
mechanical_lever(r::Float64) -> ReversibleComponent

Create an ideal mechanical lever connecting two potential energy domains via the leverage ratio $r$. The Dirac structure is given by

\[\begin{bmatrix} \mathtt{q_1.f} \\ \mathtt{q_2.e} \end{bmatrix} \: = \: \begin{bmatrix} 0 & -r \\ +r & 0 \end{bmatrix} \, \begin{bmatrix} \mathtt{q_1.e} \\ \mathtt{q_2.f} \end{bmatrix} \,.\]

source

IrreversibleComponentLibrary

EPHS.ComponentLibrary.IrreversibleComponentLibrary.heat_transferMethod
heat_transfer(α::Float64) -> IrreversibleComponent

Create a linear model of heat transfer with default heat transfer parameter $\alpha$. The Onsager sturcutre is given by

\[\begin{bmatrix} \mathtt{s₁.f} \\ \mathtt{s₂.f} \end{bmatrix} \: = \: \frac{1}{\theta_{0}} \, \alpha \, \begin{bmatrix} \frac{\theta_{2}}{\theta_{1}} & -1 \\ -1 & \frac{\theta_{1}}{\theta_{2}} \end{bmatrix} \, \begin{bmatrix} \mathtt{s₁.e} \\ \mathtt{s₂.e} \end{bmatrix} \: = \: \begin{bmatrix} -\frac{\alpha \, (\theta_2 - \theta_1)}{\theta_1} \\ -\frac{\alpha \, (\theta_1 - \theta_2)}{\theta_2} \end{bmatrix} \,,\]

where $\theta_{1} = \theta_{0} + \mathtt{s₁.e}$ and $\theta_{2} = \theta_{0} + \mathtt{s₂.e}$ represent the absolute temperature of the two thermal energy domains.

source
EPHS.ComponentLibrary.IrreversibleComponentLibrary.linear_frictionMethod
linear_friction(d::Float64) -> IrreversibleComponent

Create a linear model of mechanical friction with default friction parameter $d$. The Onsager structure is given by

\[\begin{bmatrix} \mathtt{p.f} \\ \mathtt{s.f} \end{bmatrix} \: = \: \frac{1}{\theta_0} \, d \, \begin{bmatrix} \theta & -\upsilon \\ - \upsilon & \frac{\upsilon^2}{\theta} \end{bmatrix} \, \begin{bmatrix} \mathtt{p.e} \\ \mathtt{s.e} \end{bmatrix} \: = \: \begin{bmatrix} d \, \upsilon \\ -\frac{d \, \upsilon^2}{\theta} \end{bmatrix} \,,\]

where $\upsilon = \mathtt{p.e}$ is the velocity associated with kinetic energy domain at port $\mathtt{p}$ (momentum) and $\theta = \theta_0 + \mathtt{s.e}$ is the absolute temperature at which kinetic energy is dissipated into the thermal energy domain at port $\mathtt{s}$ (entropy).

source
EPHS.ComponentLibrary.IrreversibleComponentLibrary.magnetic_resistorMethod
magnetic_resistor(r::Float64) -> IrreversibleComponent

Create a model of a linear resistor with default resistance parameter $r$. The Onsager structure is given by

\[\begin{bmatrix} \mathtt{b.f} \\ \mathtt{s.f} \end{bmatrix} \: = \: \frac{1}{\theta_0} \, r \, \begin{bmatrix} \theta & i \\ -i & \frac{\upsilon^2}{\theta} \end{bmatrix} \, \begin{bmatrix} \mathtt{b.e} \\ \mathtt{s.e} \end{bmatrix} \: = \: \begin{bmatrix} r \, i \\ -\frac{r \, i^2}{\theta} \end{bmatrix} \,,\]

where $i = \mathtt{b.e}$ is the current associated with magnetic energy domain at port $\mathtt{b}$ (magnetic flux) and $\theta = \theta_0 + \mathtt{s.e}$ is the absolute temperature at which magnetic energy is dissipated into the thermal energy domain at port $\mathtt{s}$ (entropy).

source
EPHS.ComponentLibrary.IrreversibleComponentLibrary.rotational_frictionMethod
rotational_friction(d::Float64) -> IrreversibleComponent

Create a linear model of rotational friction with default friction parameter $d$. The Onsager structure is given by

\[\begin{bmatrix} \mathtt{p.f} \\ \mathtt{s.f} \end{bmatrix} \: = \: \frac{1}{\theta_0} \, d \, \begin{bmatrix} \theta & \upsilon \\ - \upsilon & \frac{\upsilon^2}{\theta} \end{bmatrix} \, \begin{bmatrix} \mathtt{p.e} \\ \mathtt{s.e} \end{bmatrix} \: = \: \begin{bmatrix} d \, \upsilon \\ -\frac{d \, \upsilon^2}{\theta} \end{bmatrix} \,,\]

where $\upsilon = \mathtt{p.e}$ is the angular velocity associated with kinetic energy domain at port $\mathtt{p}$ (momentum) and $\theta = \theta_0 + \mathtt{s.e}$ is the absolute temperature at which kinetic energy is dissipated into the thermal energy domain at port $\mathtt{s}$ (entropy).

source