#*------------------------------------------------------------------- * 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: SumSubtract.mso 2012$ *---------------------------------------------------------------------*# using "types"; Model SumSub ATTRIBUTES Pallete=true; Icon="icon/SumSubtract"; Info="== Sum/Subtract block == It takes the input variables and computes the sum or difference of them. The resulting value is assigned to the output variable"; PARAMETERS Select_operation as Switcher(Valid=["Sum","Subtraction"],Default="Sum"); VARIABLES in In1 as Real(Brief="First term to be added",PosX=0.5,PosY=0); in In2 as Real(Brief="Second term to be added",PosX=0.5,PosY=1); out Out as Real(Brief="Result is (In1+In2) or (In1-In2)",Protected=true,PosX=1,PosY=0.5); EQUATIONS switch Select_operation case "Sum": Out=In1+In2; case "Subtraction": Out=In1-In2; end end