Question

Use this forum to post Vensim related questions.
Post Reply
elhamdavoodi
Junior Member
Posts: 13
Joined: Thu Nov 09, 2017 6:57 pm
Vensim version: PLE

Question

Post 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
Attachments
Capture.JPG
Capture.JPG (37.56 KiB) Viewed 2858 times
tomfid
Administrator
Posts: 3804
Joined: Wed May 24, 2006 4:54 am

Re: Question

Post 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 )
elhamdavoodi
Junior Member
Posts: 13
Joined: Thu Nov 09, 2017 6:57 pm
Vensim version: PLE

Re: Question

Post 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 .
Attachments
Capture.JPG
Capture.JPG (35.45 KiB) Viewed 2840 times
Administrator
Super Administrator
Posts: 4573
Joined: Wed Mar 05, 2003 3:10 am

Re: Question

Post by Administrator »

Try the attached model.
forum demo.mdl
(1.74 KiB) Downloaded 216 times
Advice to posters seeking help (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391

Units are important!
http://www.bbc.co.uk/news/magazine-27509559
elhamdavoodi
Junior Member
Posts: 13
Joined: Thu Nov 09, 2017 6:57 pm
Vensim version: PLE

Re: Question

Post 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
elhamdavoodi
Junior Member
Posts: 13
Joined: Thu Nov 09, 2017 6:57 pm
Vensim version: PLE

Re: Question

Post by elhamdavoodi »

Please help me to solve this problem
Administrator
Super Administrator
Posts: 4573
Joined: Wed Mar 05, 2003 3:10 am

Re: Question

Post by Administrator »

The demo model I uploaded does give you the maximum value.
Advice to posters seeking help (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391

Units are important!
http://www.bbc.co.uk/news/magazine-27509559
Post Reply