Post Reply 
Syntax error at compiling.
09-30-2015, 03:19 PM
Post: #1
Syntax error at compiling.
Hello,

I don't get "compiled" this code.

Error comes at -2.63963146312685E+15
^ syntax error

I dont understand why.

Please can someone take a look.

Cheers Jan

[codeEXPORT Steam()
BEGIN

END;



EXPORT p2_hs(h, s)
BEGIN
LOCAL sub_reg,Ii,Ji,ni,Pi;
LOCAL eta,Sigma,teta,i;
//Supplementary Release on Backward Equations for Pressure as a function of Enthalpy and Entropy p(h,s) to the IAPWS Industrial formulation 1997 for the Thermodynamic Properties of Water and Steam
//Chapter 6:Backward Equations p(h,s) for Region 2
IF h < (-3498.98083432139 + 2575.60716905876 * s - 421.073558227969 * s ^ 2 + 27.6349063799944 * s ^ 3) THEN
sub_reg := 1;
ELSE
IF s < 5.85 THEN
sub_reg := 3;
ELSE
sub_reg := 2;
END;
END;
//case 1
IF sub_reg ==1 THEN
//Subregion A
//Table 6, Eq 3, page 8
Ii := {0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 3, 3, 3, 3, 3, 4, 5, 5, 6, 7};
Ji := {1, 3, 6, 16, 20, 22, 0, 1, 2, 3, 5, 6, 10, 16, 20, 22, 3, 16, 20, 0, 2, 3, 6, 16, 16, 3, 16, 3, 1};
ni := {-1.82575361923032E-02, -0.125229548799536, 0.592290437320145, 6.04769706185122, 238.624965444474, -298.639090222922, 0.051225081304075, -0.437266515606486, 0.413336902999504, -5.16468254574773, -5.57014838445711, 12.8555037824478, 11.414410895329, -119.504225652714, -2847.7798596156, 4317.57846408006, 1.1289404080265, 1974.09186206319, 1516.12444706087, 1.41324451421235E-02, 0.585501282219601, -2.97258075863012, 5.94567314847319, -6236.56565798905, 9659.86235133332, 6.81500934948134, -6332.07286824489, -5.5891922446576, 4.00645798472063E-02};
eta := h / 4200;
Sigma := s / 12;
Pi := 0;
FOR i FROM 1 TO 29 DO
Pi := Pi + ni(i) * (eta - 0.5) ^ Ii(i) * (Sigma - 1.2) ^ Ji(i);
END;
RETURN Pi ^ 4 * 4;
END;
//case 2
IF sub_reg ==2 THEN
//Subregion B
//Table 7, Eq 4, page 9
Ii := {0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 5, 5, 6, 6, 6, 7, 7, 8, 8, 8, 8, 12, 14};
Ji := {0, 1, 2, 4, 8, 0, 1, 2, 3, 5, 12, 1, 6, 18, 0, 1, 7, 12, 1, 16, 1, 12, 1, 8, 18, 1, 16, 1, 3, 14, 18, 10, 16};
ni := {8.01496989929495E-02, -0.543862807146111, 0.337455597421283, 8.9055545115745, 313.840736431485, 0.797367065977789, -1.2161697355624, 8.72803386937477, -16.9769781757602, -186.552827328416, 95115.9274344237, -18.9168510120494, -4334.0703719484, 543212633.012715, 0.144793408386013, 128.024559637516, -67230.9534071268, 33697238.0095287, -586.63419676272, -22140322476.9889, 1716.06668708389, -570817595.806302, -3121.09693178482, -2078413.8463301, 3056059461577.86, 3221.57004314333, 326810259797.295, -1441.04158934487, 410.694867802691, 109077066873.024, -24796465425889.3, 1888019068.65134, -123651009018773};
eta := h / 4100;
Sigma := s / 7.9;
Pi := 0;
FOR i FROM 1 TO 33 DO
Pi := Pi + ni(i) * (eta - 0.6) ^ Ii(i) * (Sigma - 1.01) ^ Ji(i);
END;
RETURN Pi ^ 4 * 100;
END;
IF sub_reg ==3 THEN
//otherwise
//Subregion C
//Table 8, Eq 5, page 10
Ii := {0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 5, 5, 5, 5, 6, 6, 10, 12, 16};
Ji := {0, 1, 2, 3, 4, 8, 0, 2, 5, 8, 14, 2, 3, 7, 10, 18, 0, 5, 8, 16, 18, 18, 1, 4, 6, 14, 8, 18, 7, 7, 10};
ni := {0.112225607199012, -3.39005953606712, -32.0503911730094, -197.5973051049, -407.693861553446, 13294.3775222331, 1.70846839774007, 37.3694198142245, 3581.44365815434, 423014.446424664, -751071025.760063, 52.3446127607898, -228.351290812417, -960652.417056937, -80705929.2526074, 1626980172256.69, 0.772465073604171, 46392.9973837746, -13731788.5134128, 1704703926305.12, -25110462818730.8, 31774883083552, 53.8685623675312, -55308.9094625169, -1028615.22421405, 2042494187562.34, 273918446.626977,-2.63963146312685E+15, -1078908541.08088, -29649262098.0124, -1.11754907323424E+15};
eta := h / 3500;
Sigma := s / 5.9;
Pi := 0;
FOR i FROM 1 to 31 DO
Pi := Pi + ni(i) * (eta - 0.7) ^ Ii(i) * (Sigma - 1.1) ^ Ji(i);
END;
RETURN Pi ^ 4 * 100;
END:
END;[/code]
Find all posts by this user
Quote this message in a reply
09-30-2015, 03:28 PM
Post: #2
RE: Syntax error at compiling.
Code:
END:

at the end, instead of

Code:
END;

but haven't checked if that is the only error.

My website: erwin.ried.cl
Visit this user's website Find all posts by this user
Quote this message in a reply
09-30-2015, 03:34 PM
Post: #3
RE: Syntax error at compiling.
It's the E+15 exponents... drop the + sign: E15. Also the END: needs to be changed to END;

-Dale-
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)