Subscripts and random distribution
Subscripts and random distribution
Hi,
I'm trying to adapt this standard model in developing my model. The attached file involves three tasks, each task starts as soon the earlier finished. Now,
1- How to start task 2 as soon as 50% of task 1 is finished?
2- " Max work accomplishment" is having values 188, 304, 326. Instead of using deterministic values, i would like to use probability distribution such as RANDOM NORMAL( {min} , {max} , {mean} , {stdev} , {seed} ), RANDOM NORMAL( {min} , {max} , {mean} , {stdev} , {seed} ), RANDOM NORMAL( {min} , {max} , {mean} , {stdev} , {seed} ), each one corresponds to task. When i entered the probability in the equation editor, i get error.
Thank you
I'm trying to adapt this standard model in developing my model. The attached file involves three tasks, each task starts as soon the earlier finished. Now,
1- How to start task 2 as soon as 50% of task 1 is finished?
2- " Max work accomplishment" is having values 188, 304, 326. Instead of using deterministic values, i would like to use probability distribution such as RANDOM NORMAL( {min} , {max} , {mean} , {stdev} , {seed} ), RANDOM NORMAL( {min} , {max} , {mean} , {stdev} , {seed} ), RANDOM NORMAL( {min} , {max} , {mean} , {stdev} , {seed} ), each one corresponds to task. When i entered the probability in the equation editor, i get error.
Thank you
Last edited by Hani on Mon Jan 07, 2013 8:38 pm, edited 1 time in total.
-
- Super Administrator
- Posts: 4592
- Joined: Wed Mar 05, 2003 3:10 am
Re: Subscripts and random distribution
See the attached model, this does what you need.
Tony.
Tony.
- Attachments
-
- PROJ3.MDL
- (3.65 KiB) Downloaded 230 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
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Units are important!
http://www.bbc.co.uk/news/magazine-27509559
Re: Subscripts and random distribution
That's awesome Tony. Thank you so much.Administrator wrote:See the attached model, this does what you need.
Tony.
What about the distribution entry (the second part of the question)?
-
- Super Administrator
- Posts: 4592
- Joined: Wed Mar 05, 2003 3:10 am
Re: Subscripts and random distribution
What was the error you got?
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: Subscripts and random distribution
I replaced the deterministic values of the " max work accomplishment" by probability distribution for all nine task as shown in the attached model, i used the add Eq.Administrator wrote:What was the error you got?
- Attachments
-
- PROJ3_2.mdl
- (4.98 KiB) Downloaded 218 times
Re: Subscripts and random distribution
Somehow you have multiple identical instances of the equation for max work accomplishment. If you hit the "Remove" button until there's only one (the remove button will disappear), the model runs.
A few other observations:
- you might want to make max work accomplishment an Initial, if it's meant to represent a fixed rate for each scope element, rather than varying at each time step
- the expression 100 + 25*RANDOM NORMAL(-1,1,0,1,0) will give you a fairly strongly truncated normal distribution, because the min (-1) and max (1) are only one standard deviation away from the mean (0). It would be more typical to truncate 2-3 standard deviations out, or 6 if you want an effectively unconstrained distribution (though in this case that could lead to rare negative values)
- you probably should take the 100 and 25 and pull them out as separate named variables, so that you can assign units to everything
Tom
A few other observations:
- you might want to make max work accomplishment an Initial, if it's meant to represent a fixed rate for each scope element, rather than varying at each time step
- the expression 100 + 25*RANDOM NORMAL(-1,1,0,1,0) will give you a fairly strongly truncated normal distribution, because the min (-1) and max (1) are only one standard deviation away from the mean (0). It would be more typical to truncate 2-3 standard deviations out, or 6 if you want an effectively unconstrained distribution (though in this case that could lead to rare negative values)
- you probably should take the 100 and 25 and pull them out as separate named variables, so that you can assign units to everything
Tom
/*
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: Subscripts and random distribution
Thank so mcuh for your respond
How to represent every scope with probability distribution that makes every scope processed with rate that changes at every time step ?
Summary,tomfid wrote:Somehow you have multiple identical instances of the equation for max work accomplishment. If you hit the "Remove" button until there's only one (the remove button will disappear), the model runs.
You mean the "Del" button as there is no "Remove" button. The values in the identical equations are going to be changes, i'm using same equation coz i'm testing the model, but those values will be changed and might have different prob dist for every scope. As i understood, that i have to delete 8 equations out of 9?. I need to represent each scope with probability distribution that changes the rate at every hour. This intended to model randomness. So, how to do that in vensim is not clear to me.
A few other observations:
- you might want to make max work accomplishment an Initial, if it's meant to represent a fixed rate for each scope element, rather than varying at each time step
"Max work accomplishment' should be a probability distribution, and every scope must have its own prob dist. that change the rate for every scope at every time step.
- the expression 100 + 25*RANDOM NORMAL(-1,1,0,1,0) will give you a fairly strongly truncated normal distribution, because the min (-1) and max (1) are only one standard deviation away from the mean (0). It would be more typical to truncate 2-3 standard deviations out, or 6 if you want an effectively unconstrained distribution (though in this case that could lead to rare negative values).
ok.
- you probably should take the 100 and 25 and pull them out as separate named variables, so that you can assign units to everything
ok.
Tom
How to represent every scope with probability distribution that makes every scope processed with rate that changes at every time step ?
Re: Subscripts and random distribution
Right - it's "Remove" in vensim 6, "Del" in earlier versions.
I don't have the model in front of me, but as I recall you had something like:
You can't do that, because your left hand side is repeatedly defining the same elements of scope.
You could write equations for individual elements, as in
That works, but it's not necessary if you're just trying to get different random draws for each element. That will already happen if you simply write,
I don't have the model in front of me, but as I recall you had something like:
Code: Select all
scope : (s1-s5)~~|
myvar[scope] = 100+25*RANDOM NORMAL(...)~~|
myvar[scope] = 100+25*RANDOM NORMAL(...)~~|
myvar[scope] = 100+25*RANDOM NORMAL(...)~~|
myvar[scope] = 100+25*RANDOM NORMAL(...)~~|
myvar[scope] = 100+25*RANDOM NORMAL(...)~~|
You could write equations for individual elements, as in
Code: Select all
scope : (s1-s5)~~|
myvar[s1] = 100+25*RANDOM NORMAL(...)~~|
myvar[s2] = 100+25*RANDOM NORMAL(...)~~|
myvar[s3] = 100+25*RANDOM NORMAL(...)~~|
myvar[s4] = 100+25*RANDOM NORMAL(...)~~|
myvar[s5] = 100+25*RANDOM NORMAL(...)~~|
Code: Select all
scope : (s1-s5)~~|
myvar[scope] = 100+25*RANDOM NORMAL(...)~~|
/*
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: Subscripts and random distribution
Thank you so much Tom, it worked.
In fact i need different distributions as i have 9 scopes each associated with different probability for rate production.
In fact i need different distributions as i have 9 scopes each associated with different probability for rate production.
Re: Subscripts and random distribution
If the distributions differ only in parameters (i.e., they're all NORMAL), then you could do:
If the distributions also differ (some NORMAL, some UNIFORM, etc.), they you'll need to write element-specific equations, e.g. myvar[s1] = ... myvar[s2] = ...
Code: Select all
scope: (s1-s3)~~|
mean[scope] = 1,2,3~~|
std dev[scope] = 3,4,5~~|
myvar[scope] = mean[scope]+std dev[scope]*RANDOM NORMAL(-6,6,0,1,seed)
/*
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: Subscripts and random distribution
Hi Tony and AdministratorAdministrator wrote:See the attached model, this does what you need.
Tony.
Please refer to PROJ3 model in this thread.
Task size 14500, 29200, 192700... Total=236,400
After running the model and computing the final total work using function SUM( Work Done[task!] ) i get 235,000....why is that? Can you please put some light on that..
Thank you.
-
- Super Administrator
- Posts: 4592
- Joined: Wed Mar 05, 2003 3:10 am
Re: Subscripts and random distribution
You will need to debug the model to figure out why the end values are incorrect. My guess is that it is something to do with
IF THEN ELSE( Work Done[task] >= 0.98 * TASK SIZE[task], 1, 0)
IF THEN ELSE( Work Done[task] >= 0.98 * TASK SIZE[task], 1, 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: Subscripts and random distribution
Please accept my appreciation for the great and prompt support...You are right...the problem is with 0.98..Administrator wrote:You will need to debug the model to figure out why the end values are incorrect. My guess is that it is something to do with
IF THEN ELSE( Work Done[task] >= 0.98 * TASK SIZE[task], 1, 0)