pub struct Barkley {
pub a: f32,
pub eps: f32,
pub h: f32,
pub tau: f32,
}Expand description
Barkley’s model ∂u/∂t = ∇²u + ε⁻¹u(1 − u)(u − u_th), u_th = (v + b)/a,
∂v/∂t = u − v, discretised with node spacing h and sub-step tau (time units).
Fields§
§a: f32§eps: f32§h: f32Node spacing in space units.
tau: f32Sub-step in time units.
Implementations§
Source§impl Barkley
impl Barkley
Sourcepub const fn is_bounded(&self) -> bool
pub const fn is_bounded(&self) -> bool
Whether every stage of step is a convex combination or a shrinking
factor, which keeps u, v ∈ [0, 1] for any b ≥ 0 without clamps: (10/3)·τ/h² ≤ 1
(the 9-point stencil’s centre weight), τ/ε ≤ 1 and τ ≤ 1.
Sourcepub fn step(
&self,
u: &mut Grid<f32>,
v: &mut Grid<f32>,
lap: &mut Grid<f32>,
b: impl Fn(usize) -> f32,
)
pub fn step( &self, u: &mut Grid<f32>, v: &mut Grid<f32>, lap: &mut Grid<f32>, b: impl Fn(usize) -> f32, )
One Lie-split sub-step in place: explicit diffusion (9-point Laplacian, Neumann
walls), the reaction implicit on the decaying branch (u < u_th, a shrinking factor)
and explicit on the growing one (bounded by 1 since τ/ε ≤ 1), then
v ← v + τ(u − v). b(i) is the excitability of node i (row-major); lap is
scratch.
Trait Implementations§
impl Copy for Barkley
impl StructuralPartialEq for Barkley
Auto Trait Implementations§
impl Forget for Barkley
impl Freeze for Barkley
impl Move for Barkley
impl RefUnwindSafe for Barkley
impl Send for Barkley
impl Sync for Barkley
impl Unpin for Barkley
impl UnsafeUnpin for Barkley
impl UnwindSafe for Barkley
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