Hi,
I'm working on calculating the value of one parameter that occurrs at difference time-scale.
I want to create the time step (look like the one in the figure) to control the calculation.
I can't generate that kind of graph using the IF THEN ELSE, and STEP functions (referred to Vensim model).
Could anyone kindly suggest me what functions can i use to generate this kind of graphs.
I attached a picture and a vensim model for your information.
I really appreciate any help.
Best regards,
Inthan
TIME STEP FUNCTION
-
- Member
- Posts: 34
- Joined: Thu Jan 28, 2016 6:01 pm
- Vensim version: DSS
TIME STEP FUNCTION
- Attachments
-
- Time Contraint.vmf
- (12.69 KiB) Downloaded 298 times
-
- TIMESTEP for control calculation
- TIMESTEP_GRAPH.png (8.7 KiB) Viewed 5293 times
Re: TIME STEP FUNCTION
I think, generically, your strategy could be something like:
Phase a start = 3
Phase a duration = 4
Phase b start = INITIAL(Phase a start+phase a duration + TIME STEP) ~ time step is optional to prevent concurrence of a & b
Phase b duration = 5
Phase a is started = STEP(1,Phase a start)
Phase a is done = STEP(1,Phase a start+Phase a duration)
Phase a is active = Phase a is started - Phase a is done
Phase b is started = STEP(1,Phase b start)
Phase b is done = STEP(1,Phase b start+Phase b duration)
Phase b is active = Phase b is started - Phase b is done
If there are a lot of activities, this is easier done with arrays - see the project model example in the help system.
If you want the phase durations to vary dynamically or randomly, you need to take a slightly different approach. Create a state machine, with a stock representing each phase's activity state.
Phase a start = 3
Phase a duration = 4
Phase b start = INITIAL(Phase a start+phase a duration + TIME STEP) ~ time step is optional to prevent concurrence of a & b
Phase b duration = 5
Phase a is started = STEP(1,Phase a start)
Phase a is done = STEP(1,Phase a start+Phase a duration)
Phase a is active = Phase a is started - Phase a is done
Phase b is started = STEP(1,Phase b start)
Phase b is done = STEP(1,Phase b start+Phase b duration)
Phase b is active = Phase b is started - Phase b is done
If there are a lot of activities, this is easier done with arrays - see the project model example in the help system.
If you want the phase durations to vary dynamically or randomly, you need to take a slightly different approach. Create a state machine, with a stock representing each phase's activity state.
/*
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
*/
-
- Member
- Posts: 34
- Joined: Thu Jan 28, 2016 6:01 pm
- Vensim version: DSS
Re: TIME STEP FUNCTION
Thank you so very much Tom for your suggestions.
I can't thank you enough.
Regards,
Inthan
I can't thank you enough.
Regards,
Inthan
Re: TIME STEP FUNCTION
Hi Tom - this is excatly the situation I'm facing right now. Can you elaborate your proposal of a state machine a bit in more detail please?If you want the phase durations to vary dynamically or randomly, you need to take a slightly different approach. Create a state machine, with a stock representing each phase's activity state.
Thanks in advance
Stefan
-
- Super Administrator
- Posts: 4589
- Joined: Wed Mar 05, 2003 3:10 am
Re: TIME STEP FUNCTION
You need a stock per state. For example,
car is travelling = integ ( car starts travelling - car stops travelling , 0 )
All variables above will be either 0 or 1. You can then add more stocks (eg, car is parked) and the car travels through the states.
Hope this helps.
car is travelling = integ ( car starts travelling - car stops travelling , 0 )
All variables above will be either 0 or 1. You can then add more stocks (eg, car is parked) and the car travels through the states.
Hope this helps.
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: TIME STEP FUNCTION
If the timing is static, you don't need the state machine. You can just chain together the delays you have:
If you want the phases to be nonoverlapping, just add TIME STEP to the start time in the second equation.
Code: Select all
Reconnaissance phase=
PULSE(INITIAL TIME, "Total reconnaissance time (y)" )
Units: Dmnl
**************************************************************
Prospecting Phase=
PULSE(INITIAL TIME+"Total reconnaissance time (y)","Total prospecting time (y)"
)
Units: Dmnl
**************************************************************
/*
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: TIME STEP FUNCTION
The state machine might look like this:
Note the division by TIME STEP for dimensional consistency; without that, your model won't work if TIME STEP <> 1.
The trigger could be a DELAY FIXED of the previous start, but with that kind of fixed timing, the state machine is really overkill.Code: Select all
Starting Exploration=
Prospecting*Trigger for Start of Prospecting/TIME STEP
Units: 1/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: TIME STEP FUNCTION
See also: http://vensim.com/discrete-stochastic/
/*
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
*/