Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register

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.

https://ibb.co/mqj8gnb

Any tips on how I can create such a sequence, preferably With a parameter which can set the time period?

Edited by: didrif14 - Jun-27-19 12:44:40

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.

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

.

Edited by: didrif14 - Jun-28-19 06:12:23

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?

Re: Boolean sequence

Perfect, thank you!

There are 0 guests and 0 other users also viewing this topic
You are here: