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

"step" from positive to negative values

"step" from positive to negative values

Hi All,

I need to give as an input a step that has to start from positive values down to negative ones.
Let's say to have a time frame of 100 s and I will give a step after 50 sec. This signal range starts from 15 and finishes at -15 for a total amplitude of 30.

Do you know if there is a block that allows me to do this?
I have already tried to use Modelica.Blocks.Sources.Step but it seems I can only give values from negative (or 0) to positive and not vice-versa.

Thank you so much!
Gabri

Re: "step" from positive to negative values

Code:


Modelica.Blocks.Sources.Step step1(height = -30, offset = 15, startTime = 10);

at t=10s the value will step downwards (negative height) with amplitude of 30.

Re: "step" from positive to negative values

Thank you Arinomo23,

With startTime=10 I got a correct simulation but if I increase this number, let's say 500 sec, I am getting wrong outputs (i.e. in the plot of the step signal I don't have a step anymore but a constant value equal to 15 and the simulation time decreases to 20 sec even though in the simulation setup I specified an output equal to 1000s.
Do you know why?
Thank you again,
Gabri

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