1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- # CLEAR MEMORY
- reset ;
- # LOAD MODEL
- model 'bath_exp.mod' ;
- # LOAD DATA
- data 'bath_exp.dat' ;
- # Approximation grid
-
- let q := q0 + 1;
- param dL := L / q0 ;
- param nL := ( Mbar - M0 ) div L ;
- param q1 := 1+( ( Mbar - nL * L - M0 ) div dL );
- let n := q * nL + q1 + 1 ;
- param M1 := Mbar - nL * L ;
- for { i in 1..q1 } {
- for { j in 0 .. nL+1 } {
- let B[i+j*q] := M0 + (i-1) * dL + j * L;
- }
- }
- for {j in 0 .. nL+1 } {
- let B[q1+1+j*q] := M1 + j * L ;
- }
- for { i in q1+2..q } {
- for { j in 0 .. nL } {
- let B[i + j * q] := B[q1] + dL * (i - (q1+1)) + j * L;
- }
- }
- display t[n+q] , util_exp;
- # Provide correct path to solver
- option solver 'conopt' ;
- option conopt_options 'outlev=3';
- option display_width 100 ;
- objective last_arrival_time;
- solve;
- # The exponential utility
- objective util_exp ;
- solve ;
- var tt {i in 1..n} = t[i+q] ;
- option display_width 120 ;
- display t[1], t[n], t[n+q] , util_exp, util_exp / P,P;
- display B, e, k, v, ue_exp, ux_exp, t,tt > 'bath_exp.csv' ;
- end;
|