Page 1 of 1

The question about Find Zero function

Posted: Mon Oct 14, 2019 4:25 pm
by kong17
Hi, everyone

I want to achieve this equation
1111.png
1111.png (8.07 KiB) Viewed 2690 times
when the equation equal to zero, find the value of p.
So, I used Find Zero function to solve it.
But, when I run the model, the simulation results are incorrect
22222.png
22222.png (6.45 KiB) Viewed 2690 times
This is because the denominator cannot be 0.
And, when I change the initial x in Find Zero, the results also have error
3333.png
3333.png (20.51 KiB) Viewed 2690 times
.
The value of p in the equation must not be zero.
I was wondering how to set the equation run it in Vensim if p≠0 is satisfied.
If it can be solved, I uploaded a simple example below.
Thank you very much!

Kind regards

Re: The question about Find Zero function

Posted: Mon Oct 14, 2019 4:26 pm
by kong17
The simple model

Re: The question about Find Zero function

Posted: Mon Oct 14, 2019 5:21 pm
by tomfid
I think the immediate problem is that you have the initial guess (initial x) set to 0. If the function's first execution is invalid, it can't proceed with a search.

If you set initial x = 1, it runs, but there's no solution to the equation, so it still fails to converge.

Re: The question about Find Zero function

Posted: Mon Oct 14, 2019 5:34 pm
by tomfid
To clarify, the equation in the model uploaded appears to differ from the one in your initial post. The model has no solution; the original equation might.

Re: The question about Find Zero function

Posted: Mon Oct 14, 2019 6:35 pm
by tomfid
I don't know what any of this means, but with a corrected expression it works:
FIND ZERO 2.mdl
(9.73 KiB) Downloaded 252 times

Re: The question about Find Zero function

Posted: Mon Oct 14, 2019 6:43 pm
by kong17
tomfid wrote: Mon Oct 14, 2019 6:35 pm I don't know what any of this means, but with a corrected expression it works:
FIND ZERO 2.mdl
I see. Thank you for your help.