Randomized pulse train
-
- Senior Member
- Posts: 102
- Joined: Wed Jul 30, 2014 7:09 am
- Vensim version: PLE
Randomized pulse train
Hi to everybody
I'm using Vensim 5.11 PLE... I would like to define a pulse train where all the parameters (mandatory are amplitude of each pulse, width and repetition time) can vary randomly within two arbitrarily fixed intervals. I am interested in uniform distributions at least. I serched for this topic in this forum but I was not able to find a satisfactory answer... some of you has any idea?
Best regards and best wishes
Lorenzo Cioni
I'm using Vensim 5.11 PLE... I would like to define a pulse train where all the parameters (mandatory are amplitude of each pulse, width and repetition time) can vary randomly within two arbitrarily fixed intervals. I am interested in uniform distributions at least. I serched for this topic in this forum but I was not able to find a satisfactory answer... some of you has any idea?
Best regards and best wishes
Lorenzo Cioni
-
- Super Administrator
- Posts: 4621
- Joined: Wed Mar 05, 2003 3:10 am
Re: Randomized pulse train
Have you tried using the RANDOM UNIFORM function to generate the numbers that you then feed to the pulse train?
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
-
- Senior Member
- Posts: 102
- Joined: Wed Jul 30, 2014 7:09 am
- Vensim version: PLE
Re: Randomized pulse train
Hi, thank you for your answer... I tried but surely I made some mistakes somewhere. If I use RANDOM UNIFORM for the amplitude and the width is higher than TIME STEP I get random aplitudes within the same pulse and this is NOT what I want... Hope to have been clear...Administrator wrote:Have you tried using the RANDOM UNIFORM function to generate the numbers that you then feed to the pulse train?
Best regards and best wishes.
Lorenzo
-
- Super Administrator
- Posts: 4621
- Joined: Wed Mar 05, 2003 3:10 am
Re: Randomized pulse train
Can you post what you have done and explain what you need? I'm struggling to understand what you want to achieve.
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
-
- Senior Member
- Posts: 102
- Joined: Wed Jul 30, 2014 7:09 am
- Vensim version: PLE
Re: Randomized pulse train
First of all thank you. This is the "culprit":Administrator wrote:Can you post what you have done and explain what you need? I'm struggling to understand what you want to achieve.
RANDOM UNIFORM( minH , maxH, 0 )*PULSE TRAIN(start, 1 , 6, FINAL TIME )
and as an attacment you find the model where I want to use it. Run it with TIME STEP << 1 h=3 and look at the flows in, f12 anf f2out. Do they behave as you would exepct? I think no.
Best regrads and best wishes.
Lorenzo
- Attachments
-
- 8.8.mdl
- (5.37 KiB) Downloaded 289 times
-
- Super Administrator
- Posts: 4621
- Joined: Wed Mar 05, 2003 3:10 am
Re: Randomized pulse train
I'd start by separating out the "RANDOM UNIFORM( minH , maxH, 0 )*PULSE TRAIN(start, 1 , 6, FINAL TIME )" into two separate variables. It's impossible to debug when you cannot see what values are being generated by the functions.
Code: Select all
RN = RANDOM UNIFORM( minH , maxH, 0 )
PT = PULSE TRAIN(start, 1 , 6, FINAL TIME )
in0 = RN * PT
The calculations are correct. Why do you think they are wrong?Run it with TIME STEP << 1 h=3 and look at the flows in, f12 anf f2out. Do they behave as you would exepct? I think no.
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: Randomized pulse train
Are you looking for pulses of controllable width and height, at random times? That can be implemented with a stock structure - I could cook up a demo structure if that's what you're after.
/*
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
*/
-
- Senior Member
- Posts: 102
- Joined: Wed Jul 30, 2014 7:09 am
- Vensim version: PLE
Re: Randomized pulse train
Hi, first of all thank you...Administrator wrote:I'd start by separating out the "RANDOM UNIFORM( minH , maxH, 0 )*PULSE TRAIN(start, 1 , 6, FINAL TIME )" into two separate variables. It's impossible to debug when you cannot see what values are being generated by the functions.
Code: Select all
RN = RANDOM UNIFORM( minH , maxH, 0 ) PT = PULSE TRAIN(start, 1 , 6, FINAL TIME ) in0 = RN * PT
The calculations are correct. Why do you think they are wrong?Run it with TIME STEP << 1 h=3 and look at the flows in, f12 anf f2out. Do they behave as you would exepct? I think no.
I think the calculations are wrong since I want the flow in assume a random constant value during the random period of time width and this behavior must occur with randomly variable periods of time...
Best wishes and best regards
Lorenzo
-
- Senior Member
- Posts: 102
- Joined: Wed Jul 30, 2014 7:09 am
- Vensim version: PLE
Re: Randomized pulse train
I'm looking for pulses with random height and width that repeat with a random generated period but within each width I want a pulse to have a constant value.tomfid wrote:Are you looking for pulses of controllable width and height, at random times? That can be implemented with a stock structure - I could cook up a demo structure if that's what you're after.
Best wishes and best regards.
Lorenzo
Re: Randomized pulse train
I'm finding it quite messy to create a structure that meets this spec, using only the functions in PLE. I can't think of real physical process that has precisely this behavior. What are we actually modeling here?
/*
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
*/
-
- Senior Member
- Posts: 102
- Joined: Wed Jul 30, 2014 7:09 am
- Vensim version: PLE
Re: Randomized pulse train
Here it's one: a succession of groups, one idependent from the others, arriving at a service; each group with different size, the groups arriving with varying frequencies but each within a variable period of time....but you can also use it to describe sudden rainfalls or bursts of any type that occur with variable frequency, every burst with it's own duration and constant intensity...tomfid wrote:I'm finding it quite messy to create a structure that meets this spec, using only the functions in PLE. I can't think of real physical process that has precisely this behavior. What are we actually modeling here?
Lorenzo
Re: Randomized pulse train
That helps. I'll see if I can create something.
What you really need to simplify the accounting is the SAMPLE IF TRUE function in Vensim Pro or DSS.
What you really need to simplify the accounting is the SAMPLE IF TRUE function in Vensim Pro or DSS.
/*
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
*/
-
- Senior Member
- Posts: 102
- Joined: Wed Jul 30, 2014 7:09 am
- Vensim version: PLE
Re: Randomized pulse train
Unfortunately [for me] I use Vensim PLE...tomfid wrote:That helps. I'll see if I can create something.
What you really need to simplify the accounting is the SAMPLE IF TRUE function in Vensim Pro or DSS.
Lorenzo
Re: Randomized pulse train
It is possible to emulate the sample if true function in PLE.
Joined the model in mdl and vpm format tthat demonstrates it and that can be read with the Vensim player, if you cannot run the .mdl model in PLE.
Regards.
JJ
Joined the model in mdl and vpm format tthat demonstrates it and that can be read with the Vensim player, if you cannot run the .mdl model in PLE.
Regards.
JJ
- Attachments
-
- sample_if_true_1.vpm
- (20.07 KiB) Downloaded 286 times
-
- sample_if_true_1.mdl
- (3.32 KiB) Downloaded 311 times
-
- Senior Member
- Posts: 102
- Joined: Wed Jul 30, 2014 7:09 am
- Vensim version: PLE
Re: Randomized pulse train
Hi JJLAUJJL wrote:It is possible to emulate the sample if true function in PLE.
Joined the model in mdl and vpm format tthat demonstrates it and that can be read with the Vensim player, if you cannot run the .mdl model in PLE.
Regards.
JJ
great!!! many thanks.... I download the models and try to understand them....
Best regards and best wishes.
Lorenzo
-
- Senior Member
- Posts: 102
- Joined: Wed Jul 30, 2014 7:09 am
- Vensim version: PLE
Re: Randomized pulse train
Hi everybody
get a glance to the attached model, maybe this is the right solution, it seems to work well for any value of TIME STEP.
Cheers
Lorenzo
get a glance to the attached model, maybe this is the right solution, it seems to work well for any value of TIME STEP.
Cheers
Lorenzo
- Attachments
-
- 8.8RandomPulses.mdl
- (5.13 KiB) Downloaded 308 times