Struct ParallelAdaptor
pub struct ParallelAdaptor {
pub port_resistance: f64,
/* private fields */
}Expand description
Parallel adaptor joining two sub-trees.
Port resistance: Rp = R1 * R2 / (R1 + R2)
Scattering coefficient: gamma = R2 / (R1 + R2)
3-port parallel junction (port 3 = parent, reflection-free): scatter_up: b3 = (1-γ)·b1 + γ·b2 scatter_down (from v1 = v3, v2 = v3): a1 = a3 + γ·(b2 - b1) a2 = a3 - (1-γ)·(b2 - b1)
Fields§
§port_resistance: f64Implementations§
§impl ParallelAdaptor
impl ParallelAdaptor
pub fn new(r1: f64, r2: f64) -> ParallelAdaptor
pub fn update_ports(&mut self, r1: f64, r2: f64)
pub fn scatter_up(&mut self, b1: f64, b2: f64) -> f64
pub fn scatter_up(&mut self, b1: f64, b2: f64) -> f64
Bottom-up: produce parent reflected wave.
pub fn scatter_down(&self, a3: f64) -> (f64, f64)
pub fn scatter_down(&self, a3: f64) -> (f64, f64)
Top-down: produce child incident waves from parent incident.
Returns (a1, a2).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ParallelAdaptor
impl RefUnwindSafe for ParallelAdaptor
impl Send for ParallelAdaptor
impl Sync for ParallelAdaptor
impl Unpin for ParallelAdaptor
impl UnsafeUnpin for ParallelAdaptor
impl UnwindSafe for ParallelAdaptor
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