MatchingNetwork

Struct MatchingNetwork 

Source
pub struct MatchingNetwork { /* private fields */ }

Implementations§

Source§

impl MatchingNetwork

Source

pub fn new(z1: Complex<Ohm<f64>>, z2: Complex<Ohm<f64>>) -> MatchingNetwork

Examples found in repository?
examples/example1_matching_network.rs (lines 17-20)
6fn main() {
7    
8    let z1 = Complex::new(
9        100.0 * dim::si::OHM,
10        0.0 * dim::si::OHM);
11
12    let z2 = Complex::new(
13            20.0 * dim::si::OHM,
14            43.0 * dim::si::OHM);
15    
16    
17    let mut mn = MatchingNetwork::new(
18        z1,
19        z2
20    );
21
22    println!("{}", mn);
23
24    println!("solutions: {:?}", 
25        mn.solve()
26    );
27
28    // println!("solutions: {}", 
29    //     mn
30    //     .solve()
31    //     .eval_at(10000.0 * dim::si::HZ)
32    // );
33    
34
35    
36
37
38    /*
39
40    let mut x1;
41    
42    // x1 = ReactiveComponent::new(3123. * OHM, None);
43    // println!("{:?}", x1);
44
45    x1 = ReactiveComponent::new(4311.3 * dim::si::OHM, Some(13.23e6 * dim::si::HZ));
46    println!("{:?}", x1);
47    println!("{}", x1);
48
49
50    x1 = ReactiveComponent::new(0.0 * dim::si::OHM, None);
51    println!("{}", x1);  
52
53    x1 = ReactiveComponent::new(-430.1 * dim::si::OHM, None);
54    println!("{}", x1);    
55    
56    x1 = ReactiveComponent::new(-430.1 * dim::si::OHM, Some(120_000.0 * dim::si::HZ));
57    println!("{}", x1);    
58    
59    */
60
61}
Source

pub fn get_solutions(&self) -> Vec<Solution>

Source

pub fn eval_at(&self, freq: Hertz<f64>) -> Vec<f64>

Source

pub fn solve(&mut self) -> Vec<Solution>

Examples found in repository?
examples/example1_matching_network.rs (line 25)
6fn main() {
7    
8    let z1 = Complex::new(
9        100.0 * dim::si::OHM,
10        0.0 * dim::si::OHM);
11
12    let z2 = Complex::new(
13            20.0 * dim::si::OHM,
14            43.0 * dim::si::OHM);
15    
16    
17    let mut mn = MatchingNetwork::new(
18        z1,
19        z2
20    );
21
22    println!("{}", mn);
23
24    println!("solutions: {:?}", 
25        mn.solve()
26    );
27
28    // println!("solutions: {}", 
29    //     mn
30    //     .solve()
31    //     .eval_at(10000.0 * dim::si::HZ)
32    // );
33    
34
35    
36
37
38    /*
39
40    let mut x1;
41    
42    // x1 = ReactiveComponent::new(3123. * OHM, None);
43    // println!("{:?}", x1);
44
45    x1 = ReactiveComponent::new(4311.3 * dim::si::OHM, Some(13.23e6 * dim::si::HZ));
46    println!("{:?}", x1);
47    println!("{}", x1);
48
49
50    x1 = ReactiveComponent::new(0.0 * dim::si::OHM, None);
51    println!("{}", x1);  
52
53    x1 = ReactiveComponent::new(-430.1 * dim::si::OHM, None);
54    println!("{}", x1);    
55    
56    x1 = ReactiveComponent::new(-430.1 * dim::si::OHM, Some(120_000.0 * dim::si::HZ));
57    println!("{}", x1);    
58    
59    */
60
61}

Trait Implementations§

Source§

impl Clone for MatchingNetwork

Source§

fn clone(&self) -> MatchingNetwork

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for MatchingNetwork

Source§

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

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

impl Display for MatchingNetwork

Source§

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

Formats the value using the given formatter. Read more

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> Same for T

Source§

type Output = T

Should always be Self
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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.