Page 1 of 1

A question about Find Zero Function

Posted: Tue Jun 23, 2020 1:09 pm
by kong17
Hi everyone

I have a question about the function of FIND ZERO
The model I tried to build calculates IRR based on current profits, to assess whether there is any appeal for investment. Vensim has an IRR function, but his results are more about showing the evolution of the results.
Therefore, I consider using the FIND ZERO function to calculate IRR under the premise of NPV=0.
But I have some doubts when I use the FIND ZERO function.
2.png
2.png (15.35 KiB) Viewed 2816 times
3.png
3.png (10.33 KiB) Viewed 2816 times
When I run the model, the system report error that FIND ZERO did not sufficiently zero. It is shown in figure of NPV
My understanding is that when FInd zero cannot find 0, we cannot calculate the IRR. But such a huge difference (the figure of NPV) does not affect the IRR result graph, so, I was wondering what's wrong with that?
In the above figure, the profit as a fixed value. I uploaded a simple model that how I calculate the IRR by FIND ZERO function, when I use random funtion to as the profit, a result of NPV has very large negative value. But from the profit of the input data, and the result of the calculated IRR does not reflect such a different difference.

Thank you very much for you attention.
simple.mdl
(4.2 KiB) Downloaded 289 times

Re: A question about Find Zero Function

Posted: Tue Jun 23, 2020 2:36 pm
by tomfid
I think the problem is that this is numerically cranky as formulated. Your NPV has a scale ~ investment, i.e. billions, while your x scale parameter is set to 1. Zeroing the npv to the nearest dollar is hard (and a waste of computation since the prospective NPV of a project is never certain).

Set x scale to 1e9 and tolerance to something like 100 and it works fine.

A more general approach might be to compute frac err = NPV/investment cost, and zero that in place of NPV. That way you can use parameters like x scale = 1 and tolerance = .0001, which seems more natural.

Re: A question about Find Zero Function

Posted: Wed Jun 24, 2020 2:08 pm
by kong17
tomfid wrote: Tue Jun 23, 2020 2:36 pm I think the problem is that this is numerically cranky as formulated. Your NPV has a scale ~ investment, i.e. billions, while your x scale parameter is set to 1. Zeroing the npv to the nearest dollar is hard (and a waste of computation since the prospective NPV of a project is never certain).

Set x scale to 1e9 and tolerance to something like 100 and it works fine.

A more general approach might be to compute frac err = NPV/investment cost, and zero that in place of NPV. That way you can use parameters like x scale = 1 and tolerance = .0001, which seems more natural.
It works, thank you very much.