Skip to main content

carapace_core/analysis/
damping.rs

1/// Rayleigh (mass- and stiffness-proportional) damping: `C = alpha_m*M + beta_k*K`.
2/// A concrete struct, not an enum — Rayleigh damping is the only form provided; other forms (e.g. explicit modal damping ratios) would be a
3/// distinct, separate mechanism, not another variant of this one.
4#[derive(Debug, Clone, Copy)]
5pub struct RayleighDamping {
6    pub alpha_m: f64,
7    pub beta_k: f64,
8}
9
10impl RayleighDamping {
11    pub const NONE: RayleighDamping = RayleighDamping {
12        alpha_m: 0.0,
13        beta_k: 0.0,
14    };
15
16    pub fn new(alpha_m: f64, beta_k: f64) -> Self {
17        RayleighDamping { alpha_m, beta_k }
18    }
19}