pub struct Capacitor { /* private fields */ }Expand description
Capacitor component with voltage memory.
Uses backward Euler companion model:
- Equivalent conductance: G = C / dt
- Equivalent current source: J = G * V_previous
Implementations§
Trait Implementations§
Source§impl Component for Capacitor
impl Component for Capacitor
Source§fn nodes(&self) -> (i32, i32)
fn nodes(&self) -> (i32, i32)
Get the node indices this component connects (node_a, node_b).
Node 0 represents ground.
Source§fn get_conductance(&self, dt: f32) -> f32
fn get_conductance(&self, dt: f32) -> f32
Return the equivalent conductance for the static Y matrix.
Called once during preprocessing.
Source§fn get_current_source(&self, dt: f32) -> f32
fn get_current_source(&self, dt: f32) -> f32
Return the equivalent current source for the dynamic J vector.
Called every sample for reactive components.
Auto Trait Implementations§
impl Freeze for Capacitor
impl RefUnwindSafe for Capacitor
impl Send for Capacitor
impl Sync for Capacitor
impl Unpin for Capacitor
impl UnsafeUnpin for Capacitor
impl UnwindSafe for Capacitor
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more