#*--------------------------------------------------------------------- * This file is property of the author and cannot be used, copyed * or modified without permission. * * Copyright (C) 2002-2005 the author *---------------------------------------------------------------------- * Author: Paula Bettio Staudt and Rafael de Pelegrini Soares * $Id: sample_if_tanh.mso 1 2006-06-20 17:33:53Z rafael $ *---------------------------------------------------------------------- * * EMSO sample file. * * FlowSheet showing how to 'emulate' an 'if' conditional with * hyperbolic functions. * *-------------------------------------------------------------------*# FlowSheet SampleIF VARIABLES A; xif; xelse; PARAMETERS B as Real(Default = 10); EQUATIONS #* if (time>3) * A = 10; * else * A = 5; *# A = 10*xif + 5*xelse; xif = (1 + tanh(B * (time - 3)))/2; xelse = (1 - tanh(B * (time - 3)))/2; SET B = 100; OPTIONS time = [0:0.01:6]; end