source: trunk/sample/miscellaneous/sample_reverse.mso @ 707

Last change on this file since 707 was 707, checked in by Argimiro Resende Secchi, 14 years ago

Adding an example for reverse integration.

File size: 2.2 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* FlowSheet with a bio-reactor based on Monod model.
17*--------------------------------------------------------------------
18* Author: Rafael de Pelegrini Soares
19* $Id: sample_bio.mso 182 2007-03-06 00:02:04Z rafael $
20*--------------------------------------------------------------------*#
21
22using "types";
23
24FlowSheet bio
25        PARAMETERS
26        miMax   as frequency(Brief="Monod parameter", DisplayUnit='1/h');
27        D       as frequency(Brief="Dilution rate F/V", DisplayUnit='1/h');
28        Km      as conc_mass(Brief="Monod parameter", Default=0.12);
29        K1      as inv_conc_mass(Brief="Monod parameter", Default=0.4545);
30        Y       as coefficient(Brief="Yield biomass/substrate", Default=0.4);
31        x2f     as conc_mass(Brief="Substrate feed concentration", Default=4);
32 
33        VARIABLES
34        biomass   as conc_mass (Brief="Biomass concentration");
35        substrate as conc_mass (Brief="Substrate concentration");
36        mi        as frequency (Brief="Specific growth rate", DisplayUnit='1/h');
37       
38        EQUATIONS
39        "Specific growth rate"
40        mi = miMax*substrate/(Km+substrate+(K1*substrate^2));
41       
42        "Biomass production"
43        diff(biomass)/biomass = mi-D;
44       
45        "Substrate consumption"
46        diff(substrate) = D*(x2f-substrate)-(biomass*mi/Y);
47       
48        SET
49        miMax = 0.53  *  '1/h';
50        D      = 0.3  *  '1/h';
51       
52        INITIAL
53        biomass = 1  *  'kg/m^3';
54        substrate = 0.5  *  'kg/m^3';
55 
56        OPTIONS
57        TimeStart = 0;
58        TimeStep = 0.5;
59        TimeEnd = 10;
60        TimeUnit = 'h';
61        InitialFile = "bio"; # use with adjoint=1 and compare with adjoint=0
62#       Linearize = true;
63        SparseAlgebra = true;
64    DAESolver(File = "adjoint", adjoint=1);
65end
Note: See TracBrowser for help on using the repository browser.