// physics_test.sy -- Test physics native functions

fn main() {
    println("=== PHYSICS NATIVES TEST ===")

    // Nernst equation: potassium equilibrium potential
    let e_k = nernst(1.0, 5.0, 140.0, 37.0)
    println("E_K (K+ equilibrium): " + e_k + " mV")

    // Nernst: sodium equilibrium potential
    let e_na = nernst(1.0, 145.0, 15.0, 37.0)
    println("E_Na (Na+ equilibrium): " + e_na + " mV")

    // Nernst: calcium equilibrium potential
    let e_ca = nernst(2.0, 2.0, 0.0001, 37.0)
    println("E_Ca (Ca2+ equilibrium): " + e_ca + " mV")

    // Goldman equation: resting membrane potential
    let v_rest = goldman(1.0, 0.04, 0.45, 5.0, 140.0, 145.0, 15.0, 110.0, 10.0, 37.0)
    println("V_rest (Goldman): " + v_rest + " mV")

    // Henderson-Hasselbalch: blood pH
    let blood_ph = henderson_hasselbalch(6.1, 24.0, 1.2)
    println("Blood pH: " + blood_ph)

    // Gibbs free energy: ATP hydrolysis
    let atp_dg = gibbs_free_energy(-30.5, 0.0, 37.0)
    println("ATP hydrolysis dG: " + atp_dg + " kJ/mol")

    // Heart pacemaker
    let bpm = heart_pacemaker(0.7, 0.3, 37.0)
    let rhythm = heart_rhythm(bpm)
    println("Heart: " + bpm + " bpm -> " + rhythm)

    // Physical constants
    let kb = physical_constant("boltzmann")
    let na = physical_constant("avogadro")
    let f = physical_constant("faraday")
    println("kB = " + kb + " J/K")
    println("NA = " + na + " /mol")
    println("F = " + f + " C/mol")

    // Ohm's membrane: potassium current at rest
    let i_k = ohms_membrane(36.0, -65.0, -77.0)
    println("I_K at rest: " + i_k + " uA/cm^2")

    println("")
    println("=== ALL PHYSICS NATIVES OPERATIONAL ===")
}
