- Index
- » Programming
- » Modelica Language
- » Boolean sequence
Boolean sequence
Boolean sequence
Hello,
I am trying to create a boolean sequence which should repeat itself.
The "BooleanTable" block creates the sequence i want, but the sequence is not symetrical and for that reason it is not repeating as I want it to.
The image below explains it, where the upper part is how i want it and the lower part is how it is behaving.
Any tips on how I can create such a sequence, preferably With a parameter which can set the time period?
Re: Boolean sequence
didrif14 wrote:
The "BooleanTable" block creates the sequence i want, but the sequence is not symetrical and for that reason it is not repeating as I want it to.
what did you mean by the sequence is not symetrical?
in table block you define at which time point the boolean value chages and put the extrapolation as periodic.
- Arinomo23
- 120 Posts
Re: Boolean sequence
Thank you for Your reply.
What I mean is, the period of which it should repeat itself is 0.6 sec
It should turn on after 0.1 sec
Then turn off at 0.2 sec
It should then wait 0.4 sec and repeat the sequence
However, what it is doing is:
It turns on after 0.1 sec, then turns off at 0.2 sec
When i put it on the repeat setting, it turns on again after 0.1 sec
It does not know that is should wait for 0.4 sec, because I have not specified the period
There is an image in the previous post which illustrates this
Re: Boolean sequence
You could try to use Modelica.Blocks.Source.BooleanPulse and set period to 0.5s and width to 20% and vary the start time accordingly. Maybe that behaviour is what you want?
- Arinomo23
- 120 Posts
- Index
- » Programming
- » Modelica Language
- » Boolean sequence