#*------------------------------------------------------------------- * EMSO Model Library (EML) Copyright (C) 2004 - 2007 ALSOC. * * This LIBRARY is free software; you can distribute it and/or modify * it under the therms of the ALSOC FREE LICENSE as available at * http://www.enq.ufrgs.br/alsoc. * * EMSO is distributed under the terms of the ALSOC LICENSE as * available at http://www.enq.ufrgs.br/alsoc. *----------------------------------------------------------------------- * Author: Jonathan Ospino P. * $Id: SineWave.mso 2012$ *---------------------------------------------------------------------*# using "types"; Model SinusoidalWave ATTRIBUTES Pallete=true; Icon="icon/SineWave2"; Info="== Sine wave signal source ==."; PARAMETERS Wave_type as Switcher(Valid=["Sine","Cosine"],Default="Sine"); A as Real(Brief="Amplitude",Default=1); w as Real(Brief="angular frequency",Default=1); THETA as Real(Brief="Shift angle",Default=0); VARIABLES out Out as Real(Brief="Output of the constant block",Protected=true,PosX=1,PosY=0.5); EQUATIONS switch Wave_type case "Sine": Out=A*sin((w*time/'s'+THETA)*'rad'); case "Cosine": Out=A*cos((w*time/'s'+THETA)*'rad'); end end