Localized V2 rewrite for this language is in progress. Showing English-first content for now.
Science Workflow

Scientific Computing

Data analysis and uncertainty tracking

Back to Science Hub

Scientific Computing with Sounio

Sounio provides foundational utilities for modeling uncertainty in scientific domains.

Uncertainty in PBPK Modeling

struct KnowledgeF64 {
    value: f64,
    uncertainty: f64
}

fn concentration(dose_mg: KnowledgeF64, volume_l: KnowledgeF64) -> KnowledgeF64 {
    let c = dose_mg.value / volume_l.value

    // First-order linearized uncertainty for division:
    // dc ≈ |∂c/∂dose| u_dose + |∂c/∂vol| u_vol
    let d_cdose = 1.0 / volume_l.value
    let d_cvol = (0.0 - dose_mg.value) / (volume_l.value * volume_l.value)

    let abs_d_cdose = if d_cdose < 0.0 { 0.0 - d_cdose } else { d_cdose }
    let u = abs_d_cdose * dose_mg.uncertainty

    return KnowledgeF64 {
        value: c,
        uncertainty: u
    }
}