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; |
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 |
|
|
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; |
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; |