nx_chem_solution.nx
buildroot/runtime/nx_chem_solution.nx
about
nx_chem_solution.nx -- FOOD-SCIENCE SUITE / SOLUTION CHEMISTRY rung. The
aqueous chemistry food runs on: buffers (Henderson-Hasselbalch), the
pH/pOH relation, molar concentration, dilution (C1V1 = C2V2), and
titratable acidity. pH is the master variable of preservation and
fermentation, so this grounds the whole safety story in chemistry.
INTEGER-EXACT. pH/pKa x1000; concentration in mM; volume in mL; mass in
mg; molar mass x10. Henderson-Hasselbalch is exact at decade buffer
ratios (log10 of a power of ten is an integer): pH = pKa + log_ratio.
THE exceed: buffer pH, dilutions, and titratable acidity are COMPUTED
from chemistry; and cs_is_high_acid ties straight to the preservation /
canning botulinum line (pH < 4.6) -- one chemical source of truth.
grounded: henderson_hasselbalch_equation + molar_concentration
+ c1v1_c2v2_dilution + titratable_acidity_titration
genealogy_id: solution_chemistry + nishi_food_science_suite
dependencies 1 imports · 3 importers
imports: nx_syscalls.nx
imported by: nx_chem_solution_test.nxnx_thermal_process.nxnx_water_activity.nx
structs
| none |
consts
| 20 | const CS_MAGIC_14000: i64 = 14000 |
| 21 | const CS_MAGIC_10000: i64 = 10000 |
| 22 | const CS_MAGIC_100000: i64 = 100000 |
| 24 | const CS_HIGH_ACID_PH_MILLI: i64 = 4600 // FDA acidified-foods line |
functions
| 31 | func cs_buffer_ph_milli(pka_milli: i64, log_ratio: i64) -> i64 |
| 36 | func cs_buffer_ph_at_pka(pka_milli: i64) -> i64 |
| 41 | func cs_poh_milli(ph_milli: i64) -> i64 called by 1: main |
| 46 | func cs_is_high_acid(ph_milli: i64) -> i64 |
| 55 | func cs_molarity_mm(mass_mg: i64, mw_x10: i64, vol_ml: i64) -> i64 called by 1: main |
| 62 | func cs_dilute_final_conc(c1: i64, v1: i64, v2: i64) -> i64 called by 1: main |
| 68 | func cs_dilute_volume_needed(c1: i64, c2: i64, v2: i64) -> i64 called by 1: main |
| 77 | func cs_titratable_acid_mg(v_ml: i64, normality_x1000: i64, meqwt_x100: i64) -> i64 called by 1: main |