Skip to content

Expected net present value and equivalent annual cost on the exact curves - #378

Merged
derrynknife merged 3 commits into
devfrom
feat/npv-phase1
Nov 4, 2026
Merged

derrynknife merged 3 commits into
devfrom
feat/npv-phase1

Conversation

@derrynknife

Copy link
Copy Markdown
Owner

What

The first part of a net present value valuation, in model time, exact (no simulation):

  • RepairableRBD.expected_npv(horizon, *, discount_rate=0.0, value_rate=0.0, periods=None, working_nodes=None, broken_nodes=None, method="p", state=None) returning ExpectedNPV: the net present value, its value and cost, the equivalent annual cost (eac, annuity form, tending to expected_cost_rate over a long horizon), the undiscounted totals, the cost by category and component, and a cash-flow table by period, category and component (present value and undiscounted, signed, adding up to npv).
  • Costs are expected_cost(discount_rate=)'s, so scheduled events are discounted at their exact times; the value is value_rate times the integral of exp(-r t) A(t) (the mission-availability quadrature gained a rate, with the settled level and period summed in closed form). Works from new or from state=.
  • NonRepairable.age_replacement_value(age, *, discount_rate=0.0) returning AgeReplacementValue: Fox's (1966) present value and equivalent annual cost of an age replacement over for ever; undiscounted it is cost_rate.
  • analysis_routes(), the capability matrix, the costs guide (a "Net present value" section), the maintenance use-case record (UC-19) and the CHANGELOG are updated.

Checks

test_expected_npv.py (closed forms: exponential availability discounted; repair cost as price x failure rate x discounted time up; block replacements at exact times; age replacement against Fox integrated independently; cost rate as the rate goes to 0; the table adding up; input checks). Run locally with the routes, docstring, docs-example, help, result-object and README-capability tests; not the full suite.

Not in this part

Value that varies in time and escalation, plans of actions at given times, the simulated distribution, crews as cash flows, NPV as an optimiser objective, and an infinite horizon.

🤖 Generated with Claude Code

https://claude.ai/code/session_019Km2eWBiPJ5JNkme3vRg4B

derrynknife and others added 3 commits November 3, 2026 22:08
…sent value of an age replacement

RepairableRBD.expected_npv: exact discounted cost and value, equivalent annual cost and a cash-flow table.
NonRepairable.age_replacement_value: Fox's discounted age replacement.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019Km2eWBiPJ5JNkme3vRg4B
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019Km2eWBiPJ5JNkme3vRg4B
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019Km2eWBiPJ5JNkme3vRg4B
@derrynknife
derrynknife merged commit bc0c7ad into dev Nov 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant