#*------------------------------------------------------------------- * 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 Copyright (C) 2004 - 2007 ALSOC, original code * from http://www.rps.eng.br Copyright (C) 2002-2004. * All rights reserved. * * EMSO is distributed under the therms of the ALSOC LICENSE as * available at http://www.enq.ufrgs.br/alsoc. * *-------------------------------------------------------------------- * Sample file for Sensitivity Analysis. User can compare with equivalent * Case study and compare the values with perturbations (finite differences). *-------------------------------------------------------------------- * *---------------------------------------------------------------------- * Author: Edson Cordeiro do Valle * *--------------------------------------------------------------------*# #Model with degrees of freedom complete in the model: 2 vars. and 2 eqs. #Warning : The units must be consistent in order to convert it correctly in the #CaseStudy section Model CS1 VARIABLES X as Real (Default=20,Lower=-10,Upper=1000, final Unit = 'm'); Y as Real (Default=200,Lower=-10000,Upper=100000000, final Unit = 'm^2'); PARAMETERS b0 as Real(Default=7, final Unit = 'm'); b1 as Real(Default=3, final Unit = 'm'); EQUATIONS #Y = b0*X^2 +b1^2*X; b0*Y = b1^2*X; Y = X ^ 2; end #Model with degrees of freedom UNCOMPLETE in the model: 2 vars. and 1 eqs., # need to specify 1 var. in the flowsheet section. #Warning : The units must be consistent in order to convert it correctly in the #CaseStudy section Model CS_flow1 VARIABLES X as Real (Default=2,Lower=-10,Upper=1000, final Unit = 'm'); Y as Real (Default=2,Lower=-10000,Upper=100000000, final Unit = 'm^2'); PARAMETERS b0 as Real(Default=7, final Unit = 'm'); b1 as Real(Default=3, final Unit = 'm'); EQUATIONS b0*Y = b1^2*X; end #Model with degrees of freedom UNCOMPLETE in the model: 3 vars. and 2 eqs., # need to specify 1 var. in the flowsheet section. #Warning : The units must be consistent in order to convert it correctly in the #CaseStudy section Model CS_flow2 VARIABLES X as Real (Default=20,Lower=-10,Upper=1000, final Unit = 'm'); X2 as Real (Default=20,Lower=-10,Upper=1000, final Unit = 'm'); Y as Real (Default=200,Lower=-10000,Upper=100000000, final Unit = 'm^2'); PARAMETERS b0 as Real(Default=7, final Unit = 'm'); b1 as Real(Default=3, final Unit = 'm'); EQUATIONS Y = b0*X^2/'m' +b1^2*X2/'m' -50.73*'m^2'; #b0*Y = b1^2*X; Y = X ^ 2; end #No need to specify FlowSheet Test_CS1 as CS1 OPTIONS Dynamic = false; end FlowSheet Test_CS_flow1 as CS_flow1 SPECIFY X = 5 * 'm'; OPTIONS Dynamic = false; end FlowSheet Test_CS4 as CS_flow2 SPECIFY X = 2.2*'m'; OPTIONS Dynamic = false; end Sensitivity Sense1 as Test_CS1 VARY b0 ; b1 ; RESPONSE Y ; end Sensitivity Sense2 as Test_CS_flow1 VARY X; RESPONSE Y ; end Sensitivity Sense3 as Test_CS4 VARY b0'cm'; X'cm'; RESPONSE Y 'cm^2'; end Sensitivity Sense4 as Test_CS1 VARY b0; b1; RESPONSE X; Y; end # Case study to compare with "Sense1" with perturbations: # Pick the table resulting from this CaseStudy and make: # d_Y/d_b0 = (Y(b0 = 7.01) - Y(b0 = 7.0))/(7.01 - 7.0) # d_Y/d_b1 = Y(b1 = 3.01) - Y(b1 = 3.0))/(3.01 - 3.0) CaseStudy CS_parameter as Test_CS1 VARY b0 =[ 7, 7.01]; b1 =[ 3, 3.01]; RESPONSE Y ; end # Case study to compare with "Sense2" with perturbations: # Pick the table resulting from this CaseStudy and make: # d_Y/d_b0 = (Y(b0 = 7.01) - Y(b0 = 7.0))/(7.01 - 7.0) # d_Y/d_X = Y(X = 5.01) - Y(X = 5.0))/(5.01 - 5.0) CaseStudy CS2_par_spec as Test_CS_flow1 VARY X = [5 , 5.01]; b0 =[ 7, 7.01]; RESPONSE Y ; end # Case study to compare with "Sense3" with perturbations: # Pick the table resulting from this CaseStudy and make: # d_Y/d_b0 = (Y(b0 = 7.01) - Y(b0 = 7.0))/(7.01 - 7.0) # d_Y/d_X = Y(X = 221) - Y(X = 220))/(220 - 221) CaseStudy CS_Unit_Vary as Test_CS4 VARY b0 =[ 7 : 0.01: 7.01]*'cm'; X =[ 220 : 1: 221]*'cm'; RESPONSE Y'cm^2' ; end # Case study to compare with "Sense4" with perturbations: # Pick the table resulting from this CaseStudy and make: # d_Y/d_b0 = (Y(b0 = 7.01) - Y(b0 = 7.0))/(7.01 - 7.0) # d_Y/d_b1 = (Y(b1 = 3.01) - Y(b1 = 3.0))/(3.01 - 3.0) # d_X/d_b0 = (X(b0 = 7.01) - X(b0 = 7.0))/(7.01 - 7.0) # d_X/d_b1 = (X(b1 = 3.01) - X(b1 = 3.0))/(3.01 - 3.0) CaseStudy CS_Unit_Vary_All as Test_CS1 VARY b0 =[ 7, 7.01]; b1 =[ 3, 3.01]; RESPONSE Y; X; end