code wiki / _hdl_build / nx_batt_econ.nx

nx_batt_econ.nx source

↩ module page · 29 lines · 1739 B

1// nx_batt_econ.nx -- shared economic CORE for the battery-reclamation finance organs (DRY #15). Pure i64 cents, 2// no-float, NO imports. Both nx_batt_finmodel (the workup) and nx_batt_bizplan (the written plan) compute from THIS 3// single source, so the plan can NEVER drift from the model. Constants are itemized + line-summed in 4// nx_batt_finmodel (its gate asserts the sum == these); figures grounded in 5// knowledge/research/2026-06-23-battery-reclaim-cost-basis.md (verified anchors + flagged assumptions). license_tier: ORIGINAL 6 7const BE_CAPEX_TOTAL: i64 = 4148800 // $41,488.00 initial investment (itemized in nx_batt_finmodel) 8const BE_OPEX_TOTAL: i64 = 880000 // $8,800.00 / mo operating cost (itemized in nx_batt_finmodel) 9 10// One scenario's NET monthly contribution (cents). Base = 150 power-tool + 25 e-bike + 80 diagnostic jobs/mo; 11// cell_c = per-cell cost; price_pct/demand_pct scale price & volume; extra_opex adds to base opex. 12func be_scenario_net(cell_c: i64, price_pct: i64, demand_pct: i64, extra_opex: i64) -> i64 { 13 let pt_j: i64 = 150*demand_pct/100 14 let eb_j: i64 = 25*demand_pct/100 15 let dg_j: i64 = 80*demand_pct/100 16 let pt_p: i64 = 6500*price_pct/100 17 let eb_p: i64 = 45000*price_pct/100 18 let dg_p: i64 = 5500*price_pct/100 19 let pt_cogs: i64 = 8*cell_c 20 let eb_cogs: i64 = 40*cell_c 21 let gross: i64 = pt_j*(pt_p-pt_cogs) + eb_j*(eb_p-eb_cogs) + dg_j*(dg_p-200) 22 return gross - (BE_OPEX_TOTAL + extra_opex) 23} 24func be_base_net() -> i64 { return be_scenario_net(529, 100, 100, 0) } 25func be_gross_base() -> i64 { return be_base_net() + BE_OPEX_TOTAL } 26func be_payoff_months(capex: i64, net: i64) -> i64 { 27 if net <= 0 { return 0 - 1 } 28 return (capex + net - 1) / net 29}