1 | #*------------------------------------------------------------------- |
---|
2 | * EMSO Model Library (EML) Copyright (C) 2004 - 2007 ALSOC. |
---|
3 | * |
---|
4 | * This LIBRARY is free software; you can distribute it and/or modify |
---|
5 | * it under the therms of the ALSOC FREE LICENSE as available at |
---|
6 | * http://www.enq.ufrgs.br/alsoc. |
---|
7 | * |
---|
8 | * EMSO Copyright (C) 2004 - 2007 ALSOC, original code |
---|
9 | * from http://www.rps.eng.br Copyright (C) 2002-2004. |
---|
10 | * All rights reserved. |
---|
11 | * |
---|
12 | * EMSO is distributed under the therms of the ALSOC LICENSE as |
---|
13 | * available at http://www.enq.ufrgs.br/alsoc. |
---|
14 | * |
---|
15 | *-------------------------------------------------------------------- |
---|
16 | * Descrição do flowsheet de uma coluna batelada com controle ótimo |
---|
17 | * de composição. |
---|
18 | * Modelo proposto por Logsdson e Biegler. |
---|
19 | * |
---|
20 | *---------------------------------------------------------------------- |
---|
21 | * Author: Rafael de Pelegrini Soares |
---|
22 | * $Id: sample_bc.mso 350 2007-08-26 23:37:51Z arge $ |
---|
23 | *--------------------------------------------------------------------*# |
---|
24 | |
---|
25 | |
---|
26 | Model BatchColumn |
---|
27 | PARAMETERS |
---|
28 | Np as Integer(Brief="Number of Plates"); |
---|
29 | Nc as Integer(Brief="Number of Components"); |
---|
30 | purity as Real; |
---|
31 | Hi as Real; |
---|
32 | A(Nc) as Real; |
---|
33 | B(Nc) as Real; |
---|
34 | C(Nc) as Real; |
---|
35 | P as Real; |
---|
36 | V as Real; |
---|
37 | |
---|
38 | VARIABLES |
---|
39 | H0 as Real(Default=1); |
---|
40 | x1(Np+1) as Real(Default=0.55, Lower = 0, Upper = 1); |
---|
41 | x2(Np+1) as Real(Default=0.45, Lower = 0, Upper = 1); |
---|
42 | y1(Np+1) as Real(Default=0.3, Lower = 0, Upper = 1); |
---|
43 | y2(Np+1) as Real(Default=0.7, Lower = 0, Upper = 1); |
---|
44 | T(Np+1) as Real(Default=85, Lower = 0, Upper = 400); |
---|
45 | R as Real(Default=1); |
---|
46 | |
---|
47 | EQUATIONS |
---|
48 | "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))); |
---|
51 | |
---|
52 | "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))); |
---|
54 | |
---|
55 | "Balanço último prato" |
---|
56 | diff(x1(Np+1))*'s' = V * ( y1(Np) - x1(Np+1) )/Hi; |
---|
57 | |
---|
58 | x1 = 1 - x2; |
---|
59 | y1*P = x1 * exp(A(1) - (B(1)/(T + 273.15 + C(1))) ); |
---|
60 | y1 = 1 - y2; |
---|
61 | y2*P = x2 * exp(A(2) - (B(2)/(T + 273.15 + C(2))) ); |
---|
62 | |
---|
63 | "Equação de Controle Ótimo" |
---|
64 | x1(Np+1) = purity; |
---|
65 | |
---|
66 | INITIAL |
---|
67 | H0 = 100; |
---|
68 | x1(1) = 0.55; |
---|
69 | T(2:9) = [89.8, 87.5, 85.4, 83.8, 82.6, 81.7, 81.1, 81.0]; |
---|
70 | R = 1; |
---|
71 | end |
---|
72 | |
---|
73 | FlowSheet batch as BatchColumn |
---|
74 | SET |
---|
75 | Nc = 2; |
---|
76 | Np = 11; |
---|
77 | |
---|
78 | A = [15.7527, 16.0137]; |
---|
79 | B = [2766.63, 3096.52]; |
---|
80 | C = [ -50.5, -53.67]; |
---|
81 | |
---|
82 | purity = 0.998; |
---|
83 | P = 760; |
---|
84 | Hi = 1; |
---|
85 | V = 120; |
---|
86 | |
---|
87 | OPTIONS |
---|
88 | TimeStep = 0.01; |
---|
89 | TimeEnd = 2.1; |
---|
90 | Integration = "original"; #original, index0 or index 1 |
---|
91 | DAESolver( |
---|
92 | File = "dasslc" # "mebdf" |
---|
93 | ); |
---|
94 | end |
---|
95 | |
---|