|
源代码python编写的,https://github.com/marcae777/Monthly-water-balance-model/blob/master/Monthly_water_balance_model.ipynb
发现这个代码错了,我纠正了,用matlab编写,分享!
data=xlsread('Example_Data.csv');
EP=data(:,3);
P=data(:,2);
Area=862.69;
SC=5000*Area*3.858e-4;
c=8.71259;
EP=EP*Area*3.858e-4;
P =Area*P*3.858e-4;
E=zeros(length(P),1);
Q=zeros(length(P),1);
for i=1:length(P)
if i==1
S_last=1650*Area*3.858e-4;
end
E(i)=c*EP(i)*tanh(P(i)/EP(i));
Q(i) =(S_last+P(i)-E(i))*tanh((S_last+P(i)-E(i))/SC);
S_last=S_last+P(i)-E(i)-Q(i);
end
% xlswrite('output1.xlsx',Q);
plot(Q(66:150,:));
hold on;
plot(data(66:150,1)+10,'r');
Archiver|手机版|科学网 ( 京ICP备07017567号-12 )
GMT+8, 2024-12-22 20:15
Powered by ScienceNet.cn
Copyright © 2007- 中国科学报社