summaryrefslogtreecommitdiff
path: root/Simulator/Flowsheet_14lnz.c
blob: b2737502793d5d06b7247c5fad4143a267d7aff6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/* Linearization */
#include "Flowsheet_model.h"
#if defined(__cplusplus)
extern "C" {
#endif

const char *Flowsheet_linear_model_frame()
{
  return "model linear_Flowsheet\n  parameter Integer n = 0; // states\n  parameter Integer k = 0; // top-level inputs\n  parameter Integer l = 0; // top-level outputs\n"
  "  parameter Real x0[0] = {%s};\n"
  "  parameter Real u0[0] = {%s};\n"
  "  parameter Real A[0,0] = zeros(0,0);%s\n"
  "  parameter Real B[0,0] = zeros(0,0);%s\n"
  "  parameter Real C[0,0] = zeros(0,0);%s\n"
  "  parameter Real D[0,0] = zeros(0,0);%s\n"
  "  Real x[0];\n"
  "  input Real u[0];\n"
  "  output Real y[0];\n"
  "\n  \n"
  "equation\n  der(x) = A * x + B * u;\n  y = C * x + D * u;\nend linear_Flowsheet;\n";
}
const char *Flowsheet_linear_model_datarecovery_frame()
{
  return "model linear_Flowsheet\n  parameter Integer n = 0; // states\n  parameter Integer k = 0; // top-level inputs\n  parameter Integer l = 0; // top-level outputs\n  parameter Integer nz = 187; // data recovery variables\n"
  "  parameter Real x0[0] = {%s};\n"
  "  parameter Real u0[0] = {%s};\n"
  "  parameter Real z0[187] = {%s};\n"
  "  parameter Real A[0,0] = zeros(0,0);%s\n"
  "  parameter Real B[0,0] = zeros(0,0);%s\n"
  "  parameter Real C[0,0] = zeros(0,0);%s\n"
  "  parameter Real D[0,0] = zeros(0,0);%s\n"
  "  parameter Real Cz[187,0] = zeros(187,0);%s\n"
  "  parameter Real Dz[187,0] = zeros(187,0);%s\n"
  "  Real x[0];\n"
  "  input Real u[0];\n"
  "  output Real y[0];\n"
  "  output Real z[187];\n"
  "\nReal 'z_$cse1' = z[1];\nReal 'z_$cse2' = z[2];\nReal 'z_$cse3' = z[3];\nReal 'z_$cse4' = z[4];\nReal 'z_Heater1.Pout' = z[5];\nReal 'z_Heater1.Q' = z[6];\nReal 'z_Heater1.Tdel' = z[7];\nReal 'z_Heater1.Tout' = z[8];\nReal 'z_Heater1.xvapin' = z[9];\nReal 'z_Heater1.xvapout' = z[10];\nReal 'z_MaterialStream1.Cp_p[1]' = z[11];\nReal 'z_MaterialStream1.Cp_p[2]' = z[12];\nReal 'z_MaterialStream1.Cp_p[3]' = z[13];\nReal 'z_MaterialStream1.Cp_pc[1,1]' = z[14];\nReal 'z_MaterialStream1.Cp_pc[1,2]' = z[15];\nReal 'z_MaterialStream1.Cp_pc[2,1]' = z[16];\nReal 'z_MaterialStream1.Cp_pc[2,2]' = z[17];\nReal 'z_MaterialStream1.Cp_pc[3,1]' = z[18];\nReal 'z_MaterialStream1.Cp_pc[3,2]' = z[19];\nReal 'z_MaterialStream1.Cpres_p[1]' = z[20];\nReal 'z_MaterialStream1.Cpres_p[2]' = z[21];\nReal 'z_MaterialStream1.Cpres_p[3]' = z[22];\nReal 'z_MaterialStream1.F_p[1]' = z[23];\nReal 'z_MaterialStream1.F_p[2]' = z[24];\nReal 'z_MaterialStream1.F_p[3]' = z[25];\nReal 'z_MaterialStream1.F_pc[1,1]' = z[26];\nReal 'z_MaterialStream1.F_pc[1,2]' = z[27];\nReal 'z_MaterialStream1.F_pc[2,1]' = z[28];\nReal 'z_MaterialStream1.F_pc[2,2]' = z[29];\nReal 'z_MaterialStream1.F_pc[3,1]' = z[30];\nReal 'z_MaterialStream1.F_pc[3,2]' = z[31];\nReal 'z_MaterialStream1.Fm_p[1]' = z[32];\nReal 'z_MaterialStream1.Fm_p[2]' = z[33];\nReal 'z_MaterialStream1.Fm_p[3]' = z[34];\nReal 'z_MaterialStream1.Fm_pc[1,1]' = z[35];\nReal 'z_MaterialStream1.Fm_pc[1,2]' = z[36];\nReal 'z_MaterialStream1.Fm_pc[2,1]' = z[37];\nReal 'z_MaterialStream1.Fm_pc[2,2]' = z[38];\nReal 'z_MaterialStream1.Fm_pc[3,1]' = z[39];\nReal 'z_MaterialStream1.Fm_pc[3,2]' = z[40];\nReal 'z_MaterialStream1.H_p[1]' = z[41];\nReal 'z_MaterialStream1.H_p[2]' = z[42];\nReal 'z_MaterialStream1.H_p[3]' = z[43];\nReal 'z_MaterialStream1.H_pc[1,1]' = z[44];\nReal 'z_MaterialStream1.H_pc[1,2]' = z[45];\nReal 'z_MaterialStream1.H_pc[2,1]' = z[46];\nReal 'z_MaterialStream1.H_pc[2,2]' = z[47];\nReal 'z_MaterialStream1.H_pc[3,1]' = z[48];\nReal 'z_MaterialStream1.H_pc[3,2]' = z[49];\nReal 'z_MaterialStream1.Hres_p[1]' = z[50];\nReal 'z_MaterialStream1.Hres_p[2]' = z[51];\nReal 'z_MaterialStream1.Hres_p[3]' = z[52];\nReal 'z_MaterialStream1.K_c[1]' = z[53];\nReal 'z_MaterialStream1.K_c[2]' = z[54];\nReal 'z_MaterialStream1.MW_p[1]' = z[55];\nReal 'z_MaterialStream1.MW_p[2]' = z[56];\nReal 'z_MaterialStream1.MW_p[3]' = z[57];\nReal 'z_MaterialStream1.P' = z[58];\nReal 'z_MaterialStream1.Pbubl' = z[59];\nReal 'z_MaterialStream1.Pdew' = z[60];\nReal 'z_MaterialStream1.Pvap_c[1]' = z[61];\nReal 'z_MaterialStream1.Pvap_c[2]' = z[62];\nReal 'z_MaterialStream1.S_p[1]' = z[63];\nReal 'z_MaterialStream1.S_p[2]' = z[64];\nReal 'z_MaterialStream1.S_p[3]' = z[65];\nReal 'z_MaterialStream1.S_pc[1,1]' = z[66];\nReal 'z_MaterialStream1.S_pc[1,2]' = z[67];\nReal 'z_MaterialStream1.S_pc[2,1]' = z[68];\nReal 'z_MaterialStream1.S_pc[2,2]' = z[69];\nReal 'z_MaterialStream1.S_pc[3,1]' = z[70];\nReal 'z_MaterialStream1.S_pc[3,2]' = z[71];\nReal 'z_MaterialStream1.Sres_p[1]' = z[72];\nReal 'z_MaterialStream1.Sres_p[2]' = z[73];\nReal 'z_MaterialStream1.Sres_p[3]' = z[74];\nReal 'z_MaterialStream1.T' = z[75];\nReal 'z_MaterialStream1.gma_c[1]' = z[76];\nReal 'z_MaterialStream1.gma_c[2]' = z[77];\nReal 'z_MaterialStream1.gmabubl_c[1]' = z[78];\nReal 'z_MaterialStream1.gmabubl_c[2]' = z[79];\nReal 'z_MaterialStream1.gmadew_c[1]' = z[80];\nReal 'z_MaterialStream1.gmadew_c[2]' = z[81];\nReal 'z_MaterialStream1.philiqbubl_c[1]' = z[82];\nReal 'z_MaterialStream1.philiqbubl_c[2]' = z[83];\nReal 'z_MaterialStream1.phivapdew_c[1]' = z[84];\nReal 'z_MaterialStream1.phivapdew_c[2]' = z[85];\nReal 'z_MaterialStream1.x_pc[1,1]' = z[86];\nReal 'z_MaterialStream1.x_pc[1,2]' = z[87];\nReal 'z_MaterialStream1.x_pc[2,1]' = z[88];\nReal 'z_MaterialStream1.x_pc[2,2]' = z[89];\nReal 'z_MaterialStream1.x_pc[3,1]' = z[90];\nReal 'z_MaterialStream1.x_pc[3,2]' = z[91];\nReal 'z_MaterialStream1.xliq' = z[92];\nReal 'z_MaterialStream1.xm_pc[1,1]' = z[93];\nReal 'z_MaterialStream1.xm_pc[1,2]' = z[94];\nReal 'z_MaterialStream1.xm_pc[2,1]' = z[95];\nReal 'z_MaterialStream1.xm_pc[2,2]' = z[96];\nReal 'z_MaterialStream1.xm_pc[3,1]' = z[97];\nReal 'z_MaterialStream1.xm_pc[3,2]' = z[98];\nReal 'z_MaterialStream1.xmliq' = z[99];\nReal 'z_MaterialStream1.xmvap' = z[100];\nReal 'z_MaterialStream2.Cp_p[1]' = z[101];\nReal 'z_MaterialStream2.Cp_p[2]' = z[102];\nReal 'z_MaterialStream2.Cp_p[3]' = z[103];\nReal 'z_MaterialStream2.Cp_pc[1,1]' = z[104];\nReal 'z_MaterialStream2.Cp_pc[1,2]' = z[105];\nReal 'z_MaterialStream2.Cp_pc[2,1]' = z[106];\nReal 'z_MaterialStream2.Cp_pc[2,2]' = z[107];\nReal 'z_MaterialStream2.Cp_pc[3,1]' = z[108];\nReal 'z_MaterialStream2.Cp_pc[3,2]' = z[109];\nReal 'z_MaterialStream2.Cpres_p[1]' = z[110];\nReal 'z_MaterialStream2.Cpres_p[2]' = z[111];\nReal 'z_MaterialStream2.Cpres_p[3]' = z[112];\nReal 'z_MaterialStream2.F_p[2]' = z[113];\nReal 'z_MaterialStream2.F_p[3]' = z[114];\nReal 'z_MaterialStream2.F_pc[1,1]' = z[115];\nReal 'z_MaterialStream2.F_pc[1,2]' = z[116];\nReal 'z_MaterialStream2.F_pc[2,1]' = z[117];\nReal 'z_MaterialStream2.F_pc[2,2]' = z[118];\nReal 'z_MaterialStream2.F_pc[3,1]' = z[119];\nReal 'z_MaterialStream2.F_pc[3,2]' = z[120];\nReal 'z_MaterialStream2.Fm_p[1]' = z[121];\nReal 'z_MaterialStream2.Fm_p[2]' = z[122];\nReal 'z_MaterialStream2.Fm_p[3]' = z[123];\nReal 'z_MaterialStream2.Fm_pc[1,1]' = z[124];\nReal 'z_MaterialStream2.Fm_pc[1,2]' = z[125];\nReal 'z_MaterialStream2.Fm_pc[2,1]' = z[126];\nReal 'z_MaterialStream2.Fm_pc[2,2]' = z[127];\nReal 'z_MaterialStream2.Fm_pc[3,1]' = z[128];\nReal 'z_MaterialStream2.Fm_pc[3,2]' = z[129];\nReal 'z_MaterialStream2.H_p[1]' = z[130];\nReal 'z_MaterialStream2.H_p[2]' = z[131];\nReal 'z_MaterialStream2.H_p[3]' = z[132];\nReal 'z_MaterialStream2.H_pc[1,1]' = z[133];\nReal 'z_MaterialStream2.H_pc[1,2]' = z[134];\nReal 'z_MaterialStream2.H_pc[2,1]' = z[135];\nReal 'z_MaterialStream2.H_pc[2,2]' = z[136];\nReal 'z_MaterialStream2.H_pc[3,1]' = z[137];\nReal 'z_MaterialStream2.H_pc[3,2]' = z[138];\nReal 'z_MaterialStream2.Hres_p[1]' = z[139];\nReal 'z_MaterialStream2.Hres_p[2]' = z[140];\nReal 'z_MaterialStream2.Hres_p[3]' = z[141];\nReal 'z_MaterialStream2.K_c[1]' = z[142];\nReal 'z_MaterialStream2.K_c[2]' = z[143];\nReal 'z_MaterialStream2.MW_p[1]' = z[144];\nReal 'z_MaterialStream2.MW_p[2]' = z[145];\nReal 'z_MaterialStream2.MW_p[3]' = z[146];\nReal 'z_MaterialStream2.Pbubl' = z[147];\nReal 'z_MaterialStream2.Pdew' = z[148];\nReal 'z_MaterialStream2.Pvap_c[1]' = z[149];\nReal 'z_MaterialStream2.Pvap_c[2]' = z[150];\nReal 'z_MaterialStream2.S_p[1]' = z[151];\nReal 'z_MaterialStream2.S_p[2]' = z[152];\nReal 'z_MaterialStream2.S_p[3]' = z[153];\nReal 'z_MaterialStream2.S_pc[1,1]' = z[154];\nReal 'z_MaterialStream2.S_pc[1,2]' = z[155];\nReal 'z_MaterialStream2.S_pc[2,1]' = z[156];\nReal 'z_MaterialStream2.S_pc[2,2]' = z[157];\nReal 'z_MaterialStream2.S_pc[3,1]' = z[158];\nReal 'z_MaterialStream2.S_pc[3,2]' = z[159];\nReal 'z_MaterialStream2.Sres_p[1]' = z[160];\nReal 'z_MaterialStream2.Sres_p[2]' = z[161];\nReal 'z_MaterialStream2.Sres_p[3]' = z[162];\nReal 'z_MaterialStream2.gma_c[1]' = z[163];\nReal 'z_MaterialStream2.gma_c[2]' = z[164];\nReal 'z_MaterialStream2.gmabubl_c[1]' = z[165];\nReal 'z_MaterialStream2.gmabubl_c[2]' = z[166];\nReal 'z_MaterialStream2.gmadew_c[1]' = z[167];\nReal 'z_MaterialStream2.gmadew_c[2]' = z[168];\nReal 'z_MaterialStream2.philiqbubl_c[1]' = z[169];\nReal 'z_MaterialStream2.philiqbubl_c[2]' = z[170];\nReal 'z_MaterialStream2.phivapdew_c[1]' = z[171];\nReal 'z_MaterialStream2.phivapdew_c[2]' = z[172];\nReal 'z_MaterialStream2.x_pc[1,1]' = z[173];\nReal 'z_MaterialStream2.x_pc[1,2]' = z[174];\nReal 'z_MaterialStream2.x_pc[2,1]' = z[175];\nReal 'z_MaterialStream2.x_pc[2,2]' = z[176];\nReal 'z_MaterialStream2.x_pc[3,1]' = z[177];\nReal 'z_MaterialStream2.x_pc[3,2]' = z[178];\nReal 'z_MaterialStream2.xliq' = z[179];\nReal 'z_MaterialStream2.xm_pc[1,1]' = z[180];\nReal 'z_MaterialStream2.xm_pc[1,2]' = z[181];\nReal 'z_MaterialStream2.xm_pc[2,1]' = z[182];\nReal 'z_MaterialStream2.xm_pc[2,2]' = z[183];\nReal 'z_MaterialStream2.xm_pc[3,1]' = z[184];\nReal 'z_MaterialStream2.xm_pc[3,2]' = z[185];\nReal 'z_MaterialStream2.xmliq' = z[186];\nReal 'z_MaterialStream2.xmvap' = z[187];\n\n"
  "equation\n  der(x) = A * x + B * u;\n  y = C * x + D * u;\n  z = Cz * x + Dz * u;\nend linear_Flowsheet;\n";
}
#if defined(__cplusplus)
}
#endif