pub struct MagneticMirror {
pub b_min: f32,
pub b_max: f32,
pub length: f32,
}Expand description
Magnetic mirror: confinement between two high-field regions.
Fields§
§b_min: f32§b_max: f32§length: f32Implementations§
Source§impl MagneticMirror
impl MagneticMirror
pub fn new(b_min: f32, b_max: f32, length: f32) -> Self
Sourcepub fn mirror_ratio(&self) -> f32
pub fn mirror_ratio(&self) -> f32
Mirror ratio: R = B_max / B_min
Sourcepub fn loss_cone_angle(&self) -> f32
pub fn loss_cone_angle(&self) -> f32
Loss cone angle: sin^2(alpha) = B_min / B_max = 1/R
Sourcepub fn is_confined(&self, pitch_angle: f32) -> bool
pub fn is_confined(&self, pitch_angle: f32) -> bool
Check if a particle with given pitch angle is confined. pitch_angle is the angle between velocity and B field.
Sourcepub fn field_at_position(&self, z: f32) -> f32
pub fn field_at_position(&self, z: f32) -> f32
Magnetic field magnitude as a function of position along the axis. Simple model: B(z) = B_min * (1 + (R-1) * (2*z/L)^2) for z in [-L/2, L/2]
Sourcepub fn bounce_period(&self, v_parallel: f32) -> f32
pub fn bounce_period(&self, v_parallel: f32) -> f32
Bounce period for a trapped particle. Approximate: T ~ 2*L / v_parallel
Trait Implementations§
Source§impl Clone for MagneticMirror
impl Clone for MagneticMirror
Source§fn clone(&self) -> MagneticMirror
fn clone(&self) -> MagneticMirror
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for MagneticMirror
impl RefUnwindSafe for MagneticMirror
impl Send for MagneticMirror
impl Sync for MagneticMirror
impl Unpin for MagneticMirror
impl UnsafeUnpin for MagneticMirror
impl UnwindSafe for MagneticMirror
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.