- Timestamp:
- Jun 16, 2008, 12:58:00 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sample/controllers/Sample_flash_pid.mso
r313 r537 1 1 #*------------------------------------------------------------------- 2 * EMSO Model Library (EML) Copyright (C) 2004 - 200 7ALSOC.2 * EMSO Model Library (EML) Copyright (C) 2004 - 2008 ALSOC. 3 3 * 4 4 * This LIBRARY is free software; you can distribute it and/or modify … … 6 6 * http://www.enq.ufrgs.br/alsoc. 7 7 * 8 * EMSO Copyright (C) 2004 - 200 7ALSOC, original code8 * EMSO Copyright (C) 2004 - 2008 ALSOC, original code 9 9 * from http://www.rps.eng.br Copyright (C) 2002-2004. 10 10 * All rights reserved. … … 35 35 VapourModel = "PR"); 36 36 NComp as Integer; 37 #Valores utilizados na normalização do nível e da pressão do flash 38 #Vazões mínimas e máximas das correntes de vapor e líquido 37 #Maximum and minimum vapor and liquid flow rates 39 38 FVMin as flow_mol; 40 39 FVMax as flow_mol; 41 40 FLMax as flow_mol; 42 41 FLMin as flow_mol; 43 # Pressão máxima e mínima42 #Maximum and minimum pressure 44 43 PMin as pressure; 45 44 PMax as pressure; 46 # Nível máximo e mínimo45 #Maximum and minimum level 47 46 LMax as length; 48 47 LMin as length; 49 48 50 49 VARIABLES 51 #Nível e Pressão normalizados 52 L_ad as Real; 53 P_ad as Real; 50 L_ad as Real (Brief="Dimensionless level"); 51 P_ad as Real (Brief="Dimensionless pressure"); 54 52 Q as energy_source (Brief="Heat supplied"); 55 53 56 54 DEVICES 57 #Controlador para o nível 58 pidL as PIDIncr; 59 #Controlador para a pressão 60 pidP as PIDIncr; 55 pidL as PIDIncr; #Level controller 56 pidP as PIDIncr; #Pressure controller 61 57 fl as flash; 62 58 s1 as source; … … 68 64 pidP.PID_Select = "Parallel_AWBT"; 69 65 70 #Parâmetros do modelo de flash 71 #fl.V = 1 * 'm^3'; 72 #fl.Across = 0.5* 'm^2'; 66 #Flash model parameters 67 fl.V = 10 * 'm^3'; 73 68 fl.diameter = 0.5 * 'm'; 74 69 fl.orientation = "vertical"; 75 70 76 # Valores máximos e mínimos para as normalizações71 #Maximum and minimum values 77 72 PMax=2.36 *'atm'; 78 73 PMin=0 *'atm'; … … 92 87 Q.OutletQ.Q = 1026.32 * 'kJ/s'; 93 88 94 #Parâmetros do controlador de nível 89 #Level controller parameters 90 pidL.Ports.setPoint=0.5; 95 91 pidL.Parameters.bias=0.5; 96 92 pidL.Parameters.gain=1.1776; … … 102 98 pidL.Parameters.beta =1; 103 99 pidL.Parameters.gamma =1; 104 # Opções do controlador de nível100 #Level controller configuration 105 101 pidL.Options.autoMan=0; 106 102 pidL.Options.clip=1; 107 pidL.Ports.setPoint=0.5;108 103 pidL.Options.action =-1; 109 104 110 #P arâmetros do controlador de pressão105 #Pressure controller parameters 111 106 pidP.Parameters.bias=0.5; 112 107 pidP.Parameters.gain=0.9275; … … 118 113 pidP.Parameters.beta =1; 119 114 pidP.Parameters.gamma =1; 120 # Opções do controlador de pressão115 #Pressure controller configuration 121 116 pidP.Options.autoMan=0; 122 117 pidP.Options.clip=1; … … 124 119 125 120 EQUATIONS 126 # Corrente de entrada do flash121 #Feed stream 127 122 s1.Outlet.z = [0.3, 0.3, 0.4]; 128 123 s1.Outlet.P = 5 * 'atm'; 129 124 130 #Dist úrbio regulatório131 if time <2000then125 #Disturbance 126 if time < 0.5*'h' then 132 127 s1.Outlet.T = 338 * 'K'; 133 128 s1.Outlet.F = 496.3 * 'kmol/h'; … … 137 132 end 138 133 139 # Normalização das variáveis controladas140 # Variáveis controladas: fl.Level e fl.OutletV.P134 #Control variables: fl.Level and fl.OutletV.P 135 #Normalized control variables 141 136 L_ad*(LMax-LMin)=fl.Level-LMin; 142 137 P_ad*(PMax-PMin)=fl.OutletV.P-PMin; 143 138 144 #Con exão das entradas dos pid´s139 #Controllers input ports 145 140 pidL.Ports.input=L_ad; 146 141 pidP.Ports.input=P_ad; 147 142 148 # Distúrbio servo149 if time <7200then143 #Setpoint change 144 if time < 2*'h' then 150 145 pidP.Ports.setPoint=0.501822; 151 146 else … … 153 148 end 154 149 155 #Con exão entre os controladores e o flash156 # Variáveis manipuladas: fl.OutletV.F(controle de pressão) e fl.OutletL.F(nível)150 #Controllers output ports 151 #Manipulated variables: fl.OutletV.F (pressure control) and fl.OutletL.F (level control) 157 152 fl.OutletV.F = pidP.Ports.output*(FVMax-FVMin)+FVMin; 158 153 fl.OutletL.F = pidL.Ports.output*(FLMax-FLMin)+FLMin; … … 165 160 166 161 OPTIONS 167 #time = [0:100:7000 7000:0.10:8150 8150:100:10000]; 168 TimeStep = 100; 169 TimeEnd = 10000; 162 TimeStep = 0.02; 163 TimeEnd = 3; 164 TimeUnit = 'h'; 165 DAESolver(File="dassl"); 170 166 end 171 167
Note: See TracChangeset
for help on using the changeset viewer.