pub struct KuramotoModel {
pub omega: Vec<f64>,
pub k: f64,
}Expand description
Kuramoto model of coupled oscillators.
dθ_i/dt = ω_i + (K/N) Σ_j sin(θ_j - θ_i)
The order parameter r = |Σ e^{iθ_j}| / N measures synchrony.
Fields§
§omega: Vec<f64>Natural frequencies ω_i.
k: f64Coupling strength K.
Implementations§
Source§impl KuramotoModel
impl KuramotoModel
Sourcepub fn new(omega: Vec<f64>, k: f64) -> Self
pub fn new(omega: Vec<f64>, k: f64) -> Self
Creates a Kuramoto model from natural frequencies and coupling K.
Sourcepub fn lorentzian(n: usize, omega0: f64, gamma_width: f64, seed: u64) -> Self
pub fn lorentzian(n: usize, omega0: f64, gamma_width: f64, seed: u64) -> Self
Generates Lorentzian-distributed (Cauchy) natural frequencies.
Mean omega0, half-width gamma. Critical coupling K_c = 2γ.
Sourcepub fn order_parameter(phases: &[f64]) -> f64
pub fn order_parameter(phases: &[f64]) -> f64
Computes the order parameter r ∈ [0, 1].
r = |1/N Σ e^{iθ_j}|
Sourcepub fn mean_phase(phases: &[f64]) -> f64
pub fn mean_phase(phases: &[f64]) -> f64
Mean phase angle (argument of the complex order parameter).
Sourcepub fn integrate(
&self,
phases0: &[f64],
dt: f64,
steps: usize,
) -> (Vec<f64>, Vec<f64>)
pub fn integrate( &self, phases0: &[f64], dt: f64, steps: usize, ) -> (Vec<f64>, Vec<f64>)
Integrates for steps using RK4 with step dt.
Returns trajectory of order parameters.
Sourcepub fn critical_coupling_estimate(&self) -> f64
pub fn critical_coupling_estimate(&self) -> f64
Estimated critical coupling K_c = 2 / (π g(0)) for Lorentzian with width γ → K_c = 2γ.
For a general distribution approximated by the frequency spread σ: K_c ≈ 2σ/√π.
Auto Trait Implementations§
impl Freeze for KuramotoModel
impl RefUnwindSafe for KuramotoModel
impl Send for KuramotoModel
impl Sync for KuramotoModel
impl Unpin for KuramotoModel
impl UnsafeUnpin for KuramotoModel
impl UnwindSafe for KuramotoModel
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<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.