This is an annual-average comparison for fictional Port Meridian. It does not determine engineering feasibility, finished-water safety, permits, a procurement decision, or dependable daily yield. All financial model inputs are assumed real 2026 U.S. dollars. Historical observations in the source ledger retain their original dates and scopes.
Python 3 and Node.js require no third-party packages for these calculations.
python3 model.py
python3 model.py --price 0.25 --utilization 0.60 --grid 0.05
python3 audit_calculations.py --node /path/to/node
Run these commands from this calculations directory. The audit also finds Node on PATH or the bundled runtime on this Mac. It writes ../evidence/calculation-audit.json and exits nonzero on failure. baseline.json contains unrounded default results. model.mjs is the pure JavaScript module used by the interactive reader.
The gap is 100,000 m³/day of annual-average service, or 36.5 million m³/year. Water is counted at the utility interface. Common downstream distribution is excluded. Reuse begins with available secondary-treated effluent; new secondary wastewater treatment is excluded.
The calculator holds annual output fixed. Utilization is annual output divided by the annual output that nameplate capacity could produce. When utilization decreases, required installed capacity and capital increase linearly. Annual electricity stays constant. This is a capacity-scaling screen, not a dispatch, outage-duration or reliability simulation.
The reuse column is a hypothetical equal-volume comparator. The illustrative portfolio has only 60,000 m³/day of reuse yield; its lower unit cost does not create additional effluent.
| Symbol | Meaning | Default and unit | Status |
|---|---|---|---|
| q | Average delivered target | 100,000 m³/day | Scenario assumption |
| u | Annual utilization | 0.90 | Scenario assumption |
| V | Annual delivered volume | q × 365 = 36,500,000 m³/year | Calculation |
| Q | Required nameplate | q / u = 111,111.11 m³/day | Calculation |
| K₀ | Capital at 100,000 m³/day nameplate | SWRO $350m; reuse $200m | Chosen allowances |
| K | Installed capital | K₀ × Q / 100,000 | Linear scaling assumption |
| r | Real discount rate | 4% per year | Scenario assumption |
| n | Asset/finance period | 30 years | Scenario assumption |
| f | Fixed O&M fraction | 2% of installed capital each year | Scenario assumption |
| v | Non-energy variable O&M | $0.15/m³ for either comparator | Scenario assumption |
| e | Treatment + delivery electricity | SWRO 3.5 + 0.3 = 3.8; reuse 0.84 + 0.16 = 1.0 kWh/m³ | Evidence-informed assumptions, not guarantees |
| p | Electricity price | $0.12/kWh | Scenario assumption |
| g | Electricity emissions intensity | 0.35 kg CO₂e/kWh | Scenario assumption, not a measured regional factor |
CRF = r × (1+r)^n / ((1+r)^n − 1) = 0.0578300991 /year
Annualized capital = K × CRF
Annual cost = K × (CRF + f) + V × v + V × e × p
Unit cost = annual cost / V [USD/m³]
E = V × e [kWh/year]
Average MW = E / 8,760 / 1,000; online MW = average MW / u.
Electricity-use emissions = E × g / 1,000 [tonnes CO₂e/year].
The Python rate-zero branch uses CRF = 1/n. The UI keeps the finance inputs fixed; only price, utilization and emissions intensity change.
| Metric | Seawater RO | Potable reuse comparator |
|---|---|---|
| Installed capital | $388.889m | $222.222m |
| Annualized capital | $22.489m/year | $12.851m/year |
| Fixed O&M | $7.778m/year | $4.444m/year |
| Variable non-energy O&M | $5.475m/year | $5.475m/year |
| Electricity | $16.644m/year | $4.380m/year |
| Total cost | $52.386m/year | $27.151m/year |
| Unit cost | $1.43524/m³ | $0.74385/m³ |
| Electricity | 138.7 GWh/year | 36.5 GWh/year |
| Average / online power | 15.833 / 17.593 MW | 4.167 / 4.630 MW |
| Electricity emissions | 48,545 t CO₂e/year | 12,775 t CO₂e/year |
At $0.25/kWh, SWRO is $1.92924/m³. At 60% utilization and default power price it is $1.84986/m³. A $0.10/kWh change adds $0.38/m³ to SWRO and $0.10/m³ to reuse. The assumed electricity factor changes carbon arithmetic, not the modeled price.
For an average product flow q = 100,000 m³/day, assume 45% recovery R and feed salinity 35 g/L. With negligible salt in the product:
Feed = q/R = 222,222.22 m³/day
Brine = feed − q = 122,222.22 m³/day
Brine salinity ≈ feed salinity/(1−R) = 63.636 g/L
At 90% utilization the corresponding online feed and brine flows are 246,913.58 and 135,802.47 m³/day. Density differences, pretreatment losses, dilution water and brine plume behavior are not modeled. A mass balance cannot establish ecological acceptability.
The illustrative portfolio assumes 20,000 m³/day sustained savings and 75,000 m³/day eligible effluent after conservation and existing commitments. Treatment and delivery losses are represented in 80% net recovery:
Reuse = 75,000 × 0.80 = 60,000 m³/day
Residual = 100,000 − 20,000 − 60,000 = 20,000 m³/day
At 100,000 m³/day eligible effluent the residual vanishes; at 37,500 it rises to 50,000 m³/day. These are annual balances, not tested daily service portfolios.
Portfolio electricity = (60,000 × 1.0 + 20,000 × 3.8) × 365 = 49.64 GWh/year, 64.2% below full-target SWRO. No extra energy credit is assigned to conservation. Fixed energy and small-plant efficiency differences are excluded. The smaller portfolio is not independently costed.
Conservation program spending per m³ saved = $3.65m / (20,000 × 365) = $0.50; at half the yield it is $1.00. This is gross assumed program spending, not a net-benefit or household-bill calculation.
Emissions factor for a 0.5 kg CO₂e/m³ electricity ceiling = 0.5/3.8 = 0.131579 kg CO₂e/kWh, rounded to about 0.132. That ceiling is illustrative, not a regulation. Annual-average inventory factors do not establish marginal or hourly effects.
100 m lift at 80% efficiency = 1,000 kg/m³ × 9.81 m/s² × 100 m / (0.80 × 3,600,000 J/kWh) = 0.340625 kWh/m³, before friction.
A full three-day outage at the target needs 300,000 m³ of alternate or stored water before margins. A 100,000 m³/day nameplate used 90% produces 32.85 million m³/year, 3.65 million below the service target.
All low inputs are combined, then all highs, at u = 0.90 and p = $0.12/kWh. These ranges are deliberately selected scenarios, not confidence intervals or project quotes.
| Comparator | K₀ at reference nameplate | e, kWh/m³ | v, USD/m³ | Calculated range, USD/m³ |
|---|---|---|---|---|
| SWRO | $250m–$600m | 3–5 | $0.10–$0.30 | $1.052–$2.322 |
| Reuse | $150m–$400m | 0.7–2 | $0.10–$0.25 | $0.539–$1.438 |
Capital allowances are not bottom-up estimates. New secondary treatment, major trunk upgrades, unusual site/marine works, land, outage storage, financing during construction, taxes, grants and an additional contingency reserve are excluded. Routine renewals are represented only by generic O&M allowances; discrete replacement schedules are not modeled. Electricity emissions exclude chemicals, embodied construction, direct process emissions and transmission losses. No discounting is applied to emissions.
One U.S. liquid gallon is exactly 231 cubic inches; one inch is 0.0254 m. Therefore 1 U.S. MGD is 3,785.411784 m³/day. One acre-foot uses 43,560 square feet times one foot, with a 0.3048 m international foot: 1,233.48183754752 m³. The target is 26.4172 U.S. MGD, or about 29,591 acre-feet/year. One GWh is 1,000,000 kWh; one tonne is 1,000 kg. For concentration, 1 g/L equals 1 kg/m³.
The audit uses 50-digit decimal arithmetic and calculates capital recovery from the present value of 30 separate discounted payments. It checks Python and JavaScript across 80 combinations each, all returned numerical fields, baseline persistence, water and salt balances, volume/energy/mass conversions, hydraulic work, price sensitivity, cost stress endpoints, carbon table and graph points, conservation yield, the portfolio reversal, and invalid inputs. It also checks that every recommendation source list equals the union of its linked claims and assumptions, with additional background separated. These checks establish arithmetic consistency, not empirical truth.
# The arithmetic behind the dossier This is an annual-average comparison for fictional Port Meridian. It does not determine engineering feasibility, finished-water safety, permits, a procurement decision, or dependable daily yield. All financial model inputs are **assumed real 2026 U.S. dollars**. Historical observations in the source ledger retain their original dates and scopes. ## Reproduce Python 3 and Node.js require no third-party packages for these calculations. ```sh python3 model.py python3 model.py --price 0.25 --utilization 0.60 --grid 0.05 python3 audit_calculations.py --node /path/to/node ``` Run these commands from this `calculations` directory. The audit also finds Node on PATH or the bundled runtime on this Mac. It writes `../evidence/calculation-audit.json` and exits nonzero on failure. `baseline.json` contains unrounded default results. `model.mjs` is the pure JavaScript module used by the interactive reader. ## Service boundary The gap is **100,000 m³/day of annual-average service**, or 36.5 million m³/year. Water is counted at the utility interface. Common downstream distribution is excluded. Reuse begins with available secondary-treated effluent; new secondary wastewater treatment is excluded. The calculator **holds annual output fixed**. Utilization is annual output divided by the annual output that nameplate capacity could produce. When utilization decreases, required installed capacity and capital increase linearly. Annual electricity stays constant. This is a capacity-scaling screen, not a dispatch, outage-duration or reliability simulation. The reuse column is a hypothetical equal-volume comparator. The illustrative portfolio has only 60,000 m³/day of reuse yield; its lower unit cost does not create additional effluent. ## Inputs and equations | Symbol | Meaning | Default and unit | Status | |---|---|---|---| | q | Average delivered target | 100,000 m³/day | Scenario assumption | | u | Annual utilization | 0.90 | Scenario assumption | | V | Annual delivered volume | q × 365 = 36,500,000 m³/year | Calculation | | Q | Required nameplate | q / u = 111,111.11 m³/day | Calculation | | K₀ | Capital at 100,000 m³/day nameplate | SWRO $350m; reuse $200m | Chosen allowances | | K | Installed capital | K₀ × Q / 100,000 | Linear scaling assumption | | r | Real discount rate | 4% per year | Scenario assumption | | n | Asset/finance period | 30 years | Scenario assumption | | f | Fixed O&M fraction | 2% of installed capital each year | Scenario assumption | | v | Non-energy variable O&M | $0.15/m³ for either comparator | Scenario assumption | | e | Treatment + delivery electricity | SWRO 3.5 + 0.3 = 3.8; reuse 0.84 + 0.16 = 1.0 kWh/m³ | Evidence-informed assumptions, not guarantees | | p | Electricity price | $0.12/kWh | Scenario assumption | | g | Electricity emissions intensity | 0.35 kg CO₂e/kWh | Scenario assumption, not a measured regional factor | `CRF = r × (1+r)^n / ((1+r)^n − 1) = 0.0578300991 /year` `Annualized capital = K × CRF` `Annual cost = K × (CRF + f) + V × v + V × e × p` `Unit cost = annual cost / V [USD/m³]` `E = V × e [kWh/year]` `Average MW = E / 8,760 / 1,000`; `online MW = average MW / u`. `Electricity-use emissions = E × g / 1,000 [tonnes CO₂e/year]`. The Python rate-zero branch uses `CRF = 1/n`. The UI keeps the finance inputs fixed; only price, utilization and emissions intensity change. ## Default results | Metric | Seawater RO | Potable reuse comparator | |---|---:|---:| | Installed capital | $388.889m | $222.222m | | Annualized capital | $22.489m/year | $12.851m/year | | Fixed O&M | $7.778m/year | $4.444m/year | | Variable non-energy O&M | $5.475m/year | $5.475m/year | | Electricity | $16.644m/year | $4.380m/year | | Total cost | $52.386m/year | $27.151m/year | | Unit cost | $1.43524/m³ | $0.74385/m³ | | Electricity | 138.7 GWh/year | 36.5 GWh/year | | Average / online power | 15.833 / 17.593 MW | 4.167 / 4.630 MW | | Electricity emissions | 48,545 t CO₂e/year | 12,775 t CO₂e/year | At $0.25/kWh, SWRO is $1.92924/m³. At 60% utilization and default power price it is $1.84986/m³. A $0.10/kWh change adds $0.38/m³ to SWRO and $0.10/m³ to reuse. The assumed electricity factor changes carbon arithmetic, not the modeled price. ## Physical balance, portfolio and thresholds For an average product flow q = 100,000 m³/day, assume 45% recovery R and feed salinity 35 g/L. With negligible salt in the product: `Feed = q/R = 222,222.22 m³/day` `Brine = feed − q = 122,222.22 m³/day` `Brine salinity ≈ feed salinity/(1−R) = 63.636 g/L` At 90% utilization the corresponding online feed and brine flows are 246,913.58 and 135,802.47 m³/day. Density differences, pretreatment losses, dilution water and brine plume behavior are not modeled. A mass balance cannot establish ecological acceptability. The illustrative portfolio assumes **20,000 m³/day sustained savings** and **75,000 m³/day eligible effluent after conservation and existing commitments**. Treatment and delivery losses are represented in 80% net recovery: `Reuse = 75,000 × 0.80 = 60,000 m³/day` `Residual = 100,000 − 20,000 − 60,000 = 20,000 m³/day` At 100,000 m³/day eligible effluent the residual vanishes; at 37,500 it rises to 50,000 m³/day. These are annual balances, not tested daily service portfolios. `Portfolio electricity = (60,000 × 1.0 + 20,000 × 3.8) × 365 = 49.64 GWh/year`, 64.2% below full-target SWRO. No extra energy credit is assigned to conservation. Fixed energy and small-plant efficiency differences are excluded. The smaller portfolio is **not independently costed**. `Conservation program spending per m³ saved = $3.65m / (20,000 × 365) = $0.50`; at half the yield it is $1.00. This is gross assumed program spending, not a net-benefit or household-bill calculation. `Emissions factor for a 0.5 kg CO₂e/m³ electricity ceiling = 0.5/3.8 = 0.131579 kg CO₂e/kWh`, rounded to about 0.132. That ceiling is illustrative, not a regulation. Annual-average inventory factors do not establish marginal or hourly effects. `100 m lift at 80% efficiency = 1,000 kg/m³ × 9.81 m/s² × 100 m / (0.80 × 3,600,000 J/kWh) = 0.340625 kWh/m³`, before friction. A full three-day outage at the target needs 300,000 m³ of alternate or stored water before margins. A 100,000 m³/day **nameplate** used 90% produces 32.85 million m³/year, 3.65 million below the service target. ## Stress ranges and omissions All low inputs are combined, then all highs, at u = 0.90 and p = $0.12/kWh. These ranges are deliberately selected scenarios, not confidence intervals or project quotes. | Comparator | K₀ at reference nameplate | e, kWh/m³ | v, USD/m³ | Calculated range, USD/m³ | |---|---:|---:|---:|---:| | SWRO | $250m–$600m | 3–5 | $0.10–$0.30 | $1.052–$2.322 | | Reuse | $150m–$400m | 0.7–2 | $0.10–$0.25 | $0.539–$1.438 | Capital allowances are not bottom-up estimates. New secondary treatment, major trunk upgrades, unusual site/marine works, land, outage storage, financing during construction, taxes, grants and an additional contingency reserve are excluded. Routine renewals are represented only by generic O&M allowances; discrete replacement schedules are not modeled. Electricity emissions exclude chemicals, embodied construction, direct process emissions and transmission losses. No discounting is applied to emissions. ## Unit checks One U.S. liquid gallon is exactly 231 cubic inches; one inch is 0.0254 m. Therefore 1 U.S. MGD is 3,785.411784 m³/day. One acre-foot uses 43,560 square feet times one foot, with a 0.3048 m international foot: 1,233.48183754752 m³. The target is 26.4172 U.S. MGD, or about 29,591 acre-feet/year. One GWh is 1,000,000 kWh; one tonne is 1,000 kg. For concentration, 1 g/L equals 1 kg/m³. ## What was independently checked The audit uses 50-digit decimal arithmetic and calculates capital recovery from the present value of 30 separate discounted payments. It checks Python and JavaScript across 80 combinations each, all returned numerical fields, baseline persistence, water and salt balances, volume/energy/mass conversions, hydraulic work, price sensitivity, cost stress endpoints, carbon table and graph points, conservation yield, the portfolio reversal, and invalid inputs. It also checks that every recommendation source list equals the union of its linked claims and assumptions, with additional background separated. These checks establish arithmetic consistency, not empirical truth.