Help - Search - Members - Calendar
Full Version: simulate a bump as input
Modelica Forum > Modelica > Modelica
blacksmith
Hello everybody,

I would like to simulate an input that can be described as bellow:

Real s_route;
Real A = 0.2;
Real l = 3;
Real vl = 2;
Real pi = 3.14;
Real x;
equation
x=vl*time;
s_route = 0 + ( if l/vl < time and time < 1.5*l/vl then A*sin((time- l/vl)*2*pi*vl/l) else 0);


With blocks I did that:

Modelica.Blocks.Sources.Sine Bosse(
amplitude={0.2},
offset={0},
startTime={1},
freqHz={1});

But I don't know how to put the exit at zero after the first "bump".
Thanks for helping me. In the same way, if someone know where to find an introduction to Modelica for beginner, I 'll warmly welcome it.

Blacksmith



wagner
Hello Blacksmith,

attached to this post you'll find my graphical solution for your problem. The basic Idea is to substract the signal itself depending on a boolean step, to prevent the sine signal repeating.


Regards

Florian
blacksmith
Hello,

I'm sorry to reply so late, but I work on something else during few days.
Thanks for your solution, yes, it works!

As it seems a bit complicated, I though about creating a model with two line code (that's easy to write) and then to insert it like a block in another model. I failed to do that, but I think it can be done.

Regards,
Blacksmith


QUOTE(wagner @ Mar 27 2007, 05:09 PM) *

Hello Blacksmith,

attached to this post you'll find my graphical solution for your problem. The basic Idea is to substract the signal itself depending on a boolean step, to prevent the sine signal repeating.
Regards

Florian

This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2012 Invision Power Services, Inc.