/[ascend]/trunk/models/simpleflowsheet01cost.a4c
ViewVC logotype

Contents of /trunk/models/simpleflowsheet01cost.a4c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 793 - (show annotations) (download) (as text)
Thu Jul 27 14:14:47 2006 UTC (13 years, 3 months ago) by johnpye
File MIME type: text/x-ascend
File size: 3253 byte(s)
Updated simpleflowsheet01cost for easy running/testing with PyGTK interface.
1 REQUIRE "simpleflowsheet01mass.a4c";
2 REQUIRE "guthriecosts.a4l";
3
4 (* simpleflowsheet01cost.a4c
5 by Arthur W. Westerberg
6
7 ASCEND modelling environment
8 Copyright (C) 1998 Carnegie Mellon University
9
10 This program is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 2, or (at your option)
13 any later version.
14
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 59 Temple Place - Suite 330,
23 Boston, MA 02111-1307, USA.
24 *)
25
26 ATOM cash_flow REFINES cost_per_time;
27 lower_bound := -1.0e50 {USD/min};
28 nominal := 1.0 {USD/s};
29 END cash_flow;
30
31
32 MODEL simpleflowsheet01cost;
33
34 tc IS_A test_controller;
35 cm1,cr1,cfl1 IS_A simple_pressure_vessel_cost;
36
37 feed_cost,bleed_value, product_value, annual_profit,
38 annual_investment_cost IS_A cash_flow;
39
40 price[tc.fs.m1.out.components],
41 fuel_price IS_A cost_per_mass;
42 payout_time IS_A time;
43
44
45 tc.fs.m1.feed[1], tc.fs.m1.out, tc.fs.r1.out, tc.fs.fl1.liq,
46 tc.fs.fl1.vap, tc.fs.sp1.out[1..2]
47 IS_REFINED_TO mod_stream;
48
49
50 cm1.gc.ci, cr1.gc.ci, cfl1.gc.ci ARE_THE_SAME;
51 cm1.vol_flow, tc.fs.m1.out.Vtot_liq ARE_THE_SAME;
52 cr1.vol_flow, tc.fs.r1.feed.Vtot_liq ARE_THE_SAME;
53
54 cfl1.vol_flow, tc.fs.fl1.feed.Vtot_liq ARE_THE_SAME;
55
56 annual_investment_cost = (cm1.installed_cost + cr1.installed_cost
57 + cfl1.installed_cost)/payout_time;
58
59 feed_cost = price['B']*tc.fs.m1.feed[1].w['B']
60 *tc.fs.m1.feed[1].state.yw['B'];
61
62 bleed_value = fuel_price*tc.fs.sp1.out[1].Wtot;
63
64 product_value = price['C']*tc.fs.fl1.liq.w['C']
65 *tc.fs.fl1.liq.state.yw['C'];
66
67 annual_profit = product_value+bleed_value-feed_cost
68 -annual_investment_cost;
69
70 MAXIMIZE annual_profit;
71
72 METHODS
73
74 METHOD default_self;
75 END default_self;
76
77 METHOD specify;
78 RUN tc.specify;
79 RUN cm1.specify;
80 RUN cr1.specify;
81 RUN cfl1.specify;
82
83 FREE cm1.vol_flow;
84 FREE cr1.vol_flow;
85 FREE cfl1.vol_flow;
86
87 FIX price[tc.fs.m1.out.components];
88 FIX fuel_price;
89 FIX payout_time;
90 END specify;
91
92 METHOD reset;
93 RUN ClearAll;
94 RUN specify;
95 END reset;
96
97 METHOD values;
98
99 RUN tc.values;
100
101 payout_time.nominal := 2{yr};
102 price['A'] := 0.15{USD/lbm};
103 price['B'] := 0.15{USD/lbm};
104 price['C'] := 0.30{USD/lbm};
105
106 fuel_price := 0.1 {USD/lbm};
107 payout_time := 3 {yr};
108
109 cm1.gc.ci.MandSindex := 990.8;
110 cm1.gc.ci.Fp := 1.0;
111 cm1.gc.ci.Fm := 1.0;
112
113 cm1.H_to_D := 2.0;
114 cm1.liq_holdup_time := 10{s};
115 cr1.H_to_D := 2.0;
116 cr1.liq_holdup_time := 10{s};
117 cfl1.H_to_D := 2.0;
118 cfl1.liq_holdup_time := 10{s};
119
120 END values;
121
122 METHOD on_load;
123 RUN default_self;
124 RUN reset;
125 RUN values;
126 END on_load;
127
128 METHOD self_test;
129 ASSERT abs(annual_investment_cost - 1204344{USD/yr}) < 1 {USD/yr};
130 ASSERT abs(annual_profit - -38963990{USD/yr}) < 1 {USD/yr};
131 ASSERT abs(product_value - 72187780{USD/yr}) < 1 {USD/yr};
132 END self_test;
133
134 END simpleflowsheet01cost;

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22