Explicit Finite difference
i'm doing this programming project about aedes (the mosquito) dispersal.
it involves 2 differential equation. 1 to be solve with runge kutta and the other with finite difference method.
i think managed to solve the runge-kutta algorithm as it was pretty simple.
but the finite difference lost me. i managed to get finite difference model equation. however getting/setting the border condition i have no idea.
i only learned university level calculus. so this is beyond me. (Speechless)
you can get the journal here
Aedes aegypti dispersal.pdf
the 3 main funtions i did in c++
double f(double Axt, double Mxt, double r, double k2, double u2) /* Definition of A(x,t) with M(x,t) carry in as parameter*/
function = (r*(1-(Axt/k2))*Mxt)-(u2+gamma)*Axt;
double m(double Axt, double Mxt, double m1,double m2, double m3, double t, double x, double D, double v, double k1, double gamma, double u1) /* Definition of M(x,t) after explicit finite difference with A(x,t) carry in as parameter*/
function1 = (((t*D)/(x*x))-(t/x)*v*Mxt)*m1;
function2 = (1-((2*t*D)/(x*x)))+(((t/x)*(v*Mxt))*m2);
function3 = ((t*D)/(x*x))*m3;
function4 = ((gamma*t*Axt)*(1-(Mxt/k1)))-(t*u1*Mxt);
final = function1+function2+function3+function4;
double Axt_runged (double Axt, double Mxt) // runge kutta A(x,t)
double t, y;
double a=0,b=1; // Initial values
double h=(b-a)/N; // Step size
while (i <= N)
y=y+(k1+2*k2+2*k3+k4)/6; // Linear approximation to
i++; // Increments counter k by 1
t=t+h; // Increments t by the step size