Esittely latautuu. Ole hyvä ja odota

Esittely latautuu. Ole hyvä ja odota

6. Lecture 12:15-12:50 Add nutrient leaching to the dynamic problem, and optimize fertilization pattern in the case that a farmer covers the cost of externalities.

Samankaltaiset esitykset


Esitys aiheesta: "6. Lecture 12:15-12:50 Add nutrient leaching to the dynamic problem, and optimize fertilization pattern in the case that a farmer covers the cost of externalities."— Esityksen transkriptio:

1 6. Lecture 12:15-12:50 Add nutrient leaching to the dynamic problem, and optimize fertilization pattern in the case that a farmer covers the cost of externalities Analyze alternative policy instruments (fertilizer tax, quota, pigouvian tax on nutrient pollution) 12:50-14:40 Exercises, planning of group work, coffee break 14:40-15:45 Dynamic programming Term paper (division of the themes)

2 clear all X0 = 20*ones(1,100); % alkuarvaus fosforilannoitukselle LB = zeros(1,100); % alarajat toimenpiteille UB = 300*ones(1,100); % ylärajat toimenpoiteille options = [X,FVAL,EXITFLAG] =

3 Optimal path of fertilization:
max 𝑥 𝑡 =1,…,100 𝑍 = 𝑡=1 100 𝑝 𝑌 𝑡 ( 𝑆 𝑡 )− 𝑎𝑥 𝑡 +𝑇−𝐶 −𝑑𝑎𝑚𝑎𝑔𝑒 𝑒 −𝑟𝑡 𝑥 𝑡 =𝑓( 𝑆 𝑡 Crop growth Z annual profit for a farmer, €/ha x Fertilizer input, kg/ha/year t 1,…,100 years a price of fertilazer, 4 €/kg T Support, 400 €/ha C Fixed costs, 423 €/ha p crop price, €/kg Y Yield, kg/ha S Soil test phosporus (STP) r rate of interest, 0.03 % L fosforin vesistökuormitus, kg/ha/vuosi 𝛾 inclination (steepness of slope), % damage damage function 𝑆 0 =𝑆’ Initial STP 𝑆 𝑡+1 =𝑓( 𝑆 𝑡 , 𝑥 𝑡 Transition equation 𝐿 𝑡 =𝑓( 𝑆 𝑡 , 𝛾 Nutrient leaching 𝑑𝑎𝑚𝑎𝑔𝑒 𝑡 =𝑓( 𝐿 𝑡 Damage

4 Lisätään fosforin huuhtoutumisfunktio (Iho 2010)
Inclination Strip width STP Marginal damage of nutrient pollution

5 lohkomalli_1.m -> lohkomalli_2.m
New elements: % Parameters g = 2; % Inclination d = 47; % marginal damage % Variables L = zeros(1,per); % Leaching % loop L(t) = 0.16*(0.38*g ) *S(t) ; % damage & profit damage = d * L; profit = p*Y - a*X + T - C - damage;

6 lohkomalli_2.m 1/2 function [Z] = lohkomalli_2(X); % Parameters per = 100; % years a = 4; % price of P fertilizer, €/kg T = 400; % agricultural support, €/ha/yr C = 423; % fixed cost of agriculture, €/ha/yr p = 0.147; % crop price, €/kg r = 0.03; % interest rate g = 2; % Inclination d = 47; % marginal damage % Variables Y = zeros(1,per); % crop yield S = zeros(1,per); % Soil test phosporus (state variable) profit = zeros(1,per); % Annual profit, €/ha/yr L = zeros(1,per); % Leaching % Initial state S(1,1) = 8; % STP initially

7 lohkomalli_2.m 1/2 % Loop for t=1:per Y(t) = max(0, 0.6*(-8720 * (S(t))^ )); % crop yield function S(t+1) = *S(t) + ( *S(t))*(X(t)-(3+0.19*log(S(t))*Y(t)/1000)); L(t) = 0.16*(0.38*g ) *S(t) ; end % profit and NPV damage = d * L; profit = p*Y - a*X + T - C - damage; Z = - exp(-r*(1:1:per))* profit'; % (negative) of the net present value

8 opt_lohkomalli_2.m 1/1 clear all X0 = 20*ones(1,100); % initial guess for P fertilization LB = zeros(1,100); UB = 300*ones(1,100); options = [X,FVAL,EXITFLAG] =

9 Exercise 6/1 Compute optimal solution (path of fertilization decisions) and study the development of state variables under two cases d=47 d=0 Plot the development of STP, nutrient leaching, and input use. Are the results consistent and logical?

10 ALTERNATIVE POLICY INSTRUMENTS
Upper limit for fertilization application applied Tax on fertilizers Have been applied e.g. in Sweden Pigouvian tax Measurement problem

11 Quantitative constraint on fertilizer
Pigouvian tax max 𝑥 𝑡 =1,…,30 𝑍 = 𝑒 −𝑟𝑡 𝑡=1 30 𝑝 𝑌 𝑡 ( 𝑆 𝑡 )− 𝑎𝑥 𝑡 +𝑇−𝐶 −𝑑𝑎𝑚𝑎𝑔𝑒 Tax affects sales price of fertilizer 𝑥 𝑡 =𝑓( 𝑆 𝑡 Crop growth 𝑆 0 =𝑆’ Initial STP 𝑆 𝑡+1 =𝑓( 𝑆 𝑡 , 𝑥 𝑡 Transition equation 𝐿 𝑡 =𝑓( 𝑆 𝑡 , 𝛾 Leaching 𝑑𝑎𝑚𝑎𝑔𝑒 𝑡 =𝑓( 𝐿 𝑡 Damage

12 Exercise 6/2 Analyse alternative policy instruments
costs = foregone farmer revenue (tip: change in Z-variable (FVAL in matlab), convert net present value to annual revenue by multiplying with the rate of interest) effectiveness = long-run impact on phosphorus leaching (tip: after optimization, run the simulation once more by copying the equations to the command window) Repeat optimization: Input tax (2,5 ja 10 euro/kg P) Upper constraint – annual fertilization (20, 10 ja 5 kg) – (tip: alter values of UB-parameter) Pigouvian tax (100, 200, 300 euroa/kilo)

13 Annual net revenues L(t=50 years) Baseline 0.7075 Fertilizer tax 2 Fertilizer tax 5 Fertilizer tax 10 Upper constraint 20 Upper constraint 10 Upper constraint 5 Pigue-tax 100 Pigue-tax 200 Pigue-tax 300 From these alternatives, what is the best (cost-effective) policy instrument? in case the policy target is gradual reduction of nutrient loading to a maximum of 0.5 kg/ha/year during the time span of 50 years?

14 Describe the management problem verbally (e.g. a paragraph of text)
Formulate the decision problem mathematically Write the problem as a matlab m-file Debugging & reality checking Solve the problem and report the solution the context

15 IMPACTS OF POLICY INSTRUMENTS
Quantitative constraint on fertilizer Pigouvian tax max 𝑥 𝑡 =1,…,30 𝑍 = 𝑒 −𝑟𝑡 𝑡=1 30 𝑝 𝑌 𝑡 ( 𝑆 𝑡 )− 𝑎𝑥 𝑡 +𝑇−𝐶 −𝑑𝑎𝑚𝑎𝑔𝑒 Tax affects sales price of fertilizer 𝑥 𝑡 =𝑓( 𝑆 𝑡 Crop growth 𝑆 0 =𝑆’ Initial STP DIFFERENT FORMULATIONS OF CROP GROWTH 𝑆 𝑡+1 =𝑓( 𝑆 𝑡 , 𝑥 𝑡 Transition equation 𝐿 𝑡 =𝑓( 𝑆 𝑡 , 𝛾 Leaching FISHERIES PROBLEMS 𝑑𝑎𝑚𝑎𝑔𝑒 𝑡 =𝑓( 𝐿 𝑡 Damage COMPARISON BETWEEN DYNAMIC PROGRAMMING & SIMULATION-BASED OPTIMIZATION

16 Dynamic Programming Solve the management problem using Bellmann equation Diskretise state variables and decision variables) Recursive, backward induction State variable includes all information needed for computing the optimal path of decisions Let’s divide the ”big problem” into large number of smaller problems and solve one small problem (single state & single time) at a time with a condition that all future management options are optimal Solve optimal management problem for all possible initial states Allows deterministic and stockhastic problem formulations – let’s start with a deterministic problem

17 state time X X X X t0 t1 …. tn-1 tn
Simulate state in the next period t+1 for all alternative levels of decisions Compute value function for the next period v(t+1,S) (interpolation) and discount to the current time t Compuate value function t: v*(t,S)+ 𝛽 𝑡 v∗(t,S) and save the optimal decision x* X X X X state Compute value function v*(t,S) for all possible alternative fertilization decisions x Choose the decision (optimal fertilization) that maximizes value function, x* t0 t1 …. tn-1 tn time

18 dynprogharj.m 1/4 % Tämän koodinpätkän avulla voidaan ratkaista optimaalinen fosforilannoitus % Bellmannin yhtälöä ja dynaamista ohjelmointia soveltaen % Parametrit per = 100; % vuosien lukumäärä a = 4; % fosforilannoitteen hinta, €/kg T = 400; % maataloustukien määrä, €/ha/v C = 423; % viljelyn kiinteät kustannukset, €/ha/v p = 0.147; % kauran myyntihinta, €/kg r = 0.03; % korkokanta g = 2; % pellon kaltevuus prosenteissa d = 0; % haitan rajakustannus tilat = 35; % tilojen lukumäärä (fosforiluvut) toimet = 25; % vaihtoehtoisten toimenpiteitten lukumäärä (lannoitustaso 2 kilon välein) % Muuttujien alustaminen arvo = zeros(per,tilat); % maksimoitu arvofunktio kussakin tilassa toimi = zeros(per,tilat); % optimoitu toimenpide kullekin tilalle

19 dynprogharj.m 2/4 % Luuppi for tt=1:per % Aika t = per-tt+1;
for i=1:35; % Tila if t==per nettotulo = zeros(1,25); for j=1:25; % Toimenpiteet lann = j*2-2; Y = max(0, 0.6*(-8720 * i^ )); % sato nettotulo(j) = p*Y - a*lann + T - C; % arvofunktio end [maksi ind] = max(nettotulo); arvo(t,i) = maksi; toimi(t,i) = ind;

20 dynprogharj.m 3/4 else nettotulo = zeros(1,25);
for j=1:25; % laske tulokset eri lannoitusmäärille jokaisella tilalle lann = j*2-2; Y = max(0, 0.6*(-8720 * i^ )); % estimoitu satoyhtälö (power function) seur_tila = *i + ( *i)*(lann-(3+0.19*log(i)*Y/1000)); apu1 = floor(seur_tila); apu2 = ceil(seur_tila); if apu1>33 seur_arvo = arvo(t+1, tilat-1); elseif apu1<1 seur_arvo = arvo(t+1, 1); seur_arvo = interp1([arvo(t+1, apu1) arvo(t+1, apu2)],seur_tila-apu1+1); end nettotulo(j) = p*Y - a*lann + T - C + exp(-r)*seur_arvo; [maksi ind] = max(nettotulo); arvo(t,i) = maksi; toimi(t,i) = ind;

21 % optimal decision in the first year for different initial states
Opt_dec = toimi(1,:); Max_val = arvo(1,:); plot(1:1:35,Opt_dec) % Value of as function of the stateoptimal decision in the first year close plot(1:1:35,Max_val) % Optimal development of state variable for different initial states clear S Y tulos=[]; for k=1:35 S(1) = k; for t=1:per Y(t) = max(0, 0.6*(-8720 * (S(t))^ )); % estimoitu yhtälö (power function) lann = 2*Opt_dec(round(S(t))); S(t+1) = *S(t) + ( *S(t))*(lann-(3+0.19*log(S(t))*Y(t)/1000)); end tulos=[tulos;S]; plot(tulos')

22 Feedback (by e-mail to Matti)
Did the course meet your expectations? Did you learn? Do you feel that the skills you learned are useful for your later studies /work? Thematic course or more general programming course? Which serves learning better? Would there be demand for other thematic courses? Were lecturing, exercises & contact teaching in good balance in this course? Any recommendations, suggestions, hints for the next year’s course?


Lataa ppt "6. Lecture 12:15-12:50 Add nutrient leaching to the dynamic problem, and optimize fertilization pattern in the case that a farmer covers the cost of externalities."

Samankaltaiset esitykset


Iklan oleh Google