ComponentLibrary
EPHS.ComponentLibrary
— ModuleLibrary of pre-defined components.
The module is organized into the following submodules: StorageComponentLibrary
, ReversibleComponentLibrary
, and IrreversibleComponentLibrary
.
StorageComponentLibrary
EPHS.ComponentLibrary.StorageComponentLibrary
— ModuleLibrary of pre-defined storage components.
EPHS.ComponentLibrary.StorageComponentLibrary.angular_mass
— Methodangular_mass(m::Float64) -> StorageComponent
Create an angular mass with default angular mass parameter $m$. The energy function is given by $E(p) = \frac{1}{2 \, m} \, p^2$, where $p$ is the angular momentum variable.
EPHS.ComponentLibrary.StorageComponentLibrary.hookean_spring
— Methodhookean_spring(k::Float64) -> StorageComponent
Create a Hookean spring with default stiffness parameter $k$. The energy function is given by $E(q) = \frac{1}{2} \, k \, q^2$, where $q$ is the displacement variable.
EPHS.ComponentLibrary.StorageComponentLibrary.ideal_gas
— Methodideal_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.
EPHS.ComponentLibrary.StorageComponentLibrary.linear_inductor
— Methodlinear_inductor(l::Float64) -> StorageComponent
Create a linear inductor with default inductivity parameter $l$. The energy function is given by $E(b) = \frac{1}{2 \, l} \, b^2$, where $b$ is the magnetic flux variable.
EPHS.ComponentLibrary.StorageComponentLibrary.point_mass
— Methodpoint_mass(m::Float64) -> StorageComponent
Create a point mass with default mass parameter $m$. The energy function is given by $E(p) = \frac{1}{2 \, m} \, p^2$, where $p$ is the momentum variable.
EPHS.ComponentLibrary.StorageComponentLibrary.thermal_capacity
— Methodthermal_capacity(c₁::Float64, c₂::Float64) -> StorageComponent
Create a model of a thermal capacity. The energy function is $E(s) = c_1 \, \exp(\frac{s}{c_2})$, where $s$ is the entropy variable and $c_1$ and $c_2$ are constitutive parameters.
ReversibleComponentLibrary
EPHS.ComponentLibrary.ReversibleComponentLibrary
— ModuleLibrary of pre-defined reverisble components.
EPHS.ComponentLibrary.ReversibleComponentLibrary.emc
— ConstantElectromagnetic 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} \,.\]
EPHS.ComponentLibrary.ReversibleComponentLibrary.pkc
— ConstantPotential-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} \,.\]
EPHS.ComponentLibrary.ReversibleComponentLibrary.two_masses_rigid_connection
— ConstantDirac 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.
EPHS.ComponentLibrary.ReversibleComponentLibrary.two_springs_series_connection
— ConstantDirac 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.
EPHS.ComponentLibrary.ReversibleComponentLibrary.hkc
— Methodhkc(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.
EPHS.ComponentLibrary.ReversibleComponentLibrary.mechanical_lever
— Methodmechanical_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} \,.\]
IrreversibleComponentLibrary
EPHS.ComponentLibrary.IrreversibleComponentLibrary
— ModuleLibrary of pre-defined irreverisble components.
EPHS.ComponentLibrary.IrreversibleComponentLibrary.heat_transfer
— Methodheat_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.
EPHS.ComponentLibrary.IrreversibleComponentLibrary.linear_friction
— Methodlinear_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).
EPHS.ComponentLibrary.IrreversibleComponentLibrary.magnetic_resistor
— Methodmagnetic_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).
EPHS.ComponentLibrary.IrreversibleComponentLibrary.rotational_friction
— Methodrotational_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).