#*------------------------------------------------------------------- * 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 * $Id: TrigFcns.mso 2012$ *---------------------------------------------------------------------*# using "types"; Model Trig_Fcns ATTRIBUTES Pallete=true; Icon="icon/Trig_Fcns"; Info="== Trigonometric functions block == It computes the trigonometric functions sin(x), cos(x), tan(x), cot(x), sec(x), csc(x), asin(x), acos(x), atan(x), acot(x), asec(x), acsc(x), sinh(x), cosh(x), tanh(x), coth(x), sech(x), and csch (x) of the input signal, x. The resulting value is assigned to the output variable"; PARAMETERS Select_a_function as Switcher(Valid=["sin(x)","cos(x)","tan(x)","cot(x)","sec(x)","csc(x)","asin(x)","acos(x)","atan(x)","acot(x)","asec(x)","acsc(x)"],Default="sin(x)"); VARIABLES in In as Real(Brief="Input signal",PosX=0,PosY=0.5); out Out as Real(Brief="Output signal",Protected=true,PosX=1,PosY=0.5); EQUATIONS switch Select_a_function case "sin(x)": Out=sin(In*'rad'); case "cos(x)": Out=cos(In*'rad'); case "tan(x)": Out=sin(In*'rad')/cos(In*'rad'); case "cot(x)": Out=cos(In*'rad')/sin(In*'rad'); case "sec(x)": Out=1/cos(In*'rad'); case "csc(x)": Out=1/sin(In*'rad'); case "asin(x)": Out=asin(In); case "acos(x)": Out=acos(In); case "atan(x)": Out=atan(In); case "acot(x)": Out=1/atan(In); case "asec(x)": Out=1/acos(In); case "acsc(x)": Out=1/asin(In); end end