The question about Find Zero function

Use this forum to post Vensim related questions.
Post Reply
kong17
Junior Member
Posts: 12
Joined: Wed May 30, 2018 1:12 pm
Vensim version: PRO

The question about Find Zero function

Post by kong17 » Mon Oct 14, 2019 4:25 pm

Hi, everyone

I want to achieve this equation
1111.png
1111.png (8.07 KiB) Viewed 116 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 116 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 116 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

kong17
Junior Member
Posts: 12
Joined: Wed May 30, 2018 1:12 pm
Vensim version: PRO

Re: The question about Find Zero function

Post by kong17 » Mon Oct 14, 2019 4:26 pm

The simple model
Attachments
FIND ZERO.mdl
(21.77 KiB) Downloaded 7 times

tomfid
Administrator
Posts: 2764
Joined: Wed May 24, 2006 4:54 am

Re: The question about Find Zero function

Post by tomfid » Mon Oct 14, 2019 5:21 pm

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.

tomfid
Administrator
Posts: 2764
Joined: Wed May 24, 2006 4:54 am

Re: The question about Find Zero function

Post by tomfid » Mon Oct 14, 2019 5:34 pm

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.

tomfid
Administrator
Posts: 2764
Joined: Wed May 24, 2006 4:54 am

Re: The question about Find Zero function

Post by tomfid » 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
(9.73 KiB) Downloaded 10 times

kong17
Junior Member
Posts: 12
Joined: Wed May 30, 2018 1:12 pm
Vensim version: PRO

Re: The question about Find Zero function

Post by kong17 » Mon Oct 14, 2019 6:43 pm

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.

Post Reply