Changeset 574


Ignore:
Timestamp:
Jul 25, 2008, 11:18:50 AM (15 years ago)
Author:
Rafael de Pelegrini Soares
Message:

Updated the models to work with some language constraints

Location:
branches/gui
Files:
36 edited

Legend:

Unmodified
Added
Removed
  • branches/gui/eml/heat_exchangers/DoublePipeIncr.mso

    r482 r574  
    346346end
    347347
    348 for i in [1:N]
     348for i in [1:N] do
    349349
    350350if InletInner.v equal 0
     
    499499        Lincr(1) = 0*'m';
    500500
    501 for i in [1:N]
     501for i in [1:N] do
    502502
    503503"Incremental Length"
     
    506506end
    507507
    508 for i in [1:N]
     508for i in [1:N] do
    509509
    510510switch innerFlowRegime
     
    536536end
    537537
    538 for i in [1:N]
     538for i in [1:N] do
    539539
    540540switch outerFlowRegime
     
    566566end
    567567
    568 for i in [1:N]
     568for i in [1:N] do
    569569
    570570switch innerFlowRegime
     
    641641end
    642642
    643 for i in [1:N]
     643for i in [1:N] do
    644644
    645645switch outerFlowRegime
     
    794794end
    795795
    796 for i in [2:N]
     796for i in [2:N] do
    797797
    798798"Incremental Enthalpy Inner Stream"
     
    879879        Outer.PressureDrop.Pd_fric(1) = 0*'kPa';
    880880
    881 for i in [1:N]
     881for i in [1:N] do
    882882   
    883883"Outer Pipe Local Pressure"# FIXME: NOZZLE PRESSURE DROP MUST BE ADDED
     
    892892
    893893
    894 for i in [1:N]
     894for i in [1:N] do
    895895
    896896"Outer Pipe Pressure Drop for friction"                 
     
    902902        Outer.PressureDrop.Pd_fric(Npoints) = 0*'kPa';
    903903
    904 for i in [1:N]
     904for i in [1:N] do
    905905   
    906906"Outer Pipe Local Pressure"# FIXME: NOZZLE PRESSURE DROP MUST BE ADDED
     
    920920        Inner.PressureDrop.Pd_fric(1) = 0*'kPa';
    921921
    922 for i in [1:N]
     922for i in [1:N] do
    923923
    924924"Inner Pipe Local Pressure"# FIXME: NOZZLE PRESSURE DROP MUST BE ADDED
  • branches/gui/eml/heat_exchangers/HairpinIncr.mso

    r452 r574  
    354354end
    355355
    356 for i in [1:N]
     356for i in [1:N] do
    357357
    358358if InletInner.v equal 0
     
    465465        Lincr(1) = 0*'m';
    466466
    467 for i in [1:N]
     467for i in [1:N] do
    468468
    469469"Incremental Length"
     
    472472end
    473473
    474 for i in [1:N]
     474for i in [1:N] do
    475475
    476476switch innerFlowRegime
     
    502502end
    503503
    504 for i in [1:N]
     504for i in [1:N] do
    505505
    506506switch outerFlowRegime
     
    532532end
    533533
    534 for i in [1:N]
     534for i in [1:N] do
    535535
    536536switch innerFlowRegime
     
    607607end
    608608
    609 for i in [1:N]
     609for i in [1:N] do
    610610
    611611switch outerFlowRegime
     
    685685end
    686686
    687 for i in [2:N]
     687for i in [2:N] do
    688688
    689689"Incremental Enthalpy Inner Stream"
     
    835835        Outer.PressureDrop.Plocal(1) = OutletOuter.P;
    836836
    837 for i in [1:N]
     837for i in [1:N] do
    838838
    839839"Outer Pipe Pressure Drop for friction"                 
     
    948948        Inner.PressureDrop.Plocal(1) = OutletInner.P;
    949949
    950 for i in [1:N]
     950for i in [1:N] do
    951951
    952952"Inner Pipe Pressure Drop for friction"                 
     
    10401040        +UpperPipe.Outer.PressureDrop.Pd_fric(1);
    10411041
    1042 for i in [1:N]
     1042for i in [1:N] do
    10431043
    10441044"Outer Pipe Local Pressure"# FIXME: NOZZLE PRESSURE DROP MUST BE ADDED
  • branches/gui/eml/heat_exchangers/HeatExchangerDetailed.mso

    r492 r574  
    470470       
    471471"Shell Side Pressure Drop Friction Factor"
    472         Shell.PressureDrop.FricFactor=48*((1.33*Tubes.TubeOD/Tubes.TubePitch)^b)*Shell.HeatTransfer.Re^-1;
     472        Shell.PressureDrop.FricFactor=48*((1.33*Tubes.TubeOD/Tubes.TubePitch)^b)*Shell.HeatTransfer.Re^(-1);
    473473       
    474474        when Shell.HeatTransfer.Re > 10 switchto "range2";
     
    477477       
    478478"Ji Factor"
    479         Ji =1.36*((1.33*Tubes.TubeOD/Tubes.TubePitch)^a)*Shell.HeatTransfer.Re^-0.657;
     479        Ji =1.36*((1.33*Tubes.TubeOD/Tubes.TubePitch)^a)*Shell.HeatTransfer.Re^(-0.657);
    480480       
    481481"Shell Side Pressure Drop Friction Factor"
    482         Shell.PressureDrop.FricFactor=45.10*((1.33*Tubes.TubeOD/Tubes.TubePitch)^b)*Shell.HeatTransfer.Re^-0.973;
     482        Shell.PressureDrop.FricFactor=45.10*((1.33*Tubes.TubeOD/Tubes.TubePitch)^b)*Shell.HeatTransfer.Re^(-0.973);
    483483       
    484484        when Shell.HeatTransfer.Re > 100 switchto "range3";
     
    487487
    488488"Ji Factor"
    489         Ji =0.593*((1.33*Tubes.TubeOD/Tubes.TubePitch)^a)*Shell.HeatTransfer.Re^-0.477;
     489        Ji =0.593*((1.33*Tubes.TubeOD/Tubes.TubePitch)^a)*Shell.HeatTransfer.Re^(-0.477);
    490490       
    491491"Shell Side Pressure Drop Friction Factor"
    492         Shell.PressureDrop.FricFactor=4.570*((1.33*Tubes.TubeOD/Tubes.TubePitch)^b)*Shell.HeatTransfer.Re^-0.476;
     492        Shell.PressureDrop.FricFactor=4.570*((1.33*Tubes.TubeOD/Tubes.TubePitch)^b)*Shell.HeatTransfer.Re^(-0.476);
    493493       
    494494        when Shell.HeatTransfer.Re > 1000 switchto "range4";
     
    497497
    498498"Ji Factor"
    499         Ji =0.321*((1.33*Tubes.TubeOD/Tubes.TubePitch)^a)*Shell.HeatTransfer.Re^-0.388;
     499        Ji =0.321*((1.33*Tubes.TubeOD/Tubes.TubePitch)^a)*Shell.HeatTransfer.Re^(-0.388);
    500500       
    501501"Shell Side Pressure Drop Friction Factor"
    502         Shell.PressureDrop.FricFactor=0.486*((1.33*Tubes.TubeOD/Tubes.TubePitch)^b)*Shell.HeatTransfer.Re^-0.152;
     502        Shell.PressureDrop.FricFactor=0.486*((1.33*Tubes.TubeOD/Tubes.TubePitch)^b)*Shell.HeatTransfer.Re^(-0.152);
    503503
    504504        when Shell.HeatTransfer.Re > 10000 switchto "range5";
     
    507507
    508508"Ji Factor"
    509         Ji =0.321*((1.33*Tubes.TubeOD/Tubes.TubePitch)^a)*Shell.HeatTransfer.Re^-0.388;
     509        Ji =0.321*((1.33*Tubes.TubeOD/Tubes.TubePitch)^a)*Shell.HeatTransfer.Re^(-0.388);
    510510
    511511"Shell Side Pressure Drop Friction Factor"
    512         Shell.PressureDrop.FricFactor=0.372*((1.33*Tubes.TubeOD/Tubes.TubePitch)^b)*Shell.HeatTransfer.Re^-0.123;
     512        Shell.PressureDrop.FricFactor=0.372*((1.33*Tubes.TubeOD/Tubes.TubePitch)^b)*Shell.HeatTransfer.Re^(-0.123);
    513513       
    514514        when Shell.HeatTransfer.Re < 10000 switchto "range4";
     
    550550
    551551"Shell Side Pressure Drop Friction Factor"
    552         Shell.PressureDrop.FricFactor=32*((1.33*Tubes.TubeOD/Tubes.TubePitch)^b)*Shell.HeatTransfer.Re^-1;
     552        Shell.PressureDrop.FricFactor=32*((1.33*Tubes.TubeOD/Tubes.TubePitch)^b)*Shell.HeatTransfer.Re^(-1);
    553553       
    554554        when Shell.HeatTransfer.Re > 10 switchto "range2";
     
    560560
    561561"Shell Side Pressure Drop Friction Factor"
    562         Shell.PressureDrop.FricFactor=26.20*((1.33*Tubes.TubeOD/Tubes.TubePitch)^b)*Shell.HeatTransfer.Re^-0.913;
     562        Shell.PressureDrop.FricFactor=26.20*((1.33*Tubes.TubeOD/Tubes.TubePitch)^b)*Shell.HeatTransfer.Re^(-0.913);
    563563       
    564564        when Shell.HeatTransfer.Re > 100 switchto "range3";
     
    570570
    571571"Shell Side Pressure Drop Friction Factor"
    572         Shell.PressureDrop.FricFactor=3.50*((1.33*Tubes.TubeOD/Tubes.TubePitch)^b)*Shell.HeatTransfer.Re^-0.476;
     572        Shell.PressureDrop.FricFactor=3.50*((1.33*Tubes.TubeOD/Tubes.TubePitch)^b)*Shell.HeatTransfer.Re^(-0.476);
    573573       
    574574        when Shell.HeatTransfer.Re > 1000 switchto "range4";
     
    577577       
    578578"Ji Factor"
    579         Ji =0.370*((1.33*Tubes.TubeOD/Tubes.TubePitch)^a)*Shell.HeatTransfer.Re^-0.396;
     579        Ji =0.370*((1.33*Tubes.TubeOD/Tubes.TubePitch)^a)*Shell.HeatTransfer.Re^(-0.396);
    580580       
    581581"Shell Side Pressure Drop Friction Factor"
    582         Shell.PressureDrop.FricFactor=0.333*((1.33*Tubes.TubeOD/Tubes.TubePitch)^b)*Shell.HeatTransfer.Re^-0.136;
     582        Shell.PressureDrop.FricFactor=0.333*((1.33*Tubes.TubeOD/Tubes.TubePitch)^b)*Shell.HeatTransfer.Re^(-0.136);
    583583
    584584        when Shell.HeatTransfer.Re > 10000 switchto "range5";
     
    587587
    588588"Ji Factor"
    589         Ji =0.370*((1.33*Tubes.TubeOD/Tubes.TubePitch)^a)*Shell.HeatTransfer.Re^-0.396;
     589        Ji =0.370*((1.33*Tubes.TubeOD/Tubes.TubePitch)^a)*Shell.HeatTransfer.Re^(-0.396);
    590590       
    591591"Shell Side Pressure Drop Friction Factor"
    592         Shell.PressureDrop.FricFactor=0.303*((1.33*Tubes.TubeOD/Tubes.TubePitch)^b)*Shell.HeatTransfer.Re^-0.126;
     592        Shell.PressureDrop.FricFactor=0.303*((1.33*Tubes.TubeOD/Tubes.TubePitch)^b)*Shell.HeatTransfer.Re^(-0.126);
    593593       
    594594        when Shell.HeatTransfer.Re < 10000 switchto "range4";
     
    627627
    628628"Ji Factor"
    629         Ji =0.970*((1.33*Tubes.TubeOD/Tubes.TubePitch)^a)*Shell.HeatTransfer.Re^-0.667;
     629        Ji =0.970*((1.33*Tubes.TubeOD/Tubes.TubePitch)^a)*Shell.HeatTransfer.Re^(-0.667);
    630630       
    631631"Shell Side Pressure Drop Friction Factor"     
    632         Shell.PressureDrop.FricFactor=35*((1.33*Tubes.TubeOD/Tubes.TubePitch)^b)*Shell.HeatTransfer.Re^-1;
     632        Shell.PressureDrop.FricFactor=35*((1.33*Tubes.TubeOD/Tubes.TubePitch)^b)*Shell.HeatTransfer.Re^(-1);
    633633
    634634        when Shell.HeatTransfer.Re > 10 switchto "range2";
     
    637637
    638638"Ji Factor"
    639         Ji =0.900*((1.33*Tubes.TubeOD/Tubes.TubePitch)^a)*Shell.HeatTransfer.Re^-0.631;
     639        Ji =0.900*((1.33*Tubes.TubeOD/Tubes.TubePitch)^a)*Shell.HeatTransfer.Re^(-0.631);
    640640
    641641"Shell Side Pressure Drop Friction Factor"     
    642         Shell.PressureDrop.FricFactor=32.10*((1.33*Tubes.TubeOD/Tubes.TubePitch)^b)*Shell.HeatTransfer.Re^-0.963;
     642        Shell.PressureDrop.FricFactor=32.10*((1.33*Tubes.TubeOD/Tubes.TubePitch)^b)*Shell.HeatTransfer.Re^(-0.963);
    643643
    644644        when Shell.HeatTransfer.Re > 100 switchto "range3";
     
    647647
    648648"Ji Factor"
    649         Ji =0.408*((1.33*Tubes.TubeOD/Tubes.TubePitch)^a)*Shell.HeatTransfer.Re^-0.460;
     649        Ji =0.408*((1.33*Tubes.TubeOD/Tubes.TubePitch)^a)*Shell.HeatTransfer.Re^(-0.460);
    650650
    651651"Shell Side Pressure Drop Friction Factor"     
    652         Shell.PressureDrop.FricFactor=6.090*((1.33*Tubes.TubeOD/Tubes.TubePitch)^b)*Shell.HeatTransfer.Re^-0.602;
     652        Shell.PressureDrop.FricFactor=6.090*((1.33*Tubes.TubeOD/Tubes.TubePitch)^b)*Shell.HeatTransfer.Re^(-0.602);
    653653
    654654        when Shell.HeatTransfer.Re > 1000 switchto "range4";
     
    657657       
    658658"Ji Factor"
    659         Ji =0.107*((1.33*Tubes.TubeOD/Tubes.TubePitch)^a)*Shell.HeatTransfer.Re^-0.266;
     659        Ji =0.107*((1.33*Tubes.TubeOD/Tubes.TubePitch)^a)*Shell.HeatTransfer.Re^(-0.266);
    660660
    661661"Shell Side Pressure Drop Friction Factor"     
     
    667667       
    668668"Ji Factor"
    669         Ji =0.370*((1.33*Tubes.TubeOD/Tubes.TubePitch)^a)*Shell.HeatTransfer.Re^-0.395;
     669        Ji =0.370*((1.33*Tubes.TubeOD/Tubes.TubePitch)^a)*Shell.HeatTransfer.Re^(-0.395);
    670670
    671671"Shell Side Pressure Drop Friction Factor"     
    672         Shell.PressureDrop.FricFactor=0.391*((1.33*Tubes.TubeOD/Tubes.TubePitch)^b)*Shell.HeatTransfer.Re^-0.148;
     672        Shell.PressureDrop.FricFactor=0.391*((1.33*Tubes.TubeOD/Tubes.TubePitch)^b)*Shell.HeatTransfer.Re^(-0.148);
    673673
    674674        when Shell.HeatTransfer.Re < 10000 switchto "range4";
     
    900900       
    901901"Effectiveness Correction for 2 pass shell side"
    902         Method.Eft1 = 2*(1+Method.Cr+sqrt(1+Method.Cr^2)*((1+exp(-Method.NTU*sqrt(1+Method.Cr^2)))/(1-exp(-Method.NTU*sqrt(1+Method.Cr^2)))) )^-1;
     902        Method.Eft1 = 2*(1+Method.Cr+sqrt(1+Method.Cr^2)*((1+exp(-Method.NTU*sqrt(1+Method.Cr^2)))/(1-exp(-Method.NTU*sqrt(1+Method.Cr^2)))) )^(-1);
    903903
    904904"TEMA F Shell Effectiveness"
    905         Method.Eft = ( ((1-Method.Eft1*Method.Cr)/(1-Method.Eft1))^2 -1  )*( ((1-Method.Eft1*Method.Cr)/(1-Method.Eft1))^2 - Method.Cr )^-1;
     905        Method.Eft = ( ((1-Method.Eft1*Method.Cr)/(1-Method.Eft1))^2 -1  )*( ((1-Method.Eft1*Method.Cr)/(1-Method.Eft1))^2 - Method.Cr )^(-1);
    906906
    907907        case "Eshell":
    908908       
    909909"TEMA E Shell Effectiveness"
    910         Method.Eft = 2*(1+Method.Cr+sqrt(1+Method.Cr^2)*((1+exp(-Method.NTU*sqrt(1+Method.Cr^2)))/(1-exp(-Method.NTU*sqrt(1+Method.Cr^2)))) )^-1;
     910        Method.Eft = 2*(1+Method.Cr+sqrt(1+Method.Cr^2)*((1+exp(-Method.NTU*sqrt(1+Method.Cr^2)))/(1-exp(-Method.NTU*sqrt(1+Method.Cr^2)))) )^(-1);
    911911#       Method.Eft = 1;
    912912
  • branches/gui/eml/heat_exchangers/Heatex.mso

    r566 r574  
    362362       
    363363"TEMA E Shell Effectiveness"
    364         Method.Eft      = 2*(1+Method.Cr+sqrt(1+Method.Cr^2)*((1+exp(-Method.NTU*sqrt(1+Method.Cr^2)))/(1-exp(-Method.NTU*sqrt(1+Method.Cr^2)))) )^-1;
    365 
    366 end
    367 
    368 
    369 end
    370 
    371 end
     364        Method.Eft      = 2*(1+Method.Cr+sqrt(1+Method.Cr^2)*((1+exp(-Method.NTU*sqrt(1+Method.Cr^2)))/(1-exp(-Method.NTU*sqrt(1+Method.Cr^2)))) )^(-1);
     365
     366end
     367
     368
     369end
     370
     371end
  • branches/gui/eml/heat_exchangers/heater.mso

    r561 r574  
    4949        Outlet.F = sum(Inlet.F);       
    5050
    51  for j in [1 : NComp]
     51 for j in [1 : NComp] do
    5252       
    5353 "Composition"
  • branches/gui/eml/mixers_splitters/mixer.mso

    r554 r574  
    8080        Outlet.F = sum(Inlet.F);
    8181
    82         for i in [1:NComp]
     82        for i in [1:NComp] do
    8383       
    8484                "Composition"
  • branches/gui/eml/mixers_splitters/sepComp.mso

    r364 r574  
    6969       
    7070       
    71 for i in [1:NOutlet-1]
     71for i in [1:NOutlet-1] do
    7272
    7373"Mol fraction normalisation"
     
    7777       
    7878       
    79 for i in [1:NComp]
     79for i in [1:NComp] do
    8080       
    8181"Composition"
     
    8585       
    8686       
    87 for i in [1:NOutlet]
     87for i in [1:NOutlet] do
    8888       
    8989"Flow"
     
    152152        sum(Outlet1.z) = 1;
    153153       
    154 for i in [1:NComp]
     154for i in [1:NComp] do
    155155       
    156156 "Composition"
  • branches/gui/eml/mixers_splitters/splitter.mso

    r354 r574  
    5252        sum(frac) = 1;
    5353       
    54         for i in [1:NOutlet]
     54        for i in [1:NOutlet] do
    5555               
    5656                "Flow"
  • branches/gui/eml/reactors/equil.mso

    r530 r574  
    9797#               + PP.IdealGasEnthalpyOfFormationAt25C()*(1 - Outlet.T/To);
    9898
    99         for j in [1:NReac]
     99        for j in [1:NReac] do
    100100        "Gibbs free energy of reaction"
    101101                sumt(G*stoic(:,j)) = -Rg*Outlet.T*ln(K(j));
     
    106106        end
    107107
    108         for i in [1:NComp]
     108        for i in [1:NComp] do
    109109        "Outlet molar fraction"
    110110                Outlet.F*Outlet.z(i) = (Inlet.F*Inlet.z(i) + sumt(stoic(i,:)*extent));
    111111        end     
    112112
    113         for i in [1:NComp]
     113        for i in [1:NComp] do
    114114          if (Outletm.z(i) > 1e-16) then
    115115            "Molar conversion"
     
    192192#       K = exp(-sumt(G*stoic)/(Rg*Outlet.T));
    193193       
    194         for j in [1:NReac]
     194        for j in [1:NReac] do
    195195        "Equilibrium constant"
    196196                K(j) = prod(activ^stoic(:,j));
    197197        end
    198198       
    199         for i in [1:NComp]
     199        for i in [1:NComp] do
    200200        "Outlet molar fraction"
    201201                Outlet.F*Outlet.z(i) = (Inlet.F*Inlet.z(i) + sumt(stoic(i,:)*extent));
    202202        end     
    203203
    204         for i in [1:NComp]
     204        for i in [1:NComp] do
    205205          if (Outletm.z(i) > 1e-16) then
    206206            "Molar conversion"
  • branches/gui/eml/reactors/gibbs.mso

    r530 r574  
    104104#               + PP.IdealGasEnthalpyOfFormationAt25C()*(1 - Outlet.T/To);
    105105
    106         for i in [1:NComp]
     106        for i in [1:NComp] do
    107107        "Lagrangian multiplier"
    108108                G(i) + sumt(lambda*na(:,i)) = -Rg*Outlet.T*ln(activ(i));
     
    191191#               + PP.IdealGasEnthalpyOfFormationAt25C()*(1 - Outlet.T/To);
    192192
    193         for i in [1:NComp]
     193        for i in [1:NComp] do
    194194        "Lagrangian multiplier"
    195195                G(i) + sumt(lambda*na(:,i)) = -Rg*Outlet.T*ln(activ(i));
  • branches/gui/eml/reactors/pfr.mso

    r354 r574  
    8282        Outlet.v = str(NDisc+1).v;
    8383       
    84         for z in [1:NDisc]
    85                 for c in [1:NComp-1]
     84        for z in [1:NDisc] do
     85                for c in [1:NComp-1] do
    8686                        "Component Molar Balance"
    8787                        diff(M(c,z)) = (str(z).F*str(z).z(c) - str(z+1).F*str(z+1).z(c))
     
    113113        end
    114114
    115         for z in [1:NDisc+1]
     115        for z in [1:NDisc+1] do
    116116                "Specific Volume"
    117117                vol(z) = PP.VapourVolume(str(z).T, str(z).P, str(z).z);
  • branches/gui/eml/reactors/stoic.mso

    r530 r574  
    7272        Outlet.F = Outletm.F;
    7373       
    74         for i in [1:NComp]
     74        for i in [1:NComp] do
    7575          if (Outletm.z(i) > 1e-16) then
    7676            "Molar conversion"
     
    123123        Outlet.F = Outletm.F;
    124124
    125         for i in [1:NComp]
     125        for i in [1:NComp] do
    126126          if (Outletm.z(i) > 1e-16) then
    127127            "Molar conversion"
  • branches/gui/eml/reactors/vol_tank.mso

    r427 r574  
    9090                                        Vt = pi/4*(D^2)*L;
    9191                                "Level tank volume"
    92                                         V = ((D^2)*acos((D - 2*Level)/D)/4/"rad" -
     92                                        V = ((D^2)*acos((D - 2*Level)/D)/4/'r' -
    9393                                        (D - 2*Level)*sqrt(D*Level - Level^2)/2)*L;
    9494                       
  • branches/gui/eml/reactors/yield.mso

    r530 r574  
    8484        Outlet.F*Outlet.h = Outletm.F*Outletm.h;
    8585       
    86         for i in [1:NComp]
     86        for i in [1:NComp] do
    8787          if (Outletm.z(i) > 1e-16) then
    8888            "Molar conversion"
     
    147147        Outlet.F*Outlet.h = Outletm.F*Outletm.h;
    148148       
    149         for i in [1:NComp]
     149        for i in [1:NComp] do
    150150          if (Outletm.z(i) > 0) then
    151151            "Molar conversion"
  • branches/gui/sample/miscellaneous/sample_arrays.mso

    r176 r574  
    3030
    3131        EQUATIONS
    32         for i in [1 : Dimension]
     32        for i in [1 : Dimension] do
    3333                diff(Var1(1,i)) = Var2(1,i)/'s';
    3434        end
  • branches/gui/sample/miscellaneous/sample_arrays2.mso

    r176 r574  
    3232        diff(Var1(1,1))*'s' = Var2(1,2);
    3333       
    34         for i in [2 : Dimension-1]
     34        for i in [2 : Dimension-1] do
    3535                diff(Var1(1,i))*'s' = Var2(1,i-1)+Var2(1,i+1);
    3636        end
  • branches/gui/sample/miscellaneous/sample_galvanic.mso

    r535 r574  
    2727*--------------------------------------------------------------------*#
    2828
    29 include "types";
    30 
     29using "types";
    3130
    3231FlowSheet cell
  • branches/gui/sample/miscellaneous/sample_tanks.mso

    r313 r574  
    3535       
    3636        SPECIFY
    37         "Vazao de entrada"
    3837        Fin = 10 * 'm^3/h';
    3938
     
    6564       
    6665        SPECIFY
    67         "Vazao de entrada"
    6866        Fin = 10 * 'm^3/h';
    6967
  • branches/gui/sample/miscellaneous/tenprobs/prob07.mso

    r228 r574  
    7171        dz = (z(N+2) - z(1))/(N+1);
    7272       
    73         for i in [2:(N+1)]
     73        for i in [2:(N+1)] do
    7474        "Concentration of reactant"     
    7575                (C(i+1) - 2*C(i)+ C(i-1))/(z(i) - z(i-1))^2
     
    111111       
    112112        SPECIFY
    113         "Lower boundary"
    114113        reac.z(1) = 0*'m';
    115114
    116         "Upper boundary"
    117115        reac.z(N+2) = reac.L;
    118 
    119116
    120117        OPTIONS
     
    162159       
    163160        SPECIFY
    164         "Lower boundary"
    165161        reac.z(1) = 0*'m';
    166162
    167         "Upper boundary"
    168163        reac.z(N+2) = reac.L;
    169 
    170164
    171165        OPTIONS
  • branches/gui/sample/optimization/ammonia.mso

    r313 r574  
    9494        Outlet.F = Inlet.F * (1 - sum(Outletz));
    9595       
    96         for i in [1:NComp]
     96        for i in [1:NComp] do
    9797                "Component Molar Balance"
    9898                Outletz(i) = Inlet.z(i) + sum(stoic(i,:)*X*Inlet.z(comp));
     
    169169       
    170170        F102.OutletV.P = 10 * 'atm';
    171         F102.InletQ.Q = 0 * 'kJ/h';
     171        F102.InletQ = 0 * 'kJ/h';
    172172       
    173173        # We can choose between one of the following specs
  • branches/gui/sample/processes/Sample_Process.mso

    r564 r574  
    7878EQUATIONS
    7979
    80 for z in [1:Reac.NDisc]
     80for z in [1:Reac.NDisc] do
    8181       
    8282"Reaction Rate = k*C(1)"
     
    125125INITIAL
    126126
    127 for z in [2:Reac.NDisc+1]
     127for z in [2:Reac.NDisc+1] do
    128128       
    129129        Reac.str(z).T = Reac.Inlet.T;
  • branches/gui/sample/reactors/fogler/chap2/series_reactors.mso

    r446 r574  
    239239        V(1) = 0.0*'l';
    240240
    241         for i in [2:N]
     241        for i in [2:N] do
    242242        "Molar balance"
    243243           V(i) - V(i-1) = -0.5*Inlet.F*dx*(1/r(i-1) + 1/r(i)); # second order
     
    250250        Outlet.F = Inlet.F;
    251251       
    252         for i in [1:N]
     252        for i in [1:N] do
    253253        "Rate of reaction"
    254254                (-r(i)) = sum(a*X(i)^[0:(NT-1)]);
     
    293293       
    294294        SPECIFY
    295         "Inlet conversion"
    296295        Inlet.X = 0.0;
    297         "Required conversion"
    298296        R1.Outlet.X = 0.8;
    299297       
     
    316314       
    317315        SPECIFY
    318         "Inlet molar flow"
    319316        Inlet.F = 0.866541*'mol/s';
    320         "Inlet conversion"
    321317        Inlet.X = 0.0;
    322318       
     
    350346
    351347        SPECIFY
    352         "Inlet molar flow"
    353348        Inlet.F = 0.866541*'mol/s';
    354         "Inlet conversion"
    355349        Inlet.X = 0.0;
    356350
    357         "Required conversion"
    358351        R1.Outlet.X     = 0.8;
    359352       
     
    392385
    393386        SPECIFY
    394         "Inlet molar flow"
    395387        Inlet.F = 5.0*'mol/s';
    396         "Inlet conversion"
    397388        Inlet.X = 0.0;
    398389
    399         "Required CSTR conversion"
    400390        CSTR.Outlet.X = 0.6;
    401         "Required PFR conversion"
    402391        PFR.Outlet.X = 0.6;
    403392       
     
    435424       
    436425        SPECIFY
    437         "Inlet molar flow"
    438426        Inlet.F = 0.866541*'mol/s';
    439         "Inlet conversion"
    440427        Inlet.X = 0.0;
    441428       
    442         "Required 1st reactor conversion"
    443429        R1.Outlet.X = 0.4;
    444         "Required 2nd reactor conversion"
    445430        R2.Outlet.X = 0.8;
    446431       
     
    478463       
    479464        SPECIFY
    480         "Inlet molar flow"
    481465        Inlet.F = 0.866541*'mol/s';
    482         "Inlet conversion"
    483466        Inlet.X = 0.0;
    484467       
    485         "Required 1st reactor conversion"
    486468        R1.Outlet.X = 0.4;
    487         "Required 2nd reactor conversion"
    488469        R2.Outlet.X = 0.8;
    489470       
     
    524505       
    525506        SPECIFY
    526         "Inlet molar flow"
    527507        Inlet.F = 0.866541*'mol/s';
    528         "Inlet conversion"
    529508        Inlet.X = 0.0;
    530509       
    531         "Required 1st reactor conversion"
    532510        R1.Outlet.X = 0.5;
    533         "Required 2nd reactor conversion"
    534511        R2.Outlet.X = 0.8;
    535512       
     
    570547       
    571548        SPECIFY
    572         "Inlet molar flow"
    573549        Inlet.F = 0.866541*'mol/s';
    574         "Inlet conversion"
    575550        Inlet.X = 0.0;
    576551       
    577         "Required 1st reactor conversion"
    578552        R1.Outlet.X = 0.5;
    579         "Required 2nd reactor conversion"
    580553        R2.Outlet.X = 0.8;
    581554       
  • branches/gui/sample/reactors/fogler/chap3/equilibrium_conversion.mso

    r202 r574  
    110110       
    111111        SPECIFY
    112         "Inlet molar fraction"
    113112        Inlet.z = [1.0, 0.0];
    114 
    115         "Inlet pressure"
    116113        P = 2.0*'atm';
    117         "Inlet temperature"
    118114        T = 340*'K';
    119115       
    120         "Equilibrium constant"
    121116        Kc = 0.1*'mol/l';
    122117       
     
    178173       
    179174        SPECIFY
    180         "Inlet molar fraction"
    181175        Inlet.z = [1.0, 0.0];
    182176
    183         "Inlet pressure"
    184177        P = 2.0*'atm';
    185         "Inlet temperature"
    186178        T = 340*'K';
    187179       
    188         "Equilibrium constant"
    189180        Kc = 0.1*'mol/l';
    190181       
  • branches/gui/sample/reactors/fogler/chap3/oxidation_of_so2.mso

    r202 r574  
    108108       
    109109        SPECIFY
    110         "Inlet molar fraction"
    111110        Inlet.z = [0.28, 0.1512, 0.0, 0.5688];
    112         "Inlet pressure"
    113111        P = 1485*'kPa';
    114         "Inlet temperature"
    115112        T = (227 + 273.15)*'K';
    116113       
  • branches/gui/sample/reactors/fogler/chap4/membrane_reactor.mso

    r188 r574  
    9494       
    9595        SPECIFY
    96         "Pressure"
    9796        P = 8.2*'atm';  # Isobaric system
    98         "Temperature"
    9997        T = 500*'K';    # Isotermic system
    10098       
    101         "Specific rate of reaction"
    10299        k = 0.7*'1/min';
    103100
  • branches/gui/sample/reactors/fogler/chap4/molarflow_pfr.mso

    r188 r574  
    8888       
    8989    SPECIFY
    90         "Input total molar concentration"
    9190        Cto = 0.1*'mol/l';
    9291       
    93         "Input molar flow"
    9492        Fo = [10, 0]*'mol/min';
    9593       
  • branches/gui/sample/reactors/fogler/chap4/semibatch_reactor.mso

    r202 r574  
    8585       
    8686        SPECIFY
    87         "Specific rate of reaction"
    8887        k = 2.2*'l/mol/s';
    8988       
    90         "Inlet concentration"
    9189        Co = [0.0, 0.025, 0.0, 0.0]*'mol/l';
    9290
  • branches/gui/sample/reactors/fogler/chap4/spheric_reactor.mso

    r188 r574  
    103103       
    104104        SPECIFY
    105         "Input molar concentration of A"
    106105        Ca0 = 320*'mol/m^3';
    107         "Input molar flow of A"
    108106        Fa0 = 440*'mol/s';
    109         "Initial pressure"
    110107        P0      = 2000*'kPa';
    111         "Input mass flow"
    112108        m       = 44*'kg/s';
    113109
  • branches/gui/sample/reactors/fogler/chap8/acetic_anhydride.mso

    r202 r574  
    145145       
    146146        SPECIFY
    147         "Inlet molar flow"
    148147        R.Fao = (8000/58)*'kmol/h';
    149148       
     
    187186       
    188187        SPECIFY
    189         "Inlet molar flow"
    190188        R.Fao = (18.8*2e-3)*'mol/s';
    191189       
  • branches/gui/sample/reactors/fogler/chap8/series_reactions.mso

    r383 r574  
    123123       
    124124        SPECIFY
    125         "Inlet temperature"
    126125        To = 283*'K';
    127         "Inlet concentration of A"
    128126        Co= 0.3*'mol/m^3';
    129127
  • branches/gui/sample/reactors/fogler/chap9/cstr_startup.mso

    r383 r574  
    139139       
    140140        SPECIFY
    141         "Inlet molar flow"
    142141        CSTR.Fo = [80, 1000, 0, 100]*'lbmol/h';
    143         "Inlet reactor temperature"
    144142        CSTR.To = (75 + 460)*'degR';
    145         "Molar flow of cooling water"
    146143        CSTR.mc = 1e3*'lbmol/h';
    147144
     
    186183       
    187184        SPECIFY
    188         "Inlet molar flow"
    189185        CSTR.Fo = [80, 1000, 0, 100]*'lbmol/h';
    190         "Inlet reactor temperature"
    191186        CSTR.To = (70 + 460)*'degR'; # Reduction of temperature: 75°F to 70°F
    192         "Molar flow of cooling water"
    193187        CSTR.mc = 1e3*'lbmol/h';
    194188
     
    242236
    243237        SPECIFY
    244         "Inlet molar flow"
    245238        CSTR.Fo = [80, 1000, 0, 100]*'lbmol/h';
    246         "Inlet reactor temperature"
    247239        CSTR.To = (70 + 460)*'degR';
    248240
  • branches/gui/sample/reactors/sample_batch.mso

    r313 r574  
    7474       
    7575        SPECIFY
    76         "Feed conditions"
    7776        feed.T = 300*'K';
    7877        feed.P = 1*'atm';
     
    8180        feed.z = [0,1,0,0,0];
    8281
    83         "Reactor volume"
    8482        reac.Vr = 1 * 'l';
    8583       
  • branches/gui/sample/reactors/sample_cstr.mso

    r245 r574  
    6262        Reac.Outlet.F   = Reac.Inlet.F;
    6363
    64         "Adiabatic"
    6564        Reac.q                  = 0     * 'J/s';
    6665        Reac.Outlet.P   = 1     * 'atm';
  • branches/gui/sample/reactors/sample_pfr.mso

    r213 r574  
    6565EQUATIONS
    6666
    67 for z in [1:Reac.NDisc]
     67for z in [1:Reac.NDisc] do
    6868       
    6969"Reaction Rate = k*C(1)"
     
    8484        s1.Outlet.z = [1, 0, 0];
    8585
    86 "Adiabatic"
    8786        Reac.q     = 0     * 'J/s';
    8887       
     
    9392INITIAL
    9493
    95 for z in [2:Reac.NDisc+1]
     94for z in [2:Reac.NDisc+1] do
    9695       
    9796        Reac.str(z).T = Reac.Inlet.T;
  • branches/gui/sample/stage_separators/sample_column.mso

    r555 r574  
    341341        Qr.OutletQ to col.reb.InletQ;
    342342
    343         EQUATIONS
    344    "Temperature Controller"
    345         TCcond.Parameters.tau = 0*'s'; 
    346         TCcond.Parameters.tauSet = 0*'s';       
    347         TCcond.Parameters.alpha = 0.3;
    348         TCcond.Parameters.bias = 0.5;   
    349         TCcond.Parameters.gamma = 1;
    350         TCcond.Parameters.beta = 1;
     343        SET
     344        TCcond.tau = 0*'s';     
     345        TCcond.tauSet = 0*'s'; 
     346        TCcond.alpha = 0.3;
     347        TCcond.bias = 0.5;     
     348        TCcond.gamma = 1;
     349        TCcond.beta = 1;
    351350        TCcond.Action = "Direct";
    352351        TCcond.Clip = "Clipped";
    353352        TCcond.Mode = "Automatic";
    354         TCcond.Parameters.intTime = 60*'s';
    355         TCcond.Parameters.gain = 0.6;
    356         TCcond.Parameters.derivTime = 1*'s';
     353        TCcond.intTime = 60*'s';
     354        TCcond.gain = 0.6;
     355        TCcond.derivTime = 1*'s';
     356
     357        PC.tau = 0*'s';
     358        PC.tauSet = 0*'s';     
     359        PC.alpha = 0.3;
     360        PC.bias = 0;   
     361        PC.gamma = 1;
     362        PC.beta = 1;
     363        PC.Action = "Reverse";
     364        PC.Clip = "Clipped";
     365        PC.Mode = "Automatic";
     366        PC.intTime = 50*'s';
     367        PC.gain = 0.5;
     368        PC.derivTime = 1*'s';
     369       
     370        LCtop.tau = 0*'s';     
     371        LCtop.tauSet = 0*'s';   
     372        LCtop.alpha = 0.3;
     373        LCtop.bias = 0.5;       
     374        LCtop.gamma = 1;
     375        LCtop.beta = 1;
     376        LCtop.Action = "Reverse";
     377        LCtop.Clip = "Clipped";
     378        LCtop.Mode = "Automatic";
     379        LCtop.intTime = 10*'s';
     380        LCtop.gain = 1;
     381        LCtop.derivTime = 0*'s';
     382
     383        LCbot.tau = 0*'s';     
     384        LCbot.tauSet = 0*'s';   
     385        LCbot.alpha = 0.3;
     386        LCbot.bias = 0.5;       
     387        LCbot.gamma = 1;
     388        LCbot.beta = 1;
     389        LCbot.Action = "Reverse";
     390        LCbot.Clip = "Clipped";
     391        LCbot.Mode = "Automatic";
     392        LCbot.intTime = 100*'s';
     393        LCbot.gain = 1;
     394        LCbot.derivTime = 0*'s';
     395
     396        EQUATIONS
    357397        TCcond.Ports.setPoint = ((15+273.15) * 'K' - Tmin)/(Tmax-Tmin);
    358398        TCcond.Ports.input = Tad;
     
    360400        Qc.OutletQ = Qcmin+(Qcmax-Qcmin)*TCcond.Ports.output;   
    361401
    362         "Pressure Controller"
    363         PC.Parameters.tau = 0*'s';     
    364         PC.Parameters.tauSet = 0*'s';   
    365         PC.Parameters.alpha = 0.3;
    366         PC.Parameters.bias = 0;
    367         PC.Parameters.gamma = 1;
    368         PC.Parameters.beta = 1;
    369         PC.Action = "Reverse";
    370         PC.Clip = "Clipped";
    371         PC.Mode = "Automatic";
    372         PC.Parameters.intTime = 50*'s';
    373         PC.Parameters.gain = 0.5;
    374         PC.Parameters.derivTime = 1*'s';
    375402        PC.Ports.setPoint = (4.0*'bar'-Pmin)/(Pmax-Pmin);
    376403        PC.Ports.input = Pad;
     
    378405        col.cond.OutletV.F = (Fcmin+(Fcmax-Fcmin)*PC.Ports.output);     
    379406       
    380         "Ttop Level Controller"
    381         LCtop.Parameters.tau = 0*'s';   
    382         LCtop.Parameters.tauSet = 0*'s';       
    383         LCtop.Parameters.alpha = 0.3;
    384         LCtop.Parameters.bias = 0.5;   
    385         LCtop.Parameters.gamma = 1;
    386         LCtop.Parameters.beta = 1;
    387         LCtop.Action = "Reverse";
    388         LCtop.Clip = "Clipped";
    389         LCtop.Mode = "Automatic";
    390         LCtop.Parameters.intTime = 10*'s';
    391         LCtop.Parameters.gain = 1;
    392         LCtop.Parameters.derivTime = 0*'s';
    393407        LCtop.Ports.setPoint = (1.0 * 'm' - Hmint)/(Hmaxt-Hmint);
    394408        LCtop.Ports.input = Had_top;
     
    396410        col.sptop.Outlet1.F = Fcmin + (Fcmax-Fcmin) * LCtop.Ports.output;
    397411
    398         "Tbottom Level Controller"
    399         LCbot.Parameters.tau = 0*'s';   
    400         LCbot.Parameters.tauSet = 0*'s';       
    401         LCbot.Parameters.alpha = 0.3;
    402         LCbot.Parameters.bias = 0.5;   
    403         LCbot.Parameters.gamma = 1;
    404         LCbot.Parameters.beta = 1;
    405         LCbot.Action = "Reverse";
    406         LCbot.Clip = "Clipped";
    407         LCbot.Mode = "Automatic";
    408         LCbot.Parameters.intTime = 100*'s';
    409         LCbot.Parameters.gain = 1;
    410         LCbot.Parameters.derivTime = 0*'s';
    411412        LCbot.Ports.setPoint = (1.0 * 'm' - Hminb)/(Hmaxb-Hminb);
    412413        LCbot.Ports.input = Had_bot;
     
    731732        TCcond.Clip = "Clipped";
    732733        TCcond.Mode = "Automatic";
     734        TCcond.tau = 0*'s';     
     735        TCcond.tauSet = 0*'s'; 
     736        TCcond.alpha = 0.3;
     737        TCcond.bias = 0.5;     
     738        TCcond.gamma = 1;
     739        TCcond.beta = 1;
     740        TCcond.intTime = 60*'s';
     741        TCcond.gain = 0.6;
     742        TCcond.derivTime = 1*'s';
    733743
    734744        PC.Action = "Reverse";
    735745        PC.Clip = "Clipped";
    736746        PC.Mode = "Automatic";
     747        PC.tau = 0*'s';
     748        PC.tauSet = 0*'s';     
     749        PC.alpha = 0.3;
     750        PC.bias = 0;   
     751        PC.gamma = 1;
     752        PC.beta = 1;
     753        PC.intTime = 50*'s';
     754        PC.gain = 0.5;
     755        PC.derivTime = 1*'s';
    737756
    738757        LCtop.Action = "Reverse";
    739758        LCtop.Clip = "Clipped";
    740759        LCtop.Mode = "Automatic";
    741        
     760        LCtop.tau = 0*'s';     
     761        LCtop.tauSet = 0*'s';   
     762        LCtop.alpha = 0.3;
     763        LCtop.bias = 0.5;       
     764        LCtop.gamma = 1;
     765        LCtop.beta = 1;
     766        LCtop.intTime = 10*'s';
     767        LCtop.gain = 1;
     768        LCtop.derivTime = 0*'s';
     769
    742770        LCbot.Action = "Reverse";
    743771        LCbot.Clip = "Clipped";
    744772        LCbot.Mode = "Automatic";
     773        LCbot.tau = 0*'s';     
     774        LCbot.tauSet = 0*'s';   
     775        LCbot.alpha = 0.3;
     776        LCbot.bias = 0.5;       
     777        LCbot.gamma = 1;
     778        LCbot.beta = 1;
     779        LCbot.intTime = 100*'s';
     780        LCbot.gain = 1;
     781        LCbot.derivTime = 0*'s';
    745782
    746783        EQUATIONS
    747    "Temperature Controller"
    748         TCcond.Parameters.tau = 0*'s'; 
    749         TCcond.Parameters.tauSet = 0*'s';       
    750         TCcond.Parameters.alpha = 0.3;
    751         TCcond.Parameters.bias = 0.5;   
    752         TCcond.Parameters.gamma = 1;
    753         TCcond.Parameters.beta = 1;
    754         TCcond.Parameters.intTime = 60*'s';
    755         TCcond.Parameters.gain = 0.6;
    756         TCcond.Parameters.derivTime = 1*'s';
    757784        TCcond.Ports.setPoint = ((15+273.15) * 'K' - Tmin)/(Tmax-Tmin);
    758785        TCcond.Ports.input = Tad;
     
    760787        Qc.OutletQ = Qcmin+(Qcmax-Qcmin)*TCcond.Ports.output;   
    761788
    762         "Pressure Controller"
    763         PC.Parameters.tau = 0*'s';     
    764         PC.Parameters.tauSet = 0*'s';   
    765         PC.Parameters.alpha = 0.3;
    766         PC.Parameters.bias = 0;
    767         PC.Parameters.gamma = 1;
    768         PC.Parameters.beta = 1;
    769         PC.Parameters.intTime = 50*'s';
    770         PC.Parameters.gain = 0.5;
    771         PC.Parameters.derivTime = 1*'s';
    772789        PC.Ports.setPoint = (4.0*'bar'-Pmin)/(Pmax-Pmin);
    773790        PC.Ports.input = Pad;
     
    775792        col.cond.OutletV.F = (Fcmin+(Fcmax-Fcmin)*PC.Ports.output);     
    776793       
    777         "Ttop Level Controller"
    778         LCtop.Parameters.tau = 0*'s';   
    779         LCtop.Parameters.tauSet = 0*'s';       
    780         LCtop.Parameters.alpha = 0.3;
    781         LCtop.Parameters.bias = 0.5;   
    782         LCtop.Parameters.gamma = 1;
    783         LCtop.Parameters.beta = 1;
    784         LCtop.Parameters.intTime = 10*'s';
    785         LCtop.Parameters.gain = 1;
    786         LCtop.Parameters.derivTime = 0*'s';
    787794        LCtop.Ports.setPoint = (1.0 * 'm' - Hmint)/(Hmaxt-Hmint);
    788795        LCtop.Ports.input = Had_top;
     
    790797        col.sptop.Outlet1.F = Fcmin + (Fcmax-Fcmin) * LCtop.Ports.output;
    791798
    792         "Tbottom Level Controller"
    793         LCbot.Parameters.tau = 0*'s';   
    794         LCbot.Parameters.tauSet = 0*'s';       
    795         LCbot.Parameters.alpha = 0.3;
    796         LCbot.Parameters.bias = 0.5;   
    797         LCbot.Parameters.gamma = 1;
    798         LCbot.Parameters.beta = 1;
    799         LCbot.Parameters.intTime = 100*'s';
    800         LCbot.Parameters.gain = 1;
    801         LCbot.Parameters.derivTime = 0*'s';
    802799        LCbot.Ports.setPoint = (1.0 * 'm' - Hminb)/(Hmaxb-Hminb);
    803800        LCbot.Ports.input = Had_bot;
  • branches/gui/sample/stage_separators/sample_columnReact.mso

    r530 r574  
    9191 
    9292        if col.reb.startup then
    93                 Qc.OutletQ.Q = 0 * PIDTcond.Ports.output * 'kJ/s';
    94                 Qr.OutletQ.Q = 0 * PIDTreb.Ports.output * 'kJ/s';
     93                Qc.OutletQ = 0 * PIDTcond.Ports.output * 'kJ/s';
     94                Qr.OutletQ = 0 * PIDTreb.Ports.output * 'kJ/s';
    9595               
    9696                PIDTreb.Ports.input = PIDTreb.Ports.setPoint;
    9797        else
    98                 Qc.OutletQ.Q = Qcmin+(Qcmax-Qcmin)*PIDTcond.Ports.output;
    99                 Qr.OutletQ.Q = Qrmin+(Qrmax-Qrmin)*PIDTreb.Ports.output;
     98                Qc.OutletQ = Qcmin+(Qcmax-Qcmin)*PIDTcond.Ports.output;
     99                Qr.OutletQ = Qrmin+(Qrmax-Qrmin)*PIDTreb.Ports.output;
    100100               
    101101                PIDTreb.Ports.input=Treb_ad;
    102102        end
     103       
     104        SET
     105        PIDLreb.tau = 1*'s';
     106        PIDLreb.tauSet=1*'s';
     107        PIDLreb.bias = 0;
     108        PIDLreb.alpha=1;
     109        PIDLreb.gamma=1;
     110        PIDLreb.beta=1;
     111        PIDLreb.gain=0.9;
     112        PIDLreb.intTime=20*'s';
     113        PIDLreb.derivTime=0*'s';
     114        PIDLreb.Action = "Direct";
     115        PIDLreb.Clip = "Clipped";
     116        PIDLreb.Mode = "Automatic";
     117
     118
     119        PIDLcond.tau = 1*'s';   
     120        PIDLcond.tauSet=1*'s';
     121        PIDLcond.bias = 0.5;
     122        PIDLcond.alpha=1;
     123        PIDLcond.gamma=1;
     124        PIDLcond.beta=1;
     125        PIDLcond.gain=1;
     126        PIDLcond.intTime=10*'s';
     127        PIDLcond.derivTime=1*'s';
     128        PIDLcond.Action = "Direct";
     129        PIDLcond.Clip = "Clipped";
     130        PIDLcond.Mode = "Automatic";
     131
     132        PIDTreb.tau = 1*'s';   
     133        PIDTreb.tauSet=1*'s';
     134        PIDTreb.bias = 0.2;
     135        PIDTreb.alpha=0.2;
     136        PIDTreb.gamma=1;
     137        PIDTreb.beta=1;
     138        PIDTreb.gain=0.9;
     139        PIDTreb.intTime=100*'s';
     140        PIDTreb.derivTime=1*'s';
     141        PIDTreb.Action = "Direct";
     142        PIDTreb.Clip = "Clipped";
     143        PIDTreb.Mode = "Automatic";
     144
     145        PIDTcond.tau = 1*'s';   
     146        PIDTcond.tauSet=1*'s';
     147        PIDTcond.bias = 0.5;
     148        PIDTcond.alpha=0.2;
     149        PIDTcond.gamma=1;
     150        PIDTcond.beta=1;
     151        PIDTcond.gain=0.9;
     152        PIDTcond.intTime=100*'s';
     153        PIDTcond.derivTime=1*'s';
     154        PIDTcond.Action = "Reverse";
     155        PIDTcond.Clip = "Clipped";
     156        PIDTcond.Mode = "Automatic";
     157
    103158
    104159        SPECIFY
     
    118173        col.trays.Emv = 1;
    119174       
     175        EQUATIONS
     176       
    120177# Variáveis dos PID's especificadas
    121         PIDLreb.Parameters.tau = 1*'s';
    122         PIDLreb.Parameters.tauSet=1*'s';
    123         PIDLreb.Parameters.bias = 0;
    124         PIDLreb.Parameters.alpha=1;
    125         PIDLreb.Parameters.gamma=1;
    126         PIDLreb.Parameters.beta=1;
    127         PIDLreb.Parameters.gain=0.9;
    128         PIDLreb.Parameters.intTime=20*'s';
    129         PIDLreb.Parameters.derivTime=0*'s';
    130         PIDLreb.Options.action=-1;
    131         PIDLreb.Options.clip=1;
    132         PIDLreb.Options.autoMan=0;
    133178        PIDLreb.Ports.setPoint=(0.5 * 'm' - Lrebmin)/(Lrebmax-Lrebmin);
    134179        Lreb_ad*(Lrebmax-Lrebmin)=col.reb.Level-Lrebmin;
     
    136181        col.reb.OutletL.F = Frmin + (Frmax-Frmin) * PIDLreb.Ports.output;
    137182
    138         PIDLcond.Parameters.tau = 1*'s';       
    139         PIDLcond.Parameters.tauSet=1*'s';
    140         PIDLcond.Parameters.bias = 0.5;
    141         PIDLcond.Parameters.alpha=1;
    142         PIDLcond.Parameters.gamma=1;
    143         PIDLcond.Parameters.beta=1;
    144         PIDLcond.Parameters.gain=1;
    145         PIDLcond.Parameters.intTime=10*'s';
    146         PIDLcond.Parameters.derivTime=1*'s';
    147         PIDLcond.Options.action=-1;
    148         PIDLcond.Options.clip=1;
    149         PIDLcond.Options.autoMan=0;
    150183        PIDLcond.Ports.setPoint=(0.5 * 'm' - Lcondmin)/(Lcondmax-Lcondmin);
    151184        Lcond_ad*(Lcondmax-Lcondmin)=col.cond.Level-Lcondmin;
     
    153186        col.sp.Outlet1.F = Fmin + (Fmax-Fmin) * PIDLcond.Ports.output;
    154187
    155         PIDTreb.Parameters.tau = 1*'s';
    156         PIDTreb.Parameters.tauSet=1*'s';
    157         PIDTreb.Parameters.bias = 0.2;
    158         PIDTreb.Parameters.alpha=0.2;
    159         PIDTreb.Parameters.gamma=1;
    160         PIDTreb.Parameters.beta=1;
    161         PIDTreb.Parameters.gain=0.9;
    162         PIDTreb.Parameters.intTime=100*'s';
    163         PIDTreb.Parameters.derivTime=1*'s';
    164         PIDTreb.Options.action=1;
    165         PIDTreb.Options.clip=1;
    166         PIDTreb.Options.autoMan=0;
    167188        PIDTreb.Ports.setPoint= (366 * 'K' - Trebmin)/(Trebmax-Trebmin);
    168189        Treb_ad*(Trebmax-Trebmin)=col.reb.OutletL.T-Trebmin;
    169190
    170         PIDTcond.Parameters.tau = 1*'s';       
    171         PIDTcond.Parameters.tauSet=1*'s';
    172         PIDTcond.Parameters.bias = 0.5;
    173         PIDTcond.Parameters.alpha=0.2;
    174         PIDTcond.Parameters.gamma=1;
    175         PIDTcond.Parameters.beta=1;
    176         PIDTcond.Parameters.gain=0.9;
    177         PIDTcond.Parameters.intTime=100*'s';
    178         PIDTcond.Parameters.derivTime=1*'s';
    179         PIDTcond.Options.action=1;
    180         PIDTcond.Options.clip=1;
    181         PIDTcond.Options.autoMan=0;
    182191        PIDTcond.Ports.setPoint= (346 * 'K' - Tcondmin)/(Tcondmax-Tcondmin);
    183192        Tcond_ad*(Tcondmax-Tcondmin)=col.cond.OutletL.T-Tcondmin;
Note: See TracChangeset for help on using the changeset viewer.