# Boundary conditions

**URL:** <https://community.freefem.org/t/boundary-conditions/694>\
**Category:** General Discussion\
**Created:** [December 16, 2020, 3:53pm UTC](https://community.freefem.org/t/boundary-conditions/694 "2020-12-16T15:53:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aicha](https://avatars.discourse-cdn.com/v4/letter/a/ec9cab/32.png) [@Aicha](https://community.freefem.org/u/Aicha)\
**Post date:** [December 16, 2020, 3:53pm UTC](https://community.freefem.org/t/boundary-conditions/694/1 "2020-12-16T15:53:40Z")

</div>

Hi,  
i have the following code and i want to add the boundary condition  
dV/dx(L,t)=0, dV/dx(0,t)=0  
and the initial conditions  
U(x,0)=1, I(x,0)=0, V(x,0)=1  
How we can do this please? I write some examples in FF++, i try some tentatives without results.  
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 x0=0.3;

int N=200.;

real t=0.0;

real dt=0.1;

real tau=1.0;

real n= tau/dt;

real a=0., b=1.;  
mesh Th=square(n,1,[a+x\*(b-a),y/10]);

fespace Vh(Th,[P1,P1]);

Vh [T1,T2,T3];

Vh[U,I,V];

\Initial conditions

Vh Uold=0.0;  
Vh Iold=0.0;  
Vh Vold=0.0;  
real T=1000.0;// arbitraire  
int[int] Order= [1];  
string DataName;

\ Definition of Heaviside function

func real H (real s) {  
if ( s \<=0)  
return 1;  
else  
return 0.0;  
};

//Problem

# problem system ([T1,T2,T3], [U,I,V])

int2D(Th)(U_T1+I_T2+V_T3)  
-int2D(Th)(Uold_T1+Iold_T2+Vold_T3)  
+int2D(Th)(k2_U_V_T1_dt) - int1D(Th)(k2_U_V_T2_dt)  
+int2D(Th)(sigma1_I_T2_dt)  
+int2D(Th)(D_dx(V)_dx(T3)dt)  
-int2D(Th)(k3I(x,t-n_dt)_H(t-n_dt)_T3_dt)  
+int2D(Th)(sigma2_V_T3\*dt)  
;
