Randomized pulse train

Use this forum to post Vensim related questions.
Post Reply
lorenzo.cioni
Senior Member
Posts: 102
Joined: Wed Jul 30, 2014 7:09 am
Vensim version: PLE

Randomized pulse train

Post by lorenzo.cioni »

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 8)
Administrator
Super Administrator
Posts: 4621
Joined: Wed Mar 05, 2003 3:10 am

Re: Randomized pulse train

Post by Administrator »

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
lorenzo.cioni
Senior Member
Posts: 102
Joined: Wed Jul 30, 2014 7:09 am
Vensim version: PLE

Re: Randomized pulse train

Post by lorenzo.cioni »

Administrator wrote:Have you tried using the RANDOM UNIFORM function to generate the numbers that you then feed to the 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...
Best regards and best wishes.
Lorenzo 8)
Administrator
Super Administrator
Posts: 4621
Joined: Wed Mar 05, 2003 3:10 am

Re: Randomized pulse train

Post by Administrator »

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
lorenzo.cioni
Senior Member
Posts: 102
Joined: Wed Jul 30, 2014 7:09 am
Vensim version: PLE

Re: Randomized pulse train

Post by lorenzo.cioni »

Administrator wrote:Can you post what you have done and explain what you need? I'm struggling to understand what you want to achieve.
First of all thank you. This is the "culprit":

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 8)
Attachments
8.8.mdl
(5.37 KiB) Downloaded 289 times
Administrator
Super Administrator
Posts: 4621
Joined: Wed Mar 05, 2003 3:10 am

Re: Randomized pulse train

Post by Administrator »

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
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.
The calculations are correct. Why do you think they are wrong?
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
tomfid
Administrator
Posts: 3816
Joined: Wed May 24, 2006 4:54 am

Re: Randomized pulse train

Post by tomfid »

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.
lorenzo.cioni
Senior Member
Posts: 102
Joined: Wed Jul 30, 2014 7:09 am
Vensim version: PLE

Re: Randomized pulse train

Post by lorenzo.cioni »

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
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.
The calculations are correct. Why do you think they are wrong?
Hi, first of all thank you...
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 8)
lorenzo.cioni
Senior Member
Posts: 102
Joined: Wed Jul 30, 2014 7:09 am
Vensim version: PLE

Re: Randomized pulse train

Post by lorenzo.cioni »

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.
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.
Best wishes and best regards.
Lorenzo 8)
tomfid
Administrator
Posts: 3816
Joined: Wed May 24, 2006 4:54 am

Re: Randomized pulse train

Post by tomfid »

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.cioni
Senior Member
Posts: 102
Joined: Wed Jul 30, 2014 7:09 am
Vensim version: PLE

Re: Randomized pulse train

Post by lorenzo.cioni »

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?
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...
Lorenzo 8)
tomfid
Administrator
Posts: 3816
Joined: Wed May 24, 2006 4:54 am

Re: Randomized pulse train

Post by tomfid »

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.cioni
Senior Member
Posts: 102
Joined: Wed Jul 30, 2014 7:09 am
Vensim version: PLE

Re: Randomized pulse train

Post by lorenzo.cioni »

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.
Unfortunately [for me] I use Vensim PLE... :?
Lorenzo 8)
LAUJJL
Senior Member
Posts: 1432
Joined: Fri May 23, 2003 10:09 am
Vensim version: DSS

Re: Randomized pulse train

Post by LAUJJL »

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
Attachments
sample_if_true_1.vpm
(20.07 KiB) Downloaded 286 times
sample_if_true_1.mdl
(3.32 KiB) Downloaded 311 times
lorenzo.cioni
Senior Member
Posts: 102
Joined: Wed Jul 30, 2014 7:09 am
Vensim version: PLE

Re: Randomized pulse train

Post by lorenzo.cioni »

LAUJJL 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
Hi JJ
great!!! :lol: :lol: many thanks.... I download the models and try to understand them....
Best regards and best wishes. 8)
Lorenzo 8)
lorenzo.cioni
Senior Member
Posts: 102
Joined: Wed Jul 30, 2014 7:09 am
Vensim version: PLE

Re: Randomized pulse train

Post by lorenzo.cioni »

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 :lol:
Lorenzo 8)
Attachments
8.8RandomPulses.mdl
(5.13 KiB) Downloaded 308 times
Post Reply