source: branches/newlanguage/sample/miscellaneous/tenprobs/prob04.mso @ 220

Last change on this file since 220 was 220, checked in by Rodolfo Rodrigues, 17 years ago

Ten problems of the ASEE. First update.

File size: 2.4 KB
Line 
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* 4. Reaction Equilibrium for Multiple Gas Phase Reactions
17*----------------------------------------------------------------------
18*
19*   Description:
20*      This problem is part of a collection of 10 representative
21*       problems in Chemical Engineering for solution by numerical methods
22*       developed for Cutlip (1998).
23*
24*   Subject:
25*       * Thermodynamics
26*
27*       Numerical method:
28*               * Simultaneous nonlinear equations
29*
30*   Reference:
31*       * CUTLIP et al. A collection of 10 numerical problems in
32*       chemical engineering solved by various mathematical software
33*       packages. Comp. Appl. in Eng. Education. v. 6, 169-180, 1998.
34*       * http://www.polymath-software.com/ASEE
35*
36*----------------------------------------------------------------------
37* Author: Rodolfo Rodrigues
38* $Id$
39*--------------------------------------------------------------------*#
40
41
42
43Model problem
44        PARAMETERS
45        NComp           as Integer      (Brief="Number of components", Lower=1);
46        NReac           as Integer      (Brief="Number of reactions", Default=1);
47       
48        VARIABLES
49        K(NReac)        as Real         (Brief="Equillibrium constant");
50        Co(NComp)       as Real         (Brief="Initial concentration", Lower=-0.001);
51        C(NComp)        as Real         (Brief="Concentration", Lower=-0.001);
52       
53        SET
54        NComp = 7; # A,B,C,D,X,Y,Z
55        NReac = 3;
56       
57        EQUATIONS
58        K(1)*(C(1)*C(2)) = C(3)*C(4);
59        K(2)*(C(2)*C(3)) = C(5)*C(6);
60        K(3)*(C(1)*C(5)) = C(7);
61       
62        C(1) - Co(1) = -C(4) - C(7);
63        C(2) - Co(2) = -C(4) - C(6);
64        C(3) = C(4) - C(6);
65        C(6) = C(5) + C(7);
66end
67
68
69FlowSheet solution
70        DEVICES
71        reac    as problem;
72       
73        SPECIFY
74        reac.Co = [1.5, 1.5, 0, 0, 0, 0, 0];
75        reac.K = [1.06, 2.63, 5];
76       
77        GUESS
78        reac.C(4) = reac.C(5);
79        reac.C(5) = reac.C(7);
80       
81        reac.C(4) = 0;  # (a)   
82#       reac.C(4) = 1;  # (b)
83#       reac.C(4) = 10; # (c)
84       
85        OPTIONS
86        Dynamic = false;
87end
Note: See TracBrowser for help on using the repository browser.