Ignore:
Timestamp:
Mar 4, 2007, 1:56:54 AM (16 years ago)
Author:
Argimiro Resende Secchi
Message:

Fix some new language syntax.

Location:
branches/newlanguage/sample
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • branches/newlanguage/sample/miscellaneous/sample_arrays.mso

    r125 r176  
    3131        EQUATIONS
    3232        for i in [1 : Dimension]
    33                 diff(Var1(1,i)) = Var2(1,i)/"s";
     33                diff(Var1(1,i)) = Var2(1,i)/'s';
    3434        end
    3535
    36         diff(Var1(2:Dimension,:)) * "s" = Scalar*Var2(2:Dimension,:);
     36        diff(Var1(2:Dimension,:)) * 's' = Scalar*Var2(2:Dimension,:);
    3737
    38         exp(Scalar)*Var2 = sin(time * "180*grad/s");
     38        exp(Scalar)*Var2 = sin(time * '180*grad/s');
    3939end
    4040
  • branches/newlanguage/sample/miscellaneous/sample_arrays2.mso

    r83 r176  
    3030        EQUATIONS
    3131
    32         diff(Var1(1,1))*"s" = Var2(1,2);
     32        diff(Var1(1,1))*'s' = Var2(1,2);
    3333       
    3434        for i in [2 : Dimension-1]
    35                 diff(Var1(1,i))*"s" = Var2(1,i-1)+Var2(1,i+1);
     35                diff(Var1(1,i))*'s' = Var2(1,i-1)+Var2(1,i+1);
    3636        end
    3737
    38         diff(Var1(1,Dimension))*"s" = Var2(1,Dimension);
    39         diff(Var1(2:Dimension,:))*"s" = Scalar*Var2(2:Dimension,:);
     38        diff(Var1(1,Dimension))*'s' = Var2(1,Dimension);
     39        diff(Var1(2:Dimension,:))*'s' = Scalar*Var2(2:Dimension,:);
    4040
    41         exp(Scalar)*Var2 = sin(time/"s");
     41        exp(Scalar)*Var2 = sin(time*'rad/s');
    4242end
    4343
     
    5151
    5252        OPTIONS
    53         time = [0:0.1:2*3.1415];
     53        TimeStep = 0.1;
     54        TimeEnd = 2*3.1415;
    5455end
  • branches/newlanguage/sample/miscellaneous/sample_bc.mso

    r83 r176  
    4747        EQUATIONS
    4848                "Balanço no Prato 0"
    49                 diff(H0)*"s" = -V/(R+1);
    50                 diff(x1(1))*"s" = V/H0 * (x1(1)-y1(1) + R * ((x1(2) - x1(1))/(R+1)));
     49                diff(H0)*'s' = -V/(R+1);
     50                diff(x1(1))*'s' = V/H0 * (x1(1)-y1(1) + R * ((x1(2) - x1(1))/(R+1)));
    5151       
    5252                "Balanço demais pratos"
    53                 diff(x1(2:Np))*"s" = V/Hi * (y1(1:Np-1) - y1(2:Np) + (R * ( x1(3:Np+1) - x1(2:Np) ) / (R+1)));
     53                diff(x1(2:Np))*'s' = V/Hi * (y1(1:Np-1) - y1(2:Np) + (R * ( x1(3:Np+1) - x1(2:Np) ) / (R+1)));
    5454
    5555                "Balanço último prato"
    56                 diff(x1(Np+1))*"s" = V * ( y1(Np) - x1(Np+1) )/Hi;
     56                diff(x1(Np+1))*'s' = V * ( y1(Np) - x1(Np+1) )/Hi;
    5757
    5858                x1  = 1 - x2;
     
    8686
    8787        OPTIONS
    88                 time = [0:0.01:0.1, 0.2:0.1:2.1];
    89                 integration = "index0"; #original, index0 or index 1
    90                 relativeAccuracy = 1e-6;
    91                 absoluteAccuracy = 1e-8;
     88                #time = [0:0.01:0.1, 0.2:0.1:2.1];
     89                TimeStep = 0.01;
     90                TimeEnd = 2.1;
     91                #integration = "index0"; #original, index0 or index 1
     92                RelativeAccuracy = 1e-6;
     93                AbsoluteAccuracy = 1e-8;
    9294                DAESolver = "dasslc"; # "mebdf"
    9395end
  • branches/newlanguage/sample/miscellaneous/sample_calc_object.mso

    r83 r176  
    2828Model CalcBasic
    2929        PARAMETERS
    30 ext NoComps as Integer;
     30outer NoComps as Integer;
    3131        VARIABLES
    3232        T    as temperature;
     
    3434        z(NoComps) as fraction;
    3535       
    36         r1 as Real(Unit="K*K");
    37         r2 as Real(Unit="atm*K");
     36        r1 as Real(Unit='K*K');
     37        r2 as Real(Unit='atm*K');
    3838        r3 as Real;
    3939end
     
    4545Model Calc as CalcBasic
    4646        PARAMETERS
    47 ext     obj as CalcObject;
     47outer obj as Plugin;
    4848
    4949        EQUATIONS
     
    7676FlowSheet CalcTest
    7777        PARAMETERS
    78         obj     as CalcObject(File = "calcsample");
     78        obj     as Plugin(File = "calcsample");
    7979        NoComps as Integer(Default = 5);
    8080       
     
    8484       
    8585        SPECIFY
    86         #calc1.T = 100 * "K";
    87         #calc1.P = 100 * "Pa";
     86        #calc1.T = 100 * 'K';
     87        #calc1.P = 100 * 'Pa';
    8888        calc1.z(1:NoComps-1) = 1/NoComps;
    89         calc1.r1 = 20000 * "K*K";
    90         calc1.r2 = 10000 * "Pa*K";
     89        calc1.r1 = 20000 * 'K*K';
     90        calc1.r2 = 10000 * 'Pa*K';
    9191        calc1.r3 = 1;
    9292       
    93         #calc2.T = 100 * "K";
    94         #calc2.P = 100 * "Pa";
     93        #calc2.T = 100 * 'K';
     94        #calc2.P = 100 * 'Pa';
    9595        calc2.z(1:NoComps-1) = 1/NoComps;
    96         calc2.r1 = 20000 * "K*K";
    97         calc2.r2 = 10000 * "Pa*K";
     96        calc2.r1 = 20000 * 'K*K';
     97        calc2.r2 = 10000 * 'Pa*K';
    9898        calc2.r3 = 1;
    9999
    100100        OPTIONS
    101         relativeAccuracy = 1e-6;
     101        RelativeAccuracy = 1e-6;
    102102        #mode = "steady";
    103103end
     
    116116       
    117117        SPECIFY
    118         #calc2.T = 100 * "K";
    119         #calc2.P = 100 * "Pa";
     118        #calc2.T = 100 * 'K';
     119        #calc2.P = 100 * 'Pa';
    120120        calc2.z(1:NoComps-1) = 1/NoComps;
    121         calc2.r1 = 20000 * "K*K";
    122         calc2.r2 = 10000 * "Pa*K";
     121        calc2.r1 = 20000 * 'K*K';
     122        calc2.r2 = 10000 * 'Pa*K';
    123123        calc2.r3 = 1;
    124124       
    125125        OPTIONS
    126         relativeAccuracy = 1e-6;
    127         mode = "steady";
     126        RelativeAccuracy = 1e-6;
     127        Dynamic = false;
    128128end
    129 
  • branches/newlanguage/sample/miscellaneous/sample_car.mso

    r83 r176  
    8383       
    8484        OPTIONS
    85         time = [0:0.01:3];
    86         integration = "index0"; # "original";
     85        TimeStart = 0;
     86        TimeStep = 0.01;
     87        TimeEnd = 3;
     88        #integration = "index0"; # "original";
    8789        #DAESolver = "mebdf";
    8890
    89         relativeAccuracy = 1e-5;
    90         absoluteAccuracy = 1e-5;
    91         indVarAccuracy = 1e-3;
     91        RelativeAccuracy = 1e-5;
     92        AbsoluteAccuracy = 1e-5;
     93        #indVarAccuracy = 1e-3;
    9294end
  • branches/newlanguage/sample/miscellaneous/sample_cstr_simple.mso

    r83 r176  
    3636        k0 as frequency;
    3737        Ea as energy_mol (Brief = "Energia de Ativação");
    38         R  as energy_mol;
     38        R  as entr_mol;
    3939       
    4040        VARIABLES
     
    4848        rA as reaction_mol;
    4949        rB as reaction_mol;
    50         Cps as cp_mol; # (Unit="cal/mol/K");
     50        Cps as cp_mol; # (Unit='cal/mol/K');
    5151        T0 as temperature;
    5252       
     
    5757       
    5858        "Constante de Reação"
    59         k=k0*exp(Ea/R*(1/436.15 - 1*"K"/T));
     59        k=k0*exp(Ea/R*(1/(436.15*'K') - 1/T));
    6060       
    6161        "Taxas de Reação"
     
    6464       
    6565        "Calor de Reação"
    66         HR=-(80*250)*"cal/mol";
     66        HR=-(80*250)*'cal/mol';
    6767       
    6868        "Cp da mistura"
    69         Cps=(0.5*250)*3;# *"cal/mol/K";
     69        Cps=(0.5*250)*3*'J/mol/K';
    7070       
    7171        "Balanço de Energia"
     
    8282       
    8383        "Temperatura da corrente de alimentação"
    84         T0= (40 + 273.15 + time*200/1000/"s") * "K";
     84        T0= (40 + 273.15 + time*200/1000/'s') * 'K';
    8585       
    8686        SET
    87         Fin = 0.125997903*"m^3/h";
    88         Fout = 0.125997903*"m^3/h";
    89         CA0=9.3652352*"mol/m^3";
    90         CB0=0*"mol/m^3";
     87        Fin = 0.125997903*'m^3/h';
     88        Fout = 0.125997903*'m^3/h';
     89        CA0=9.3652352*'mol/m^3';
     90        CB0=0*'mol/m^3';
    9191        FA0 = Fin*CA0;
    9292        FB0 = Fin*CB0;
    93         Tw = (140+273)*"K";
    94         k0=0.8*"1/h"; #constante para T=436.15 K
    95         Ea=28960*"cal/mol";
    96         R=1.98*"cal/mol/K";
    97         U = 0 *"cal/m^2/K/s";#isolado
    98         A = 1*"m^2";
     93        Tw = (140+273)*'K';
     94        k0=0.8*'1/h'; #constante para T=436.15 K
     95        Ea=28960*'cal/mol';
     96        R=1.98*'cal/mol/K';
     97        U = 0 *'cal/m^2/K/s';#isolado
     98        A = 1*'m^2';
    9999       
    100100        INITIAL
    101         T = (140 + 273) * "K";
    102         V = 0.9*6*"m^3";
    103         CA = 2*"mol/m^3";
    104         CB = 6*"mol/m^3";
     101        T = (140 + 273) * 'K';
     102        V = 0.9*6*'m^3';
     103        CA = 2*'mol/m^3';
     104        CB = 6*'mol/m^3';
    105105       
    106106        OPTIONS
    107         time = [0:10:1200];
     107        TimeStep = 10;
     108        TimeEnd = 1200;
    108109end
  • branches/newlanguage/sample/stage_separators/sample_flash.mso

    r124 r176  
    4949       
    5050        EQUATIONS
    51         fl.OutletL.F = 400*sqrt(fl.Level/"m") * "kmol/h";
     51        fl.OutletL.F = 400*sqrt(fl.Level/'m') * 'kmol/h';
    5252       
    5353        SPECIFY
    54         s1.Outlet.F = 496.3 * "kmol/h";
    55         s1.Outlet.T = 338 * "K";
    56         s1.Outlet.P = 507.1 * "kPa";
     54        s1.Outlet.F = 496.3 * 'kmol/h';
     55        s1.Outlet.T = 338 * 'K';
     56        s1.Outlet.P = 507.1 * 'kPa';
    5757        #s1.Outlet.v = 0.1380;
    5858        s1.Outlet.z = [0.2379,0.3082,0.09958,0.1373,0.08872,0.1283];
    5959
    60         fl.OutletV.F = 68.5 * "kmol/h";
    61         Q = 0 * "kJ/h";
     60        fl.OutletV.F = 68.5 * 'kmol/h';
     61        Q = 0 * 'kJ/h';
    6262       
    6363        SET
    64         fl.V = 2000 * "m^3";
    65         fl.Across = 1 * "m^2";
     64        fl.V = 2000 * 'm^3';
     65        fl.Across = 1 * 'm^2';
    6666       
    6767        INITIAL
    68         fl.OutletL.T = 338 *"K";
    69         fl.Level = 1 * "m";
     68        fl.OutletL.T = 338 * 'K';
     69        fl.Level = 1 * 'm';
    7070
    7171        fl.OutletL.z(1) = 0.1;
     
    8181        TimeStep = 0.1;
    8282        TimeEnd = 20;
    83         TimeUnit = "h";
     83        TimeUnit = 'h';
    8484end
    8585
     
    108108       
    109109        SPECIFY
    110         s1.Outlet.F = 496.3 * "kmol/h";
    111         s1.Outlet.T = 338 * "K";
    112         s1.Outlet.P = 507.1 * "kPa";
     110        s1.Outlet.F = 496.3 * 'kmol/h';
     111        s1.Outlet.T = 338 * 'K';
     112        s1.Outlet.P = 507.1 * 'kPa';
    113113        #s1.Outlet.v = 0.1380;
    114114        s1.Outlet.z = [0.2379,0.3082,0.09959,0.1373,0.08872,0.1283];
    115115       
    116         fl.OutletL.P = 2.5 * "atm";
     116        fl.OutletL.P = 2.5 * 'atm';
    117117
    118         #Q = 0 * "kJ/h";
    119         fl.OutletL.T = 315.06 * "K";
     118        #Q = 0 * 'kJ/h';
     119        fl.OutletL.T = 315.06 * 'K';
    120120       
    121121        OPTIONS
Note: See TracChangeset for help on using the changeset viewer.