# Problem with three equations

**URL:** https://community.freefem.org/t/problem-with-three-equations/682
**Category:** General Discussion
**Created:** [December 11, 2020, 4:52pm UTC](https://community.freefem.org/t/problem-with-three-equations/682 "2020-12-11T16:52:50Z")
**Posts on this page:** 2
**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 11, 2020, 4:52pm UTC](https://community.freefem.org/t/problem-with-three-equations/682/1 "2020-12-11T16:52:50Z")

</div>

Hi,  
i have the following problem: three equations with three unknown u,i,v:

 ![Capture](https://canada1.discourse-cdn.com/flex030/uploads/freefem/original/1X/cb8df7b6d21236e20727f506f74417d0db127677.png)

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)(uh_wh)-int1SD(Th)(oldU_wh)  
+int1D(Th)(k2_uh_vh_wh_dt)  
;

problem two(ih,uh,vh,wh,init=t) =  
int1D(Th)(ih_wh)-int1D(Th)(oldI_wh)  
-int1D(Th)(k2_uh_vh_wh_dt)+int1D(Th)(Th)(sigma1_ih_wh\*dt)  
;

problem three(ih,vh,wh,init=t) =  
int1D(Th)(vh_wh)-int1D(Th)(oldV_wh)  
+int1D(Th)(dx(vh)_dx(wh)dt) +int1D(Th)(k3ih_wh_dt)-int1D(Th)(sigma2_vh_wh_dt)  
;

---

<div class="post-metadata">

### Author: ![frederichecht](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/frederichecht/32/15_2.png) [@frederichecht](https://community.freefem.org/u/frederichecht)
#### Post date: [December 12, 2020, 11:04am UTC](https://community.freefem.org/t/problem-with-three-equations/682/2 "2020-12-12T11:04:04Z")

</div>

First before to write a Free code, You must choose an algorithm to solve you nolinear  
problem.

So I can not help you.Sorry.
