This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| en:dev:initialisation_mkt [2017/03/21 12:15] – Antonello Lobianco | en:dev:initialisation_mkt [2025/05/01 12:15] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | This is the workflow of the model in the first few years. | + | The workflow of the initialisation of the market module. |
| '' | '' | ||
| Line 6: | Line 6: | ||
| r -> region; | r -> region; | ||
| t -> time'' | t -> time'' | ||
| + | |||
| + | ModelCoreSpatial:: | ||
| $pl_{r, | $pl_{r, | ||
| - | $dl_{r, | + | $dl_{r, |
| $st_{r, | $st_{r, | ||
| Line 15: | Line 17: | ||
| $dt_{r, | $dt_{r, | ||
| - | $ q1_{r, | + | $ q1_{r, |
| - | + | ||
| - | ModelCoreSpatial:: | + | |
| - | msgOut(MSG_INFO, | + | |
| - | + | ||
| - | for(uint i=0; | + | |
| - | int r2 = regIds2[i]; | + | |
| - | + | ||
| - | + | ||
| - | + | ||
| - | // q1(i,p_tr) = 1/ | + | |
| - | // p1(i, | + | |
| - | // RPAR(' | + | |
| - | // RPAR(' | + | |
| - | // RPAR(' | + | |
| - | // RPAR(' | + | |
| - | // K(i, | + | |
| - | for(uint sp=0; | + | |
| - | double psi = gpd(" | + | |
| - | double dl = gpd(" | + | |
| - | double da = gpd(" | + | |
| - | double pl = gpd(" | + | |
| - | double sl = gpd(" | + | |
| - | double k1 = gpd(" | + | |
| - | double pWo = gpd(" | + | |
| - | + | ||
| - | + | ||
| - | double q1 = 1/ ( 1+pow(dl/ | + | |
| - | double p1 = 1-q1; | + | |
| - | double dc = pow( | + | |
| - | q1*pow(da, | + | |
| - | , | + | |
| - | psi/ | + | |
| - | ); | + | |
| - | double pc = (da/ | + | |
| - | | + | |
| - | double pw = (dl*pl+da*pWo)/ | + | |
| - | double k = k1*sl; | + | |
| - | + | ||
| - | spd(q1," | + | |
| - | // | + | |
| - | spd(dc," | + | |
| - | spd(pc," | + | |
| - | spd(pw," | + | |
| - | spd(k," | + | |
| - | | + | |
| - | + | ||
| - | // t1(i,p_pr) = 1/ | + | |
| - | // r1(i, | + | |
| - | // RPAR(' | + | |
| - | // RPAR(' | + | |
| - | // RPAR(' | + | |
| - | for(uint pp=0; | + | |
| - | double sl = gpd(" | + | $ p1_{r,tp,t=1} = 1 - q1_{r,tp,t=1} $ |
| - | double sa | + | |
| - | double eta = gpd(" | + | |
| - | double pl | + | |
| - | double pWo = gpd(" | + | |
| + | $ dc_{r, | ||
| - | double t1 = 1/ ( 1+(pow(sl/ | + | $ pc_{r,tp,t=2} = {\frac{da_{r,tp,t=2}}{dc_{r, |
| - | double r1 = 1-t1; | + | |
| - | double sc = pow( | + | |
| - | t1*pow(sa,(eta-1)/ | + | |
| - | | + | |
| - | | + | |
| - | ); | + | |
| - | double pc = (sa/ | + | |
| - | double pw = (sl*pl+sa*pWo)/ | + | |
| - | spd(t1," | + | $ pw_{r,tp,t=2}= \frac{dl_{r,tp,t=2}*pl_{r,tp,t=2}+da_{r,tp,t=2}*pW0_{tp,t=2}}{dl_{r,tp,t=2}+da_{r,tp,t=2}} $ |
| - | // | + | |
| - | spd(sc," | + | |
| - | spd(pc," | + | |
| - | spd(pw," | + | |
| - | | + | |
| - | // up to here tested with gams output on 20120628, that's fine !! | + | $ k_{r,tp,t=2} = k1_{r,tp,t=2}*sl_{r, |
| - | | + | |
| + | $ t1_{r, | ||
| - | // initializing the exports to zero quantities | + | $ r1_{r,pp,t=1} = 1 - t1_{r,pp,t=1} $ |
| - | // initializing of the transport cost for the same region to one and distance to zero | + | |
| - | for(uint r1=0; | + | |
| - | for(uint r2=0; | + | |
| - | for(uint p=0; | + | |
| - | for(uint r2To=0; | + | |
| - | spd(0," | + | |
| - | if(l2r[r1][r2] | + | |
| - | spd(1," | + | |
| - | } | + | |
| - | } | + | |
| - | | + | |
| - | for(uint r2To=0; | + | $ sc_{r,pp,t=2} = \left(t1_{r,pp,t=1} * sa_{r,pp,t=2}^{\frac{eta_{r,pp,t=2}-1}{eta_{r,pp,t=2}}} + r1_{r,pp,t=1} * sl_{r, |
| - | if(l2r[r1][r2] | + | |
| - | spd(0," | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | } | + | |
| + | $ pc_{r, | ||
| + | $ pw_{r, | ||