4 int GenerateMatlab( char * prefix
);
5 void GetMass( double CL
[], double Mass
[] );
6 void INTEGRATE( double TIN
, double TOUT
);
7 void Gillespie(int Nssa
, double Volume
, double* T
, int NmlcV
[], int NmlcF
[]);
10 /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
12 /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
14 /*~~~> Output results file */
16 /*~~~> No of molecules */
17 int NmlcV
[NVAR
], NmlcF
[NFIX
];
18 /*~~~> No of reaction events per output step */
20 /*~~~> Local variables */
26 fpDat
= fopen("KPP_ROOT_stochastic.dat", "w");
28 /* Translate initial values from conc. to molecules */
31 for( i
= 0; i
< NVAR
; i
++ )
32 NmlcV
[i
] = (int)(Volume
*VAR
[i
]);
33 for( i
= 0; i
< NFIX
; i
++ )
34 NmlcF
[i
] = (int)(Volume
*FIX
[i
]);
36 /*~~~> Begin Time Loop ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
39 printf("\n%6.1f%% %10.4f ", (T
-TSTART
)/(TEND
-TSTART
)*100, T
);
40 for( i
= 0; i
< NVAR
; i
++ )
41 printf( "%s=%d ", SPC_NAMES
[i
], NmlcV
[i
] );
43 fprintf(fpDat
,"\n%g ", T
);
44 for( i
= 0; i
< NVAR
; i
++ )
45 fprintf(fpDat
,"%d ", NmlcV
[i
]);
47 Gillespie( Nevents
, Volume
, &T
, NmlcV
, NmlcF
);
49 } /* while (T <= TEND) */
50 /*~~~> End Time Loop ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
52 fprintf(fpDat
,"\n%g ", T
);
53 for( i
= 0; i
< NVAR
; i
++ )
54 fprintf(fpDat
,"%d ", NmlcV
[i
]);
63 /*~~~> End of MAIN function ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */