Commit 9a6e972e authored by Nicolas Rodriguez's avatar Nicolas Rodriguez

Upload New File

parent 959c0915
%
% Copyright 2019-2020 LIST (Luxembourg Institute of Science and Technology), all right reserved.
%
% Author: Nicolas Rodriguez (nicolas.bjorn.rodriguez@gmail.com)
%
% Script used to generate the virtual data
rng(2);
t=datenum('01-Oct-1917'):1:datenum('01-Oct-2017'); % 100 years of daily timestamps
% J (precip)
% min in August, max in February
k=0.25;
theta=4;
f_J=1/365.25;
phi_J=datenum('15-Aug-1917')-3/(4*f_J);
A_J=400/365.25; % mm/d
J=(2*A_J+A_J*sin(2*pi*f_J*(t-phi_J))).*random('Gamma',k, theta, [1 length(t)]);
% ET
% min in December, max in June
ET0=2;
f_ET=1/365.25;
phi_ET=datenum('15-Dec-1917')-3/(4*f_ET);
A_ET=200/365.25; % mm/d
ET=(A_ET+A_ET*sin(2*pi*f_ET*(t-phi_ET))).*random('Exponential',ET0,[1 length(t)]);
% Q
S0=1000; % mm
Q=NaN(1,length(t)-1);
S=NaN(1,length(t));
S(1)=500;
a=1.64;
b=30;
for k=1:length(t)-1
Q(k)=a*(S(k)/S0)^b;
S(k+1)=S(k)+J(k)-(Q(k)+ET(k));
end
% Cp
% min in December, max in June
f_C=1/365.25;
C0=-50;
A_C=25;
E_C=20;
phi_C=datenum('15-Dec-1917')-3/(4*f_C);
Cp=C0+A_C*sin(2*pi*f_C*(t-phi_C))+E_C.*unifrnd(-1,1,[1 length(t)]);
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment