pub struct Cylinder {Show 20 fields
pub id: String,
pub key: String,
pub a1: f64,
pub a2: f64,
pub stroke: f64,
pub mass: f64,
pub payload: f64,
pub gravity: f64,
pub dead: [f64; 2],
pub supply: f64,
pub ambient: f64,
pub temperature: f64,
pub heat_transfer: f64,
pub closed_centre: bool,
pub switch_time: f64,
pub inflow: Flow,
pub outflow: [Flow; 2],
pub bleed: [Flow; 2],
pub cushion: f64,
pub load: f64,
/* private fields */
}Expand description
A double-acting cylinder with its valve, throttles and cushions (see the module’s text).
Fields§
§id: String§key: String§a1: f64§a2: f64§stroke: f64§mass: f64§payload: f64§gravity: f64Gravity’s component against +x per kg, m/s^2 (g sin incline, 0 with effects.gravity off).
dead: [f64; 2]§supply: f64Supply and ambient pressure (absolute), Pa; ambient (and supply, and wall) temperature, K.
ambient: f64§temperature: f64§heat_transfer: f64§closed_centre: bool§switch_time: f64§inflow: FlowInto a chamber: valve and tube. Out of chamber 1 and 2: valve, tube and that chamber’s throttle; and within the cushion: valve, tube and the bleed.
outflow: [Flow; 2]§bleed: [Flow; 2]§cushion: f64Cushion length, m; 0 with effects.cylinder_cushion off.
load: f64Implementations§
Source§impl Cylinder
impl Cylinder
Sourcepub fn from_config(
cfg: &Config,
id: &str,
key: &str,
path: &str,
h: f64,
) -> Result<Self, ConfigError>
pub fn from_config( cfg: &Config, id: &str, key: &str, path: &str, h: f64, ) -> Result<Self, ConfigError>
The cylinder id from its table at path, integrated in sub-steps of h seconds: refused where that step
would not be stable (error-cylinder-unstable).
pub fn volumes(&self, x: f64) -> [f64; 2]
Sourcepub fn gas(&self, s: &[f64]) -> [[f64; 2]; 2]
pub fn gas(&self, s: &[f64]) -> [[f64; 2]; 2]
Pressure and temperature of both chambers at state s (this cylinder’s).
Sourcepub fn flows(&self, s: &[f64], spool: f64) -> Flows
pub fn flows(&self, s: &[f64], spool: f64) -> Flows
The flows at state s with the spool at spool (+1, -1, 0).
Sourcepub fn derivatives(&self, s: &[f64], out: &mut [f64])
pub fn derivatives(&self, s: &[f64], out: &mut [f64])
The rates of this cylinder’s states at s (STATES of each).
pub fn derivatives_with(&self, s: &[f64], spool: f64, out: &mut [f64])
Sourcepub fn rest(&self, spool: f64, state: &mut Vec<f64>)
pub fn rest(&self, spool: f64, state: &mut Vec<f64>)
At rest in the end the valve holds it at: the driven chamber at the supply pressure, the other at ambient, the
piston pressed into its stop as far as the net force deflects it, the gas at ambient temperature. Appended to
state.
Sourcepub fn mechanical_energy(&self, s: &[f64]) -> f64
pub fn mechanical_energy(&self, s: &[f64]) -> f64
Mechanical energy (kinetic, gravity, the load’s and the atmosphere’s work on the rod, the stops’ springs), J.
Sourcepub fn gas_energy(&self, s: &[f64]) -> f64
pub fn gas_energy(&self, s: &[f64]) -> f64
The gas’s internal energy in both chambers, J.
Sourcepub fn load_factor(&self) -> f64
pub fn load_factor(&self) -> f64
The load over the theoretical force at the supply’s gauge pressure, the worse of the two strokes: what the cylinder has to push against gravity and the load, over p_g A1 extending and p_g A2 retracting.