Hi colleagues,
I am new to using Vensim, and I am writing to ask for your help with my simple model's equations.
Component modeling is simple: it requires a component to vary between two states 1 (available) and 0 (failed). These states are given by the likelihood of being recovered and by the likelihood of failure. I'm even fine, I could raise the equations with IF THEN ELSE and RANDOM UNIFORM equations, and the model works fine with the component going in and out of service.
The problem I have is that I cannot correctly implement the following additional characteristic that the proposal has. Once the component have failed (state = 0), the time for the recovery action requires 7 units of time to be able to be returned to available (state = 1).
I tried using the DELAY and SMOOTH functions. Still, the simulation always changes state without incorporating the effect of the time needed to recover (7 time units) effectively. I am attaching the model file to ask you for help to solve this problem that may be simple but that I cannot solve.
Thank you very much in advance for explaining me how to solve it and for your help.
Help with simple component state modeling
Re: Help with simple component state modeling
Try this:
Code: Select all
Fail=
IF THEN ELSE(State=1 :AND:Failure likelihood<=2,1,0)/TIME STEP
Units: 1/Hour
Failure likelihood=
RANDOM UNIFORM(0, 100 , 1235 )
Units: dmnl
Recover= DELAY FIXED (
Fail,Recovery time,0)
Units: 1/Hour
Recovery time=
7
Units: Hour
State= INTEG (
Recover-Fail,
1)
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: Help with simple component state modeling
Dear @tomfid
Thank you very much, it works! But in these equations is not considerate a variable about the "likelihood of success” of the recovery action (a RANDOM UNIFORM function that emulate the success or fail of the recovery action).
Very please, could you help me to integrate this variable in the equations?
Thank you, in advance, for helping me.
Thank you very much, it works! But in these equations is not considerate a variable about the "likelihood of success” of the recovery action (a RANDOM UNIFORM function that emulate the success or fail of the recovery action).
Very please, could you help me to integrate this variable in the equations?
Thank you, in advance, for helping me.
Re: Help with simple component state modeling
Is the likelihood of success a one-time factor, so that the state has one chance to recover, and failure means it never recovers?
Or is it continuous, such that a mean recovery time of 7hr means that the chance of recovery is 1/7 per hour?
Or is it continuous, such that a mean recovery time of 7hr means that the chance of recovery is 1/7 per hour?
/*
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: Help with simple component state modeling
to this type of component correspond this-> the likelihood of success is a one-time factor, so that the state has one chance to recover, and failure means it never recovers? Yes.
to another type of component we can have 2 o 3 trys to recover it and if in the second/third if we fail overall system fails.
Thanks a lot!!!!!!!
to another type of component we can have 2 o 3 trys to recover it and if in the second/third if we fail overall system fails.
Thanks a lot!!!!!!!
Re: Help with simple component state modeling
You might take a look at some of the models in https://metasd.com/category/model-libra ... /discrete/ and https://metasd.com/category/model-libra ... tochastic/
The one-shot recovery is fairly easy: you could just modify the Recover flow to include some randomness.
Having 2 or 3 recovery opportunities, followed by permanent failure, is trickier - I think you would need at least 2 states: one to keep track of working/failed, and another to keep track of number of recovery attempts.
The one-shot recovery is fairly easy: you could just modify the Recover flow to include some randomness.
Having 2 or 3 recovery opportunities, followed by permanent failure, is trickier - I think you would need at least 2 states: one to keep track of working/failed, and another to keep track of number of recovery attempts.
/*
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: Help with simple component state modeling
Thank you very much for your help and for your website with examples. I will be working following your comments.
I have one more question. In the equations line of code of your first post "/ TIME STEP" appears.:
Fail =
IF THEN ELSE (State = 1: AND: Failure likelihood <= 2,1,0) / TIME STEP
But when I type it in the VENSIM equation, a window tells me "the following inputs were not expected".
Could you please explain to me what implications this part of the equation has? From a practical point of view I ran the model deleting it so that this window does not appear.
I have one more question. In the equations line of code of your first post "/ TIME STEP" appears.:
Fail =
IF THEN ELSE (State = 1: AND: Failure likelihood <= 2,1,0) / TIME STEP
But when I type it in the VENSIM equation, a window tells me "the following inputs were not expected".
Could you please explain to me what implications this part of the equation has? From a practical point of view I ran the model deleting it so that this window does not appear.
Re: Help with simple component state modeling
If you're using PLE, you need to add TIME STEP to the diagram as a shadow variable and draw an arrow before using it in the equation.
TIME STEP is there because all flows need a concept of "how fast" - the duration over which something changes. In the case of a discrete event, changing one unit, the flow has to be 1/TIME STEP so that it integrates to 1.
If TIME STEP=1, you can get away without this, but the model will be dimensionally inconsistent. If you aren't checking units, you aren't taking advantage of the single most important automated quality check available.
See https://vensim.com/discrete-stochastic/
https://metasd.com/2017/11/discrete-time-stinks/
https://metasd.com/2010/04/rental-car-s ... -dynamics/
TIME STEP is there because all flows need a concept of "how fast" - the duration over which something changes. In the case of a discrete event, changing one unit, the flow has to be 1/TIME STEP so that it integrates to 1.
If TIME STEP=1, you can get away without this, but the model will be dimensionally inconsistent. If you aren't checking units, you aren't taking advantage of the single most important automated quality check available.
See https://vensim.com/discrete-stochastic/
https://metasd.com/2017/11/discrete-time-stinks/
https://metasd.com/2010/04/rental-car-s ... -dynamics/
/*
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: Help with simple component state modeling
Thank you very much @tomfid!
Your answers and comments help me a lot!
Your answers and comments help me a lot!