Ticket #3628: TransformationSubstituted.mo

File TransformationSubstituted.mo, 3.3 KB (added by anonymous, 9 years ago)
Line 
1class Transformation
2 parameter Real h(min = 0.0) = 1.78;
3 Real alv_pC3(min = 0.0);
4 Real bRC_buency(nominal = 15.0);
5 Real bRC_pC3_bean(min = 0.0);
6 Real bRC_da(min = -100.0);
7 parameter Real bRC_b_min(nominal = 15.0) = 10.0;
8 parameter Real bRC_b_max(nominal = 15.0) = 70.0;
9 parameter Real bRC_pC3_ref(min = 0.0) = 36.0;
10 parameter Real bRC_slp = 3.0;
11 parameter Real bRC_aFD(nominal = 15.0) = 0.5 * (bRC_b_max - bRC_b_min);
12 Real bAC_pam;
13 parameter Real bAC_m = 0.123502703;
14 parameter Real bAC_c = -0.654054054054054;
15 Real d_P_xm;
16 Real P_stoma;
17 Real ruralP;
18 constant Real d_P_LO = 4.5;
19 Real d_bO_xm;
20 Real d_dM_a_P;
21 Real d_dM_b_P;
22 Real d_dM_a_P;
23 Real d_dM_D;
24 parameter Real d_dM_k_sc = 2.5;
25 parameter Real d_dM_b_sd = 0.0;
26 Real d_dW_P;
27 Real d_bO_a_P;
28 Real bRC_buency(nominal = 15.0);
29 Real bAC_pam;
30 Real d_bO_x;
31 Real d_bO_y;
32 Real stoma_aP_q;
33 parameter Real stoma_c_co2 = 0.0;
34 Real alv_q;
35 Real alv_C3_skon(min = 0.0);
36 Real alv_V;
37 Real alv_mF_2;
38 Real alv_P;
39 parameter Real alv_T = 310.0;
40 Real alv_q;
41 Real alv_C3_mnt(min = 0.0, stateSelect = StateSelect.prefer);
42 Real alv_C3_skon(min = 0.0);
43 Real alv_pC3(min = 0.0);
44 parameter Real alv_V_0 = 0.0;
45 parameter Real alv_long = 2.5;
46 Real ruralP;
47 Real P_stoma;
48 Real alv_convMtL;
49 Real wear_i_q;
50 Real wear_C3_skon(min = 0.0);
51 Real alv_P;
52 Real wear_o_q;
53 Real wear_C3_skon(min = 0.0);
54 Real wear_mFIn_2;
55 Real wear_mFOut_2;
56 parameter Real wear_V = 7.585e-07 * (100.0 * h) ^ 2.363;
57 Real wear_C3_mnt(min = 0.0, stateSelect = StateSelect.prefer);
58 Real wear_C3_skon(min = 0.0);
59 parameter Real wear_R = 1.0;
60initial equation
61 bRC_pC3_bean = 30.9228008845;
62 wear_C3_mnt = 0.000173999146152;
63 alv_C3_mnt = 0.00238983232409;
64 alv_P = 759.725958311;
65 d_bO_x = 0.885821623007;
66 d_bO_y = -0.459753330157;
67equation
68 der(bRC_pC3_bean) = (if noEvent(alv_pC3 - bRC_pC3_bean > 0.0) then 0.9 else 0.05) * (alv_pC3 - bRC_pC3_bean);
69 bRC_da = bRC_pC3_bean - bRC_pC3_ref;
70 bRC_buency = bRC_aFD * (1.0 + tanh(bRC_slp * bRC_da / 6.283185307179586)) + bRC_b_min;
71 bAC_pam = bAC_m * bRC_buency + bAC_c;
72 /*d_dM_a_P = (-d_dM_k_sc) * d_dM_D - d_dM_b_sd * der(d_dM_D);*/
73 d_dM_a_P = (-d_dM_k_sc) * d_dM_D - 0.0 * der(d_dM_D);
74 d_dM_a_P + d_dM_b_P = 0.0;
75 d_dM_D = d_bO_xm - 0.0;
76 der(d_bO_x) = -0.1047197551196598 * bRC_buency * d_bO_y;
77 der(d_bO_y) = 0.1047197551196598 * bRC_buency * d_bO_x;
78 d_bO_xm = 0.5 * d_bO_y * bAC_pam;
79 d_P_xm = -d_dW_P;
80 ruralP = -4.5 + P_stoma - d_P_xm;
81 wear_mFIn_2 = smooth(0, smooth(0, if wear_i_q > 0.0 then stoma_c_co2 else wear_C3_skon) * wear_i_q);
82 wear_mFOut_2 = smooth(0, smooth(0, if wear_o_q > 0.0 then alv_C3_skon else wear_C3_skon) * wear_o_q);
83 wear_C3_skon = wear_C3_mnt / wear_V;
84 der(wear_C3_mnt) = wear_mFIn_2 + wear_mFOut_2;
85 wear_i_q = (P_stoma - alv_P) / wear_R;
86 wear_i_q + wear_o_q = 0.0;
87 alv_mF_2 = smooth(0, smooth(0, if alv_q > 0.0 then wear_C3_skon else alv_C3_skon) * alv_q);
88 alv_C3_skon = alv_C3_mnt / alv_V;
89 der(alv_C3_mnt) = alv_mF_2;
90 alv_convMtL = 62.36367 * alv_T / alv_P;
91 alv_V = (alv_P - ruralP) / alv_long + alv_V_0;
92 der(alv_P) = P_stoma * alv_long * alv_q / alv_P + der(ruralP);
93 alv_pC3 = 62.36367 * alv_C3_mnt * alv_T / alv_V;
94 d_dM_a_P + d_bO_a_P = 0.0;
95 d_dM_b_P + d_dW_P = 0.0;
96 stoma_aP_q + wear_i_q = 0.0;
97 alv_q + wear_o_q = 0.0;
98 P_stoma = 760.0;
99end Transformation;