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

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 786 by johnpye, Wed Jul 26 15:04:32 2006 UTC revision 788 by johnpye, Thu Jul 27 03:17:54 2006 UTC
# Line 2  REQUIRE "atoms.a4l"; Line 2  REQUIRE "atoms.a4l";
2    
3  MODEL testconopt;  MODEL testconopt;
4      Profit, Inp, Out IS_A solver_var;      Profit, Inp, Out IS_A solver_var;
5      P, L, K IS_A solver_var;      P, L IS_A solver_var;
6    
7        K IS_A real_constant;
8      Al, Ak, Ainp, Rho IS_A real_constant;      Al, Ak, Ainp, Rho IS_A real_constant;
9      Pinp, P0, D IS_A real_constant;      Pinp, P0, D IS_A real_constant;
10      W, L0, K0 IS_A real_constant;      W, L0, K0 IS_A real_constant;
11    
12      Out = ( Al*L^(-Rho) + Ak*K^(-Rho) + Ainp*Inp^(-Rho) )^(-1/Rho);      cesfn: Out = ( Al*L^(-Rho) + Ak*K^(-Rho) + Ainp*Inp^(-Rho) )^(-1/Rho);
13    
14      Out = ( P0 - P ) / D;      demandfn: Out = ( P0 - P ) / D;
   
     L0 < L;  
     K = K0;  
     0 <= P;  
     0 < Out;  
     0 < Inp;  
15    
16      W :== 1.0;      W :== 1.0;
17      L0 :== 0.1;      L0 :== 0.1;
# Line 28  MODEL testconopt; Line 23  MODEL testconopt;
23      K0 :== 4.0;      K0 :== 4.0;
24      P0 :== 2.0;      P0 :== 2.0;
25      D :== 0.5;      D :== 0.5;
26        K :== K0;
27    
28      Profit = P*Out - (L-L0)*W - Inp*Pinp;      profitfn: Profit = P*Out - (L-L0)*W - Inp*Pinp;
29        maxprofit: MAXIMIZE Profit;
30    
31  METHODS  METHODS
32    
# Line 40  METHOD specify; Line 37  METHOD specify;
37  END specify;  END specify;
38    
39  METHOD values;  METHOD values;
40        L.lower_bound := L0;
41        P.lower_bound := 0;
42        Out.lower_bound := 0;
43        Inp.lower_bound := 0;
44  END values;  END values;
45    
46  METHOD on_load;  METHOD on_load;
# Line 49  METHOD on_load; Line 50  METHOD on_load;
50  END on_load;  END on_load;
51    
52  METHOD self_test;  METHOD self_test;
53      ASSERT L = 0.295686;      ASSERT abs(L - 0.295686) < 0.000001;
54      ASSERT Inp = 0.295686;      ASSERT abs(Inp - 0.295686) < 0.000001;
55      ASSERT Out = 0.632019;      ASSERT abs(Out - 0.632019) < 0.000001;
56      ASSERT P = 1.683990;          ASSERT abs(P - 1.683990) < 0.000001;    
57  END self_test;  END self_test;
58    
59  END testconopt;  END testconopt;

Legend:
Removed from v.786  
changed lines
  Added in v.788

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