question
-
- Junior Member
- Posts: 13
- Joined: Thu Nov 09, 2017 6:57 pm
- Vensim version: PLE
question
hi all,
i am master student in water resource management
i have a question in vensim model
how can put this equation in this model?
if A>0 , X(i)=0
else A<0, X(i)=X(i-1)+B
thanks.
i am master student in water resource management
i have a question in vensim model
how can put this equation in this model?
if A>0 , X(i)=0
else A<0, X(i)=X(i-1)+B
thanks.
Re: question
I'd be wary of such an equation, but you could implement it as:
x previous = DELAY FIXED(x,interval,x)
y = IF THEN ELSE( A>0, 0, x previous+B )
x previous = DELAY FIXED(x,interval,x)
y = IF THEN ELSE( A>0, 0, x previous+B )
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
-
- Super Administrator
- Posts: 4590
- Joined: Wed Mar 05, 2003 3:10 am
Re: question
It might be better if you explain what you are trying to do, maybe we can figure out the correct equation.elhamdavoodi wrote:hi all,
i am master student in water resource management
i have a question in vensim model
how can put this equation in this model?
if A>0 , X(i)=0
else A<0, X(i)=X(i-1)+B
thanks.
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
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Units are important!
http://www.bbc.co.uk/news/magazine-27509559
-
- Junior Member
- Posts: 13
- Joined: Thu Nov 09, 2017 6:57 pm
- Vensim version: PLE
Re: question
Hi
I am using Vensim PLE V. 6.4 in my thesis. I had to use below equation in vensim model.
APWL: is accumulated potential water loss.
When surface infiltration>0, APWL =0,
When surface infiltration<0, APWL(i)=APWL(i-1)+Surface Infiltration(i)
i-1 is refer to APWL in one month ago.
I attached the sample of this equation.
please help me.
thanks.
Elham
I am using Vensim PLE V. 6.4 in my thesis. I had to use below equation in vensim model.
APWL: is accumulated potential water loss.
When surface infiltration>0, APWL =0,
When surface infiltration<0, APWL(i)=APWL(i-1)+Surface Infiltration(i)
i-1 is refer to APWL in one month ago.
I attached the sample of this equation.
please help me.
thanks.
Elham
- Attachments
-
- APWL.jpg (98.74 KiB) Viewed 6835 times
-
- Super Administrator
- Posts: 4590
- Joined: Wed Mar 05, 2003 3:10 am
Re: question
Have a look at the attached model, it does something like you need.
The only issue is that things are delayed by a month, but that makes sense as in the table you uploaded, "surface infiltration" is almost certainly measured over the whole month, but APWL must be the value at the end of the month. Reducing the time step would make this look much better.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
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Units are important!
http://www.bbc.co.uk/news/magazine-27509559
Re: question
This is why I hate discrete time notation. It obscures stock-flow relationships. I think it's responsible for a lot of errors, especially in economics and social sciences.
I would rewrite this as an ordinary stock and flow:
AWPL stock = INTEG( loss rate, initial AWPL ) ~ units of something
loss rate = MAX(0, - infiltration) ~ units of something/time
I would rewrite this as an ordinary stock and flow:
AWPL stock = INTEG( loss rate, initial AWPL ) ~ units of something
loss rate = MAX(0, - infiltration) ~ units of something/time
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
-
- Junior Member
- Posts: 13
- Joined: Thu Nov 09, 2017 6:57 pm
- Vensim version: PLE
Re: question
thanks a lot for your reply
I am very happy that this problem has been resolved, but the value of APWL from this model not equal with excel value. I edited value and attached this model and APWL value in excel. Please in this case, guide me
I am very happy that this problem has been resolved, but the value of APWL from this model not equal with excel value. I edited value and attached this model and APWL value in excel. Please in this case, guide me
- Attachments
-
- APWL.jpg (98.74 KiB) Viewed 6814 times
-
- forum water example.mdl
- (2.58 KiB) Downloaded 172 times
Re: question
I don't see the Excel attachment.
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
-
- Junior Member
- Posts: 13
- Joined: Thu Nov 09, 2017 6:57 pm
- Vensim version: PLE
Re: question
I mean this is APWL photo that attached
Re: question
Your data is misaligned. In your screenshot, infiltration = -26.6 happens at time 4, but in the model it's at time 5.
Is APWL and indicator rather than a physical stock?
Is APWL and indicator rather than a physical stock?
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
-
- Junior Member
- Posts: 13
- Joined: Thu Nov 09, 2017 6:57 pm
- Vensim version: PLE
Re: question
this model created by Administrator
Re: question
In that case, there's no discrepancy, other than the input. It should work.
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
-
- Junior Member
- Posts: 13
- Joined: Thu Nov 09, 2017 6:57 pm
- Vensim version: PLE
Re: question
Administrator wrote:Have a look at the attached model, it does something like you need.
forum water example.mdl
The only issue is that things are delayed by a month, but that makes sense as in the table you uploaded, "surface infiltration" is almost certainly measured over the whole month, but APWL must be the value at the end of the month. Reducing the time step would make this look much better.
thanks a lot for your reply
I am very happy that this problem has been resolved, but the value of APWL from this model not equal with excel value. I edited value and attached this model and APWL value in excel. Please in this case, guide me
- Attachments
-
- forum water example.mdl
- (2.6 KiB) Downloaded 164 times
-
- APWL.jpg (98.74 KiB) Viewed 6804 times
Re: question
It's hard to diagnose "different" without having the Excel and Vensim models running on exactly the same infiltration data for comparison. The difference could be roundoff, or it could be a difference in inputs.
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
-
- Junior Member
- Posts: 13
- Joined: Thu Nov 09, 2017 6:57 pm
- Vensim version: PLE
Re: question
Hitomfid wrote:It's hard to diagnose "different" without having the Excel and Vensim models running on exactly the same infiltration data for comparison. The difference could be roundoff, or it could be a difference in inputs.
thanks for your reply
I attached excel data of surface infiltration and the APWL data Which should be calculated with vensim. The vensim mosel that created by Administerator is work very good and APWL value are correct but this value have a 1 month delay. How i can solve this problem?
- Attachments
-
- Surface infiltration.xlsx
- (15.5 KiB) Downloaded 156 times
Re: question
I think you'll have to use my original solution instead. Admin's version is more physically motivated, but there's no way to get rid of the lag in reporting the integration (though of course you could simply ignore it).
APWL previous = DELAY FIXED(APWL,TIME STEP,0)
APWL = IF THEN ELSE( infiltration>0, 0, APWL previous+infiltration )
APWL previous = DELAY FIXED(APWL,TIME STEP,0)
APWL = IF THEN ELSE( infiltration>0, 0, APWL previous+infiltration )
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Re: question
But again, if this is a physical process, not just accounting, it would be better to model it as a continuous time integration with TIME STEP << 1.
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
-
- Junior Member
- Posts: 13
- Joined: Thu Nov 09, 2017 6:57 pm
- Vensim version: PLE
Re: question
Hitomfid wrote:I think you'll have to use my original solution instead. Admin's version is more physically motivated, but there's no way to get rid of the lag in reporting the integration (though of course you could simply ignore it).
APWL previous = DELAY FIXED(APWL,TIME STEP,0)
APWL = IF THEN ELSE( infiltration>0, 0, APWL previous+infiltration )
Thanks for your reply
This method worked well.
Thankful
-
- Super Administrator
- Posts: 4590
- Joined: Wed Mar 05, 2003 3:10 am
Re: question
Do you want to model the physical process, or just replicate the results from the Excel table?
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
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Units are important!
http://www.bbc.co.uk/news/magazine-27509559
-
- Junior Member
- Posts: 13
- Joined: Thu Nov 09, 2017 6:57 pm
- Vensim version: PLE
????
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
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 (37.56 KiB) Viewed 6572 times
Re: question
If N is a proxy for time here, there are two answers.
1. This is acausal, 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 )
1. This is acausal, 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 )
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/