Controls
Presets
Parameters
Quality
Camera
Model checks
The science
NPV and IRR. A project pays cash flows CF0 = -I, CFt = A for years 1 to N-1 and CFN = -D (a clean-up or decommissioning bill in the last year). Its net present value at discount rate r is NPV(r) = Σ CFt (1+r)-t. The internal rate of return is a rate at which NPV = 0. With x = 1/(1+r) the NPV is the polynomial p(x) = Σ CFt xt, so the IRRs are its positive real roots, r = 1/x - 1.
Why the IRR can fail. By Descartes' rule of signs the number of positive roots is at most the number of sign changes of the cash flow, and differs from it by an even number. A conventional project (one outflow, then inflows) has one sign change and exactly one IRR. A project with a terminal outflow has two sign changes: it can have two IRRs (the classic -100, +230, -132 has 10 % and 20 %) or none, and then the IRR rule says nothing. NPV at the hurdle rate and the modified IRR, MIRR = (FV of inflows at the reinvestment rate / PV of outflows at the finance rate)1/N - 1, are always well defined.
Root finding. Newton's method rk+1 = rk - NPV/NPV' converges quadratically but only near a root and can jump to the wrong root or diverge when the derivative is small; bisection needs a sign change in the bracket and halves the interval each step (about log2(width/tolerance) iterations).
Simplifications. Annual end-of-year flows, a single constant hurdle rate, no tax, inflation or risk adjustment, and an illustrative parameter set rather than a real project. Checks: term-by-term NPV versus the closed-form annuity formula; IRRs from a sign-change scan with bisection versus all roots of the polynomial found by Durand-Kerner iteration; Descartes' rule and the NPV residual at every root; Newton from six start rates versus the root list and bisection iteration count versus theory; and the identity sign(NPV(r)) = sign(MIRR - r) when finance and reinvestment rates equal r.