/[ascend]/trunk/models/johnpye/testconopt.a4c
ViewVC logotype

Contents of /trunk/models/johnpye/testconopt.a4c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 786 - (show annotations) (download) (as text)
Wed Jul 26 15:04:32 2006 UTC (18 years, 4 months ago) by johnpye
File MIME type: text/x-ascend
File size: 847 byte(s)
Added a test model for use with CONOPT.
1 REQUIRE "atoms.a4l";
2
3 MODEL testconopt;
4 Profit, Inp, Out IS_A solver_var;
5 P, L, K IS_A solver_var;
6
7 Al, Ak, Ainp, Rho IS_A real_constant;
8 Pinp, P0, D IS_A real_constant;
9 W, L0, K0 IS_A real_constant;
10
11 Out = ( Al*L^(-Rho) + Ak*K^(-Rho) + Ainp*Inp^(-Rho) )^(-1/Rho);
12
13 Out = ( P0 - P ) / D;
14
15 L0 < L;
16 K = K0;
17 0 <= P;
18 0 < Out;
19 0 < Inp;
20
21 W :== 1.0;
22 L0 :== 0.1;
23 Pinp :== 1.0;
24 Al :== 0.16;
25 Ak :== 2.00;
26 Ainp :== 0.16;
27 Rho :== 1.0;
28 K0 :== 4.0;
29 P0 :== 2.0;
30 D :== 0.5;
31
32 Profit = P*Out - (L-L0)*W - Inp*Pinp;
33
34 METHODS
35
36 METHOD default_self;
37 END default_self;
38
39 METHOD specify;
40 END specify;
41
42 METHOD values;
43 END values;
44
45 METHOD on_load;
46 RUN default_self;
47 RUN specify;
48 RUN values;
49 END on_load;
50
51 METHOD self_test;
52 ASSERT L = 0.295686;
53 ASSERT Inp = 0.295686;
54 ASSERT Out = 0.632019;
55 ASSERT P = 1.683990;
56 END self_test;
57
58 END testconopt;

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