Page 1 of 1

Question

Posted: Thu Feb 01, 2018 8:03 pm
by elhamdavoodi
Hi every one
I have a question about vensim:
I have use the condition function that if X in the time series=Max, then X+b, X
X is the number in the time step
How i can do this?
the attached pic my concept
thanks a lot

Re: Question

Posted: Fri Feb 02, 2018 1:06 am
by tomfid
If N is a proxy for time here, there are two answers.

1. If the maximum is taken over all time, this is acausal (except at the end of the run), i.e. it implies knowledge of the future, which is impossible both in reality and in the model.

2. If what you mean by MAX is the largest value encountered so far at time t, then it's possible. You could do the following:

maximum x = SAMPLE IF TRUE( x > maximum x, x, x)
y = IF THEN ELSE( x >= maximum x, x+b, x )

Re: Question

Posted: Fri Feb 02, 2018 12:31 pm
by elhamdavoodi
Hello
thanks for your reply
this function did not work properly
I want do this (attached Pic)
It is worth mentioning that I use free version (Vensim PLE)
I 'll thank you to guide me .

Re: Question

Posted: Fri Feb 02, 2018 4:45 pm
by Administrator
Try the attached model.
forum demo.mdl
(1.74 KiB) Downloaded 221 times

Re: Question

Posted: Fri Feb 02, 2018 5:54 pm
by elhamdavoodi
thanks for your reply
my goal that max A in total A time series select, in this time series A is 13.97

Re: Question

Posted: Sat Feb 03, 2018 7:16 am
by elhamdavoodi
Please help me to solve this problem

Re: Question

Posted: Sat Feb 03, 2018 10:06 am
by Administrator
The demo model I uploaded does give you the maximum value.