Somebody help me please!! ramp and pulse train combination
Somebody help me please!! ramp and pulse train combination
Hi there!!
I started to use Vensim PLE (the free version) just a couple of weeks ago, so I have still a long way to go. I would like to ask the following questions:
1- How can I ovecome the problem 'simulataneous equations' using the Vensim PLE? is there any trick there? The built in functions in Vensim PLE are very scarce.
2. I would like to generate a signal that is a mixture between a ramp and a pulse train, something like this ___/I___/l___/l__, those anyone knows how to do that??
I would really appreaciate, if someone can help me out!
Thanks in advance!
cheers
I started to use Vensim PLE (the free version) just a couple of weeks ago, so I have still a long way to go. I would like to ask the following questions:
1- How can I ovecome the problem 'simulataneous equations' using the Vensim PLE? is there any trick there? The built in functions in Vensim PLE are very scarce.
2. I would like to generate a signal that is a mixture between a ramp and a pulse train, something like this ___/I___/l___/l__, those anyone knows how to do that??
I would really appreaciate, if someone can help me out!
Thanks in advance!
cheers
Re: Somebody help me please!! ramp and pulse train combination
1 - Every feedback loop must have a stock in it. This is not only a PLE limitation, it's also reality. A simultaneous equation loop might be a workaround for some "stiff model" situation, like a rapid market-clearing process embedded in a model with slow dynamics, but more often it's a conceptual mistake. To say more, we'd have to understand your specific instance.
2 - One easy option would be to use a lookup. Another possibility would be something like
x = MODULO( time/peak interval, 1 )
This will give a sawtooth, which you can then stretch or clip as needed to get the shape you're after.
2 - One easy option would be to use a lookup. Another possibility would be something like
x = MODULO( time/peak interval, 1 )
This will give a sawtooth, which you can then stretch or clip as needed to get the shape 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
*/
-
- Super Administrator
- Posts: 4827
- Joined: Wed Mar 05, 2003 3:10 am
Re: Somebody help me please!! ramp and pulse train combination
Can you post the model here so we can take a look? Simultaneous equations are common, and usually easily fixed with an adjustment to the logic used in the model.mongjie88 wrote:1- How can I ovecome the problem 'simulataneous equations' using the Vensim PLE? is there any trick there? The built in functions in Vensim PLE are very scarce.
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: Somebody help me please!! ramp and pulse train combination
@Tomfidtomfid wrote:1 - Every feedback loop must have a stock in it. This is not only a PLE limitation, it's also reality. A simultaneous equation loop might be a workaround for some "stiff model" situation, like a rapid market-clearing process embedded in a model with slow dynamics, but more often it's a conceptual mistake. To say more, we'd have to understand your specific instance.
2 - One easy option would be to use a lookup. Another possibility would be something like
x = MODULO( time/peak interval, 1 )
This will give a sawtooth, which you can then stretch or clip as needed to get the shape you're after.
Thanks a lot for ur reply!
However, I know how to use Lookup as a customized function, but I dont understand how to use it to produce the signal that I want. The same as with MODULO. I think Modulo is to give u the remainder of a division. Could you explain to me how please??
I would really appreciate if could take some of your time in providing me with one concrete example, using either way.
cheers!
Re: Somebody help me please!! ramp and pulse train combination
Administrator wrote:Can you post the model here so we can take a look? Simultaneous equations are common, and usually easily fixed with an adjustment to the logic used in the model.mongjie88 wrote:1- How can I ovecome the problem 'simulataneous equations' using the Vensim PLE? is there any trick there? The built in functions in Vensim PLE are very scarce.
I will post it soon!!
Thank U!!!
Re: Somebody help me please!! ramp and pulse train combination
mongjie88 wrote:Administrator wrote:Can you post the model here so we can take a look? Simultaneous equations are common, and usually easily fixed with an adjustment to the logic used in the model.mongjie88 wrote:1- How can I ovecome the problem 'simulataneous equations' using the Vensim PLE? is there any trick there? The built in functions in Vensim PLE are very scarce.
btw
do you know how to produce a signal that is the combination of a ramp and a train impulse?? it has to look like this ___/l___/l____/l___/l___
I would appreciate every suggestions...
-
- Super Administrator
- Posts: 4827
- Joined: Wed Mar 05, 2003 3:10 am
Re: Somebody help me please!! ramp and pulse train combination
This does it. Might be better if you explain what you are trying to do though.
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: Somebody help me please!! ramp and pulse train combination
The MODULO function is simpler - you might try it.
You can pass the sawtooth from MODULO through a lookup if you want to get a complex shape for the pulse train.
I think if we knew what you were doing, we could make better suggestions.
You can pass the sawtooth from MODULO through a lookup if you want to get a complex shape for the pulse train.
I think if we knew what you were doing, we could make better suggestions.
/*
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: Somebody help me please!! ramp and pulse train combination
Hi,
What kind of mistakes can cause a failure in PULSE TRAIN. I am using a PULSE TRAIN in a large-scale model but it produces nothing, although all 4 inputs of this fuction seems to be correct.
What kind of mistakes can cause a failure in PULSE TRAIN. I am using a PULSE TRAIN in a large-scale model but it produces nothing, although all 4 inputs of this fuction seems to be correct.
Re: Somebody help me please!! ramp and pulse train combination
Hard to say. I'd recommend copy-pasting your equation into a standalone model for testing. Be sure the time bounds are the same as the original. Also, be sure SAVEPER=TIME STEP; otherwise you might not see the pulses in the output.
/*
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: Somebody help me please!! ramp and pulse train combination
I checked all your suggestions. When I open another vensim file and use this formula it is fine, but even a simple PULSE TRAIN with numerical input like PULSE TRAIN(1, 1 , 10 , 200 ) does not work properly in my large-sclae model. Can using C compiler cause this problem?
Re: Somebody help me please!! ramp and pulse train combination
That seems extremely unlikely. What happens if you run your small test model compiled?
/*
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: Somebody help me please!! ramp and pulse train combination
Any chance the variable type is set to INITIAL?
/*
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: Somebody help me please!! ramp and pulse train combination
Can you post or email the model?
/*
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: Somebody help me please!! ramp and pulse train combination
Unfortunately, I cannot send the model, it has also huge input files and external files which make sending hard.
Attached you can find my time setting and formula for repeat time of PULSE TRAIN. The rest of variable for this function are as simple as repeat time.
- Attachments
-
- PULSE TRAIN.jpg (117.45 KiB) Viewed 21761 times
-
- Super Administrator
- Posts: 4827
- Joined: Wed Mar 05, 2003 3:10 am
Re: Somebody help me please!! ramp and pulse train combination
Can you copy the parameters "pulse", "eeg start", "eeg repeat time", "eeg duration" and "eeg end time" and paste them into a blank model?
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: Somebody help me please!! ramp and pulse train combination
I have attached the equations of the function. As you can see I have used very simple equations and they work in such test model but when I use them in my large scale model I got zero for them.Administrator wrote: ↑Sat Jul 20, 2019 7:08 pm Can you copy the parameters "pulse", "eeg start", "eeg repeat time", "eeg duration" and "eeg end time" and paste them into a blank model?
- Attachments
-
- pulse function.mdl
- (1.46 KiB) Downloaded 1192 times
Re: Somebody help me please!! ramp and pulse train combination
Do they work in the large model if it's not compiled? (Note that if you've previously compiled it, you either have to change the model or delete the .dlls to run interpreted.)
/*
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: Somebody help me please!! ramp and pulse train combination
For debugging we really need the exact variables in the big model copy-pasted into a test model, with exactly the same time settings. Otherwise there are too many possible causes of variation. (However, if the copy-pasted version works for you, this probably won't help us diagnose.)
Other things too look at:
- pulse interval is non constant
- .cin file overriding one of the parameters with something that doesn't work
- PULSE TRAIN is in an initial
Other things too look at:
- pulse interval is non constant
- .cin file overriding one of the parameters with something that doesn't work
- PULSE TRAIN is in an initial
/*
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: Somebody help me please!! ramp and pulse train combination
A possible workaround would be to create a macro that implements a pulse train.
/*
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: Somebody help me please!! ramp and pulse train combination
No, it is not related to compilation because it does not work with or without compilation. I was just wondering which time setting of model might cause this failure.
Re: Somebody help me please!! ramp and pulse train combination
Thanks, I looked at your suggestions. One progress is that it produces always 1 instead of zero but still I do not see any pulse pattern in it.tomfid wrote: ↑Sat Jul 20, 2019 8:49 pm For debugging we really need the exact variables in the big model copy-pasted into a test model, with exactly the same time settings. Otherwise there are too many possible causes of variation. (However, if the copy-pasted version works for you, this probably won't help us diagnose.)
Other things too look at:
- pulse interval is non constant
- .cin file overriding one of the parameters with something that doesn't work
- PULSE TRAIN is in an initial
Re: Somebody help me please!! ramp and pulse train combination
Here's a simple structure that generates pulses. There are a couple limitations - width=TIME STEP, and it wouldn't work with RK4 integration. I'm guessing it would work for your case though.
/*
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
*/