Changeset 537 for trunk


Ignore:
Timestamp:
Jun 16, 2008, 12:58:00 AM (15 years ago)
Author:
Argimiro Resende Secchi
Message:

Updating flash example.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sample/controllers/Sample_flash_pid.mso

    r313 r537  
    11#*-------------------------------------------------------------------
    2 * EMSO Model Library (EML) Copyright (C) 2004 - 2007 ALSOC.
     2* EMSO Model Library (EML) Copyright (C) 2004 - 2008 ALSOC.
    33*
    44* This LIBRARY is free software; you can distribute it and/or modify
     
    66* http://www.enq.ufrgs.br/alsoc.
    77*
    8 * EMSO Copyright (C) 2004 - 2007 ALSOC, original code
     8* EMSO Copyright (C) 2004 - 2008 ALSOC, original code
    99* from http://www.rps.eng.br Copyright (C) 2002-2004.
    1010* All rights reserved.
     
    3535                VapourModel = "PR");
    3636        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
    3938        FVMin as flow_mol;
    4039        FVMax as flow_mol;
    4140        FLMax as flow_mol;
    4241        FLMin as flow_mol;
    43         #Pressão máxima e mínima
     42        #Maximum and minimum pressure
    4443        PMin as pressure;
    4544        PMax as pressure;
    46         #Nível máximo e mínimo
     45        #Maximum and minimum level
    4746        LMax as length;
    4847        LMin as length;
    4948
    5049        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");
    5452        Q       as energy_source (Brief="Heat supplied");
    5553       
    5654        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
    6157        fl as flash;
    6258        s1 as source;
     
    6864        pidP.PID_Select = "Parallel_AWBT";
    6965       
    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';
    7368        fl.diameter = 0.5 * 'm';
    7469        fl.orientation = "vertical";
    7570       
    76         #Valores máximos e mínimos para as normalizações
     71        #Maximum and minimum values
    7772        PMax=2.36 *'atm';
    7873        PMin=0 *'atm';
     
    9287        Q.OutletQ.Q = 1026.32 * 'kJ/s';
    9388
    94         #Parâmetros do controlador de nível
     89        #Level controller parameters
     90        pidL.Ports.setPoint=0.5;
    9591        pidL.Parameters.bias=0.5;
    9692        pidL.Parameters.gain=1.1776;
     
    10298        pidL.Parameters.beta =1;
    10399    pidL.Parameters.gamma =1;
    104         #Opções do controlador de nível
     100        #Level controller configuration
    105101        pidL.Options.autoMan=0;         
    106102        pidL.Options.clip=1;                   
    107         pidL.Ports.setPoint=0.5;
    108103        pidL.Options.action =-1;
    109104       
    110         #Parâmetros do controlador de pressão
     105        #Pressure controller parameters
    111106        pidP.Parameters.bias=0.5;       
    112107        pidP.Parameters.gain=0.9275;
     
    118113        pidP.Parameters.beta =1;
    119114        pidP.Parameters.gamma =1;
    120         #Opções do controlador de pressão
     115        #Pressure controller configuration
    121116        pidP.Options.autoMan=0;         
    122117        pidP.Options.clip=1;           
     
    124119
    125120        EQUATIONS
    126         #Corrente de entrada do flash
     121        #Feed stream
    127122        s1.Outlet.z = [0.3, 0.3, 0.4]; 
    128123        s1.Outlet.P = 5 * 'atm';       
    129124       
    130         #Distúrbio regulatório
    131         if time<2000 then
     125        #Disturbance
     126        if time < 0.5*'h' then
    132127                s1.Outlet.T = 338 * 'K';
    133128                s1.Outlet.F = 496.3 * 'kmol/h';
     
    137132        end
    138133
    139         #Normalização das variáveis controladas
    140         #Variáveis controladas: fl.Level e fl.OutletV.P
     134        #Control variables: fl.Level and fl.OutletV.P
     135        #Normalized control variables
    141136        L_ad*(LMax-LMin)=fl.Level-LMin;
    142137        P_ad*(PMax-PMin)=fl.OutletV.P-PMin;
    143138       
    144         #Conexão das entradas dos pid´s
     139        #Controllers input ports
    145140        pidL.Ports.input=L_ad;
    146141        pidP.Ports.input=P_ad; 
    147142       
    148         #Distúrbio servo
    149         if time<7200 then
     143        #Setpoint change
     144        if time < 2*'h' then
    150145                pidP.Ports.setPoint=0.501822;
    151146        else
     
    153148        end     
    154149       
    155         #Conexão entre os controladores e o flash
    156         #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)
    157152        fl.OutletV.F = pidP.Ports.output*(FVMax-FVMin)+FVMin;
    158153        fl.OutletL.F = pidL.Ports.output*(FLMax-FLMin)+FLMin;
     
    165160
    166161        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");
    170166end
    171167
Note: See TracChangeset for help on using the changeset viewer.