-
Notifications
You must be signed in to change notification settings - Fork 0
/
time_Oscillations_Parameter_Forcing.c
executable file
·112 lines (78 loc) · 2.75 KB
/
time_Oscillations_Parameter_Forcing.c
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
#include "./Include/MODEL.h"
extern gsl_rng * r;
double Sinusoidal_Oscillation(double t, double E, double K_Mean, double K_Var, double T)
{
double value;
// E = gsl_ran_gaussian(r, K_var);
/* This function returns a Gaussian random variate, with mean zero
and standard deviation K_var */
value = K_Mean *(1.0 + E * sin(2.*M_PI*t/T)); //gsl_ran_gaussian(r, K_Var);
return (value);
}
double Double_Sinusoidal_Oscillation(double t, double E, double K_Mean, double K_Var, double T)
{
double value;
double A;
//A = E * gsl_rng_uniform(r);
A = E * sin( M_PI*t/T + M_PI/5.0 );
//A = E;
value = K_Mean * ( 1 + A * sin(2.*M_PI*t/T) ); //gsl_ran_gaussian(r, K_Var);
return (value);
}
double K_p_Precipitation(double t, Parameter_Table * P)
{
/* Sinusoidal oscillation in both carrying capacity and amplitude of oscillation (A) */
/* A time variable carrying capacity */
double E, K, K_Mean, K_Var;
K_Mean = P->K_Mean_Value; /* K_p (see values_HumaMos.c) */
K_Var = P->K_Sigma;
E = P->K_Seasonal_Intensity;
// K = Sinusoidal_Oscillation(t, E, K_Mean, K_Var, P->K_Period);
K = Double_Sinusoidal_Oscillation(t, E, K_Mean, K_Var, P->K_Period);
return (K);
}
double K_Mosquito(double t, Parameter_Table * P)
{
/* A time variable carrying capacity */
double E, K, K_Mean, K_Var;
K_Mean = P->K_Mean_Value; /* K_0 (see values_HumaMos.c) */
K_Var = P->K_Sigma;
E = P->K_Seasonal_Intensity;
K = Sinusoidal_Oscillation(t, E, K_Mean, K_Var, P->K_Period);
//K = Double_Sinusoidal_Oscillation(t, E, K_Mean, K_Var, P->K_Period);
return (K);
}
double Fecundity_Mosquito_00(double t, Parameter_Table * P)
{
/* A time variable carrying capacity */
double E, K, K_Mean, K_Var;
K_Mean = P->K_Mean_Value; /* K_0 can have long term trend itself */
K_Var = P->K_Sigma;
E = P->K_Seasonal_Intensity;
K = Sinusoidal_Oscillation(t, E, K_Mean, K_Var, P->K_Period);
return (K);
}
double L_Devel_Mosquito(double t, Parameter_Table * P)
{
/* A time variable carrying capacity */
double E, K, K_Mean, K_Var;
K_Mean = P->K_Mean_Value ; /* K_0 can have long term trend itself */
K_Var = P->K_Sigma;
E = P->K_Seasonal_Intensity;
K = Sinusoidal_Oscillation(t, E, K_Mean, K_Var, P->K_Period);
return (K);
}
/* double */
/* K_Derivative(double t, Parameter_Table * P) */
/* { */
/* double E, K_D, K_Mean, K_Var; */
/* double Jump_Value; */
/* E = 0.; */
/* K_Mean = P->K_0; */
/* K_Var = P->K_Sigma; */
/* Jump_Value = (P->Tr.value_1 - P->Tr.value_0)/(P->Tr.time_1-P->Tr.time_0); */
/* K_D = Jump_Value * (1. + E*cos(2.*M_PI*t/P->K_Period)) */
/* - K_Mean*E*sin(2.*M_PI*t/P->K_Period)*(2.*M_PI/P->K_Period); */
/* //if(E == 0. && P->Linear_Trend_Epsilon == 0.) K_D = 0.; */
/* return(K_D); */
/* } */