-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCalibCO2.m
29 lines (25 loc) · 872 Bytes
/
CalibCO2.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
%CalibCO2
%The Climate Framework for Uncertainty, Negotiation and Distribution,
%version 4.0-matlab-global
%
%This script is part of FUND 4.0 MG
%It calibrates the conversion factor of carbon dioxide emissions to
%instantaneous concentrations.
%
%Richard Tol, 6 August 2014
%This code is protected by the MIT License
%first pass
for t=2:NHistYear
MRHbox(t,1,:) = MRH(MRHbox(t-1,1,:),historicCO2emit(t-1)+historicLUemit(t-1),MRHlife,MRHshare,CO2convert);
CO2conc(t,1) = sum(MRHbox(t,1,:));
end
%calibrate
CO2aux = CO2convert;
while abs(CO2conc(NHistYear)-CO22010) > 1,
CO2aux = CO2aux*CO22010/CO2conc(NHistYear);
for t=2:NHistYear
MRHbox(t,1,:) = MRH(MRHbox(t-1,1,:),historicCO2emit(t-1)+historicLUemit(t-1),MRHlife,MRHshare,CO2aux);
CO2conc(t,1) = sum(MRHbox(t,1,:));
end
end
CO2convert = CO2aux;