Hi,
i have the following problem: three equations with three unknown u,i,v:
The data are: L=1, T=1000, k_2=10, k_3=1, D=0.001, sigma1=1, sigma2=1, u0=1, i0=0, v0=1, x0=0.3
I try to write the following program , but my difficulties are: to define the boundary conditions, to define Vh and to define the initial conditions, mostly how we define v(x,0)?
Can anyone help me please to ameliorate and correct the code. Thank you in advance.
load “msh3”
verbosity=1;
ofstream fout(“u.txt”);
//ofstream fouti(“i.txt”);
ofstream foutou(“v.txt”);
real L=1.;
real k2=10.;
real k3=1.;
real D=0.001;
real sigma1=1.;
real sigma2=1.;
real u0=1.;
real i0=0.;
real v0=1.;
real x0=0.3;
// initial values for the spatial domain
int N=200.;
real t=0.0;
real dt=0.1;
real a=0;
real b=1.;
meshL Th = Sline(n, [a + (1+1.0/(n-1)) * (b-a) * x, 0, 0]);
for (int i = 0; i < Th.nt; i++)
{
cout << i << " " << Th[i][0].x << endl;
}
fespace Vh(Th,P1);
Vh uh=0.0;
Vh ih=0.0;
Vh vh=0.0;
Vh wh;
Vh oldU=0.0;
Vh oldI=0.0;
Vh oldV=0.0;
real T=1000.0;// arbitraire
int[int] Order= [1];
string DataName;
problem one(uh,vh,wh,init=t) =
int1D(Th)(uhwh)-int1SD(Th)(oldUwh)
+int1D(Th)(k2uhvhwhdt)
;
problem two(ih,uh,vh,wh,init=t) =
int1D(Th)(ihwh)-int1D(Th)(oldIwh)
-int1D(Th)(k2uhvhwhdt)+int1D(Th)(Th)(sigma1ihwh*dt)
;
problem three(ih,vh,wh,init=t) =
int1D(Th)(vhwh)-int1D(Th)(oldVwh)
+int1D(Th)(dx(vh)dx(wh)dt) +int1D(Th)(k3ihwhdt)-int1D(Th)(sigma2vhwhdt)
;