-
Notifications
You must be signed in to change notification settings - Fork 0
/
Total_Population_Fractions.c
95 lines (72 loc) · 2.22 KB
/
Total_Population_Fractions.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
#include <MODEL.h>
double fraction_Female_Sexual_Workers ( const double * y, Parameter_Table * Table )
{
double x, x_0;
double N;
int i;
/* Definition of the state vector numerical order, from 0 to K, of model variables */
#include <Model_Variables_Code.Include.c>
N = total_Females (y, Table);
if( Table->n_Mu == 1 ) {
if (Table->TYPE_of_MODEL == 0) {
x = (y[WS] + y[WI] + y[WL] + y[WD])/N;
}
else {
x_0 = total_Female_Sexual_Workers (y, Table);
x = x_0 / N;
}
}
else {
printf(" Number of substages for the low-infectivity, quasi-latent stage (n_Mu) is %d\n",
Table->n_Mu);
printf(" n_Mu > 1 requires a carefull code implementation (which in in-progress)\n");
printf(" The program will exit\nm");
exit(0);
}
return (x);
}
double fraction_Female_Non_Sexual_Workers ( const double * y, Parameter_Table * Table )
{
double x, x_0;
double N;
int i;
/* Definition of the state vector numerical order, from 0 to K, of model variables */
#include <Model_Variables_Code.Include.c>
N = total_Females (y, Table);
if( Table->n_Mu == 1 ) {
if (Table->TYPE_of_MODEL == 0) {
x = (y[XS] + y[XI] + y[XL] + y[XD])/N;
}
else {
x_0 = total_Female_Non_Sexual_Workers (y, Table);
x = x_0 / N;
}
}
else {
printf(" Number of substages for the low-infectivity, quasi-latent stage (n_Mu) is %d\n",
Table->n_Mu);
printf(" n_Mu > 1 requires a carefull code implementation (which in-progress)\n");
printf(" The program will exit\nm");
exit(0);
}
return (x);
}
double fraction_Female_Sexual_Workers_at_Stationarity_Free_Disease ( Parameter_Table * Table )
{
/* Output:
. x = w0s + w1s, at stationarity.
*/
double x;
int i;
double D0, D, A, B, C;
double x0s, w0s;
D = (Table->Delta_X+Table->Alpha)/(Table->Sigma_0+Table->Sigma_0_r+Table->Delta_X+Table->Alpha);
D0 = (Table->Sigma_1_r+Table->Sigma_1+Table->Delta_X);
A = Table->Sigma_1/D0;
B = (Table->Sigma_0 - Table->Sigma_1)/D0;
C = (Table->Sigma_1_r - Table->Sigma_0_r)/D0;
x0s = Table->Delta_X * (Table->Delta_X+Table->Sigma_0_r+Table->Alpha)/D;
w0s = Table->Delta_X * Table->Sigma_0/D;
x = A + B * x0s - C * w0s;
return (x);
}