Is there any way we can do a step function with respect to a time basis? Suppose the initial value we take as say 10 and the time for the model being run as say maybe 30 days
Now, what if we try to have 3 different step functions with say:
1:Step to 20 between 0-10
2:Step to 10 between 10-20
3:Step to 15 between 20-30
Is there any way the step function can be say put into one command for all 3?
Step function key with respect to time
-
- Super Administrator
- Posts: 4573
- Joined: Wed Mar 05, 2003 3:10 am
Re: Step function key with respect to time
You can use some IF THEN ELSE statements. Or a lookup table.
What are you actually trying to do?
value to use = if then else ( time >=0 :and: <10, 20 , 0 )
+ if then else ( time >=10 :and: <20, 10 , 0
if then else ( time >=20 :and: <= final time, 15 , 0
What are you actually trying to do?
value to use = if then else ( time >=0 :and: <10, 20 , 0 )
+ if then else ( time >=10 :and: <20, 10 , 0
if then else ( time >=20 :and: <= final time, 15 , 0
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: Step function key with respect to time
Two more options:
1. Use multiple STEP functions:
value = initial value + STEP( new val 1-initial value, 10 ) + STEP( ..
2. Use a lookup. This will be much easier to interpret if there are several steps.
1. Use multiple STEP functions:
value = initial value + STEP( new val 1-initial value, 10 ) + STEP( ..
2. Use a lookup. This will be much easier to interpret if there are several steps.
/*
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: Step function key with respect to time
Ok so my doubt is said I have with me 100 tickets and that I want to use a step function with respect to time to calculate for say around a time period of 20 months. These 20 months is being divided into 3 different types with under type a different value i.e
In the first zone, tickets I have are say 40 for between 0-10 months.
In the second zone, tickets I have say 20 for between 10-15 months
In the third zone, tickets I have say 40 for between 15-20 months
I am running the model for 20 months but just that it is being divided this way. So now if I want to use multiple step functions under the stock tool, would it be possible or not.
In the first zone, tickets I have are say 40 for between 0-10 months.
In the second zone, tickets I have say 20 for between 10-15 months
In the third zone, tickets I have say 40 for between 15-20 months
I am running the model for 20 months but just that it is being divided this way. So now if I want to use multiple step functions under the stock tool, would it be possible or not.
Re: Step function key with respect to time
This will be an auxiliary variable, not a stock.
The simplest option might be to use IF THEN ELSE, like:
IF THEN ELSE( Time<time1, tickets1, IF THEN ELSE( Time<time2, tickets2, tickets3 ) ) ~ tickets/month
time1 = 10 ~ month
tickets1 = 40 ~ tickets/month
time2 = 15 ~ month
tickets1 = 20 ~ tickets/month
tickets3 = 40 ~ tickets/month
The simplest option might be to use IF THEN ELSE, like:
IF THEN ELSE( Time<time1, tickets1, IF THEN ELSE( Time<time2, tickets2, tickets3 ) ) ~ tickets/month
time1 = 10 ~ month
tickets1 = 40 ~ tickets/month
time2 = 15 ~ month
tickets1 = 20 ~ tickets/month
tickets3 = 40 ~ tickets/month
/*
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: Step function key with respect to time
I think I will rephrase my question since I think I wrote it wrongly. Say for example I am running a supermarket and the initial inventory of products I have within say a month would be around 250. Now say that I am trying to calculate the rest of my products that I am going to receive using a step-wise function with respect to time. Let’s say now 100 products for a duration of 0-10 months, 250 products between 10-15 months, and 150 products between 15-25 months. I will be running the model for 25 months i.e the duration at which my step function I ideally want to end at. So in this how would it be best to go about with it?
Re: Step function key with respect to time
Is there a reason the IF THEN ELSE approach above won't work?
If so, I'd probably use a lookup. Using the STEP function isn't really less complex than the IF statements.
If so, I'd probably use a lookup. Using the STEP function isn't really less complex than the IF statements.
/*
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
*/