Home > Back-end >  Help greatly, manual calculation and the calculation results of different program, program there is
Help greatly, manual calculation and the calculation results of different program, program there is

Time:09-18

#include
#include
#include
# define N 24
# define WUM 20
# define WLM 75
# define WDM 80
# define WM 175
# define Kc 0.63
# define C 0.10
# define B 0.3
# define IM 0
# define SM 20
# define the EX 1
# define 0.3 KG
# define KI 0.41
# define CI 0.6
# define CG 0.99
# define F/537/model parameter input
int i;
Double P [24]={10,24.1, 20.4, 18.3, 10.1, 5.5, 0.6, 3.1, 1.9, 4.6, 5,4.8, 36.2, 29,6,3.6, 0.4, 0,0.5, 3.8, 0,1.8, 0.2, 0.3};
Double Eo [24]={0.1, 0,0.1, 0.5, 0.7, 0.9, 0.8, 0.7, 0.5, 0.3, 0.2, 0.1, 0,0,0.1, 0.6, 0.8, 1,0.9, 0.8, 0.7, 0.5, 0.3, 0.1};
Double Em [N], WU [N], WL [N], WD [N], EU [N], EL [N], [N], ED E [N].//evaporation parameters
Settlement double PE [N], [N], Wmm, A [N], R [N].//runoff yield parameters
Double FRo [N], FR [N], So [N], [N] S1 and S2 [N], SMM, SMMF, SMF, AU [N], RS [N], RI [N], RG [N], [N] S2;//three water partition parameter
QI double QS [N], [N], QG [N], QT [N], Q [N].//bus parameter
Double UH [3]={0.3, 0.6, 0.1};//UH dimensionless unit line 3 times
Double U;
FILE *fp;
Int main ()
{
Fp=fopen (" results. TXT ", "w +");
WU [0]=0; WL [0]=70; WD [0]=80; Send [0]=150;
for(i=0; i<24. I++)
{
Em [I]=Eo [I] * Kc.//evaporation calculation start
PE [I]=P [I] - Em [I];
If (WU [I] + P [I] & gt;=Em [I])//upper evaporation
{
EU [I]=Em [I];
EL [I]=0;
ED [I]=0;
}
The else
{
If (WL [I] & gt;=C * WLM)//upper lower enough to fill the
{
EU [I]=WU [I] + P [I];
EL [I]=(Em [I] - EU [I]) * WL [I]/WLM;
ED [I]=0;
}
If (C * (Em [I] - EU [I]) & lt;=WL [I])
{
EU [I]=WU [I] + P [I];
EL [I]=C * (Em [I] - EU [I]);
ED [I]=0.0;
}
The else//lower deep enough to fill the
{
EU [I]=WU [I] + P [I];
EL [I]=WL [I];
ED [I]=C * (Em [I] - EU [I]) - EL [I];
}
}
E=EU [I] [I] + EL [I] + ED [I];
Fprintf (fp, "% d time: \ n parameters of the output (1) evaporation \ nP=% 3 f \ tEo=% 3 f \ tEm=% 3 f \ tPE=% 3 f \ tEU=% 3 f \ tEL=% 3 f \ tED=% 3 f \ tE=% 3 f \ r \ n", I + 1, P [I], Eo [I], [I] Em, PE [I], EU [I], EL [I], ED [I], [I] E);
Wmm=WM * (1 + B);//start of runoff yield calculation
A [I]=Wmm * (1 - pow (1 - send [I]/WM, 1.0/(1 + B)));
If (PE + [I] A [I] R=PE [I] - [I] settlement WM + [I] + WM * pow (1 - (PE + [I] A [I])/Wmm, 1 + B);
The else
R=PE [I] - [I] settlement (WM - [I]);//the whole watershed runoff
If (R [I] <0)
R [I]=0;
Send [I + 1)=P [I] - [I] E - R settlement [I] + [I];
If (send [I + 1] & gt; WM)
Send [I + 1)=WM;
=WU WU [I + 1] [I] + send settlement [I + 1] - [I];
WL [I + 1)=WL [I];
WD=[I + 1] WD [I];
If (WU [I + 1] & gt;=WUM)
{
WL [I + 1)=WL [I] + WU [I + 1) - WUM;
WU [I + 1)=WUM;
If (WL [I + 1] & gt;=WLM)
{
WD=WD [I] [I + 1] + WL - WLM [I + 1];
WL [I + 1)=WLM;
If (WD [I + 1] & gt;=WDM)
WD=WDM [I + 1];
}
}//average runoff river basin after water storage capacity calculation
Fprintf (fp, "\ n (2) the runoff yield parameters output \ nA=% 3 f \ tR=% 3 f \ tW=% 3 f \ tWU=% 3 f \ these=% 3 f \ tWD=% 3 f \ r \ n", A [I], r [I], settlement [I + 1), WU [I + 1], WL, [I + 1] WD [I + 1));
FRo [0]=0.1;//three water division calculation
[I] if (R & gt; 0)
{
So [0]=20;
FR [I]/[I]=R (PE [I]);
S1=So [I] [I] * FRo [I]/FR [I];//initial runoff area of the corresponding free water
SMM=SM * (1 + EX);
SMMF=SMM * (1 - pow (1 - FR [I], 1.0/EX));
The SMF=SMMF/(1 + EX);
AU [I]=SMMF * (1 - pow (1 - [I] S1/SMF, 1.0/(1 + EX)));
If (R + AU [I] [I] & gt;=SMMF)
{
RS=FR [I] [I] * (R + S1 [I] - [I] SMF);
RI [I]=SMF * KI * FR [I];
RG [I]=SMF * KG * FR [I];
[I]=S2 SMF - (RI + RG [I] [I])/FR [I];//runoff area of change after the corresponding free water
}
The else
{
RS=FR [I] [I] * [I] - (R, SMF + [I] S1 + SMF * pow (1 - (R + AU [I] [I])/SMMF, 1 + EX));
RI FR [I] [I]=KI * * (R + S1 [I] - [I] RS/FR [I] [I]);
RG FR [I] [I]=KG * * (R + S1 [I] - [I] RS/FR [I] [I]);
S2=S1 + R [I] [I] [I] - [I] (RS + RI + RG [I] [I])/FR [I];
}
FRo [I + 1)=FR [I];
So [I + 1)=S2 [I];
}
[I] if (R==0)
{
FR [I]=0;
[I] S1=0;
SMMF=0;
The SMF=0;
AU [I]=0;
RS [I]=0;
RI [I]=0;
RG [I]=0;
S2 [I + 1)=0;
}
FRo [I + 1)=FR [I];
Fprintf (fp, "\ n (3) three water dividing parameters output \ NFRS=% 3 f \ tS1=% 3 f \ tSMMF=% 3 f \ tSMF=% 3 f \ tAU=% 3 f \ tRS=% 3 f \ tRI=% 3 f \ tRG=% 3 f \ tS2=% 3 f \ r \ n", FR [I], [I] S1 and SMMF, SMF, AU [I], RS [I], RI [I], RG [I], [I] S2);
U=F/(3.6 * 2);//confluence calculation start
If (I==0)
QS RS [I] [I]=U * * UH [0];
QI [0]=40 * CI + RI (1 - CI) * [0] * U;
QG [0]=20 * CG + RG [0] (1 - CG) * * U.
If (I==1)
QS [I]=U * (RS [0] + [I] * UH RS * [I - 1] UH [1]).
If (i> 1)
QS [I]=U * (RS * [I - 2] UH [I - 1] [2] + RS * UH UH [I] + [1] RS * [0]).
If (i> 0)
{
QI QI [I]=CI * [I - 1) + (1 - CI) * RI [I] * U;
QG [I]=CG * QG [I - 1) + (1 - CG) * RG [I] * U;
}
QT [I]=QS [I] + QI QG [I] + [I];
If (I==0)
Q [1] [I]=60 * UH UH + QT [I] * [0].
If (I==1)
Q [2] [I]=60 * UH UH + QT [I - 1) * [1] UH + QT [I] * [0];
If (i> 1)
Q [I]=QT [2] I - * UH + QT [I - 1] [2] [1] * UH UH + QT [I] * [0].
Fprintf (fp, "\ n (4) the confluence parameters output \ nQS=% 3 f \ tQI=% 3 f \ tQG=% 3 f \ tQT=% 3 f \ tQ=% 3 f \ r \ n \ n \ n", QS [I], QI [I], QG [I], QT [I], Q [I]);
}
The fclose (fp);
Printf (" please to the calculation results. TXT view \ n ");
return 0;
}

CodePudding user response:

Dizzy
That you take the intermediate results are printed out, and see which step is the calculation and is not the same as your hand, to check whether there is logic to handle related problems

CodePudding user response:

reference 1st floor qybao response:
dizzy
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related