Skip to main content

LinkAccount

Struct LinkAccount 

Source
pub struct LinkAccount {
    pub room: f64,
    /* private fields */
}
Expand description

The DC link’s running account of resistor_excess, kept as the stretches come (Tally, where the motor’s room is known at the run: Controller::dc_link_room). Only the stretches until the link’s fill no longer depends on how full it entered the cycle are kept: until the pass entered empty and the one entered full meet, which they do the first time the link empties or fills whatever it held (a hanging axis at rest draws, so empties it at once). After that one fill stands for every entry, and what it spills and the most it holds are summed as they come. At most the stretches up to that point, so on a run at rest with noisy power the list stays at the few stretches before the link first emptied, where before it grew by one per sign change of the power (about 90 per cycle). Same figures as the two passes over the whole list, to rounding (the spills are summed in another order).

A link that neither empties nor fills (what is fed back and drawn stays within less than its room for the whole run) never lets the passes meet. Past LINK_PREFIX_CAP stretches the account keeps, instead of them, LINK_GRID passes entered at fills spread evenly over the voltage window, 0 to the room, and reads the cycle’s figures between the two next to its entry: fill, spill and most are each at most 1:1 in the entry fill (what one enters with more is spilled, drawn less or held), so the figures are off by at most half the grid’s step, room / (2 (LINK_GRID − 1)).

Fields§

§room: f64

The room it was kept for, J.

Implementations§

Source§

impl LinkAccount

Source

pub fn new(room: f64) -> Self

Source

pub fn push(&mut self, e: f64)

One stretch: fed back positive, drawn negative, J.

Source

pub fn finish(&self) -> (f64, f64)

What the resistor takes per cycle, J, and the most the link would have to hold, J (resistor_excess): the cycle entered as it left, which is as the pass entered empty left it.

Trait Implementations§

Source§

impl Clone for LinkAccount

Source§

fn clone(&self) -> LinkAccount

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for LinkAccount

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for LinkAccount

Source§

fn default() -> LinkAccount

Returns the “default value” for a type. Read more
Source§

impl PartialEq for LinkAccount

Source§

fn eq(&self, other: &LinkAccount) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for LinkAccount

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.