source: trunk/Block-Oriented EML/Basic Blocks/Pulse.mso @ 998

Last change on this file since 998 was 944, checked in by Argimiro Resende Secchi, 10 years ago

Adding Block-Oriented library by Jonathan Ospino Pinedo

File size: 1.2 KB
Line 
1#*-------------------------------------------------------------------
2* EMSO Model Library (EML) Copyright (C) 2004 - 2007 ALSOC.
3*
4* This LIBRARY is free software; you can distribute it and/or modify
5* it under the therms of the ALSOC FREE LICENSE as available at
6* http://www.enq.ufrgs.br/alsoc.
7*
8* EMSO is distributed under the terms of the ALSOC LICENSE as
9* available at http://www.enq.ufrgs.br/alsoc.
10*-----------------------------------------------------------------------
11* Author: Jonathan Ospino P.
12* $Id: Pulse.mso  2012$
13*---------------------------------------------------------------------*#
14
15using "types";
16 
17Model Pulse
18       
19        ATTRIBUTES
20
21        Pallete=true;
22        Icon="icon/Pulse2";
23        Info="== Pulse signal source ==";
24
25       
26        PARAMETERS
27
28        Start_Time as time_sec(Brief="Start time of the pulse",Default=0);
29        Magnitude as Real(Brief="Pulse magnitude",Default=1);
30        Duration as time_sec(Brief="Pulse duration",Default=1);
31
32       
33        VARIABLES
34
35        out Out as Real(Brief="Output of the ramp block",Protected=true,PosX=1,PosY=0.5);
36
37       
38        EQUATIONS
39       
40        if time>=(Start_Time+Duration) then
41                Out=0;
42        else
43                if time<Start_Time then
44                        Out=0;
45                else
46                        Out=Magnitude;
47                end
48        end
49               
50end
Note: See TracBrowser for help on using the repository browser.