Page 1 of 1

Auxiliary variable to keep the smaller value...

Posted: Tue Nov 18, 2008 3:47 pm
by CLAUDIO
Dears

I do need to create a auxiliary variable "X2" that simply repeat the smaller values of auxiliary "X1" by time, trough comparing the value of an year with the value of the previous year, hence always having as output the smaller value of the auxiliary "X1" during the time...
i.e:
Year Y1 - Y2 - Y 3 - Y4 - Y5 - Y 6 - Y7 - Y8 - Y 9 - Y10 - Y11 - Y12
"X1" 20 19 18 16 17 18 17 15 14 13 14 14
"X2" 20 19 18 16 16 16 16 15 14 13 13 13

Somebody could give me a clue?

Tks

Claudio

auxiliary

Posted: Tue Nov 18, 2008 4:40 pm
by LAUJJL
Hi Claudio

The model joined may eventually do the job.
Regards.
JJ

[Edited on 18-11-2008 by LAUJJL]

Posted: Tue Nov 18, 2008 7:31 pm
by CLAUDIO
Dear JJ

Thank you very much for your prompt help.

Another point in my model that I've got staked is the attempting to represent a kind of model behavior that is also based in the smaller value by the time, but extracting those just from one auxiliary variable, so, not comparing that with another one.
i.e:
If I have got a set of values from an auxiliary variable that also could be:
20 19 18 16 17 18 17 15 14 13 14 14
I would need a reference equation that only consider the smaller value by time:
20 19 18 16 16 16 16 15 14 13 13 13

Could you help me on that, please?

Thank you

Claudio

Posted: Wed Nov 19, 2008 7:52 am
by Lee Jones
Try the attached model, it uses Sample_if_true and will give the behaviour you require.

Lee

auxiliary

Posted: Wed Nov 19, 2008 10:36 am
by LAUJJL
Hi

Sample if true does exactly the same job that my first model, see the second model where it is implemented, but I did not know if the sample if true function is implemented in PLE or PLE plus. In the documentation it says that it is not implemented. If it is not implemented you then have another alternative to do the job. Ti shows too how the sample if true function works.
Regards.
JJ

Posted: Wed Nov 19, 2008 5:00 pm
by CLAUDIO
Lee and JJ

Thank you both for the support.

My Vensim is a Standard Version 5.6d

The model auxiliary2.mdl is running perfectly.

While running the model Sample_if_true it came out with the following warning message:

WARNING: At 12 Above -#x1#- computing -x1-.

I did not understand why it came out if the model running ok. The message seems that is the logical syntax of the own function of the model.

Do you have some comments about that? Could I avoid that message?

Rgrds

Cláudio

auxiliiary

Posted: Thu Nov 20, 2008 9:15 am
by LAUJJL
Hi

X1 is not defined by the lookup at time 12, it then keeps the same value than at time 11, but with a warning.
To avoid the warning, just define x1 at time 12. See model attached with the slight modification.
Regards.
JJ

Posted: Fri Nov 21, 2008 3:26 am
by CLAUDIO
Hi JJ!

That is OK!

Thank you very much!

Best Regards

Cláudio