tracing the find zero function

Use this forum to post Vensim related questions.
Post Reply
LAUJJL
Senior Member
Posts: 1477
Joined: Fri May 23, 2003 10:09 am
Vensim version: DSS

tracing the find zero function

Post by LAUJJL »

Hi

I use in a model a variable subscripted that is equal to a function find zero which is included in a loop without stock and that stops looping when the find zero function converges.
The model runs without error and only one value for the variable is calculated for one subscript and the others show a -. At the start of the looping the values are calculated with the initialization of the find zero but at a certain moment of the looping something is probably happening. Is there a way to trace the different values taken by the variables situated on the loop during the process of convergence?
Regards.
J.J. Laublé
bob@vensim.com
Senior Member
Posts: 1107
Joined: Wed Mar 12, 2003 2:46 pm

Post by bob@vensim.com »

Hi JJ,

It does not sound to me like FIND ZERO is converging, but rather giving up because it can't compute something due to floating point problems. There should be some message issued.

as for tracing - there really isn't a way to do this but setting the tolerance to a big number then making it smaller (do it in SyntheSim mode) may yield some insight.
LAUJJL
Senior Member
Posts: 1477
Joined: Fri May 23, 2003 10:09 am
Vensim version: DSS

find zero

Post by LAUJJL »

I tried using the synthesim for all the parameters of the find zero function, it still shows only the values for one subscript value and not the two others.
The model is running as if it was no error and gives complete results but with warnings about values going out of range of
some lookups whose input depend from the missing values.
If I do not find a solution I will be obliged to subscript all the values on the loop with a subscript equal to the number of recalculations actualy 100, save the values at each recalculation in a different subscripted value and make my own function or eventually use the Vensim find zero, using the last value found as initial value for the find zero?

I have already used this method where there is a loop without stock, subscripting the values on the loop.

But before going to this complication, how can I verify that I
have all the ouputs possibles, included eventual errors from my simulation?
Regards.
J.J. Laublé
bob@vensim.com
Senior Member
Posts: 1107
Joined: Wed Mar 12, 2003 2:46 pm

Post by bob@vensim.com »

Hi JJ,

If the tolerance is made very large (say 1e20) then the FIND ZERO process should only go one iteration - you can look to see if the values for all elements are there (actually the should be the initial values I think)

I suggested SyntheSim on tolerance because you should be able to see when a change occurs - when it does make a graph of all the x vars to see what they are doing.

I hope that is helpful.
LAUJJL
Senior Member
Posts: 1477
Joined: Fri May 23, 2003 10:09 am
Vensim version: DSS

Find zero

Post by LAUJJL »

Hi Bob

I did as you told and put the tolerance to 1E20.
The find zero is subscripted with three values, only one value the first was calculated equal to the correct intitialization value and the two other were not calculated.
Everywhere the values are correctly calculated excepted two values that depend on the two values not calculated.
I thought that a run time error could occur elsewhere and then block further calcul of the model, but it does not seem the case as other values are correctly calculated.
In fact the initialization does not work with two values of the subscript. It is not normal too that there is no error message
happening, only out of bound warning concerning values calculated with the values not calculated.
The values calculated with the two values not calculated are very high e35, that should correspond with values of the not calculated values of the same order of size. Which prooves that Vensim could manage to make calculations with no calculated values! Maybe these values are too high too.
The initialization values are the same for the three subscripted find zero, 0.5.
I can if you want send you the model, it has french names!
Thanks for bothering with my problem.
Regards.
JJ
bob@vensim.com
Senior Member
Posts: 1107
Joined: Wed Mar 12, 2003 2:46 pm

Post by bob@vensim.com »

Hi JJ,

At a guess there is a problem either with the order of subscript of the value of n passed to the function. I would be happy to take a look at your model.
LAUJJL
Senior Member
Posts: 1477
Joined: Fri May 23, 2003 10:09 am
Vensim version: DSS

find zero

Post by LAUJJL »

Hi Bob

You were right. The model had a previous version working with no subscript and I had not modified the n nor transformed the one (the scaling factors) into a subscripted value.
Thank you very much for your help.
Best regards.
JJ.
Post Reply