# Solve Coupled Partial differential equations

**URL:** <https://community.freefem.org/t/solve-coupled-partial-differential-equations/2295>\
**Category:** General Discussion\
**Created:** [February 26, 2023, 5:56pm UTC](https://community.freefem.org/t/solve-coupled-partial-differential-equations/2295 "2023-02-26T17:56:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aud](https://avatars.discourse-cdn.com/v4/letter/a/3ab097/32.png) [@Aud](https://community.freefem.org/u/Aud)\
**Post date:** [February 26, 2023, 5:56pm UTC](https://community.freefem.org/t/solve-coupled-partial-differential-equations/2295/1 "2023-02-26T17:56:36Z")

</div>

Hello dear community, I am new to FreeFEM. I have managed to solve single PDEs but now I would like to proceed with coupled ones. I have not yet found documentation related. can anyone help me in this regard? Thank you

---

<div class="post-metadata">

**Author:** ![cmd](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/cmd/32/67_2.png) [@cmd](https://community.freefem.org/u/cmd)\
**Post date:** [February 26, 2023, 9:19pm UTC](https://community.freefem.org/t/solve-coupled-partial-differential-equations/2295/2 "2023-02-26T21:19:16Z")

</div>

Take a look at the examples:  
[https://doc.freefem.org/tutorials/index.html#](https://doc.freefem.org/tutorials/index.html#)

---

<div class="post-metadata">

**Author:** ![marchywka](https://avatars.discourse-cdn.com/v4/letter/m/ee59a6/32.png) [@marchywka](https://community.freefem.org/u/marchywka)\
**Post date:** [February 26, 2023, 9:58pm UTC](https://community.freefem.org/t/solve-coupled-partial-differential-equations/2295/3 "2023-02-26T21:58:18Z")

</div>

As a newcomer to FEM in general, although I’ve played with it in the past not  
actually accomplished much, I found some specific things useful.  
Maybe someone wants to comment on my comments as I may have made  
some simple blunders here.

I guess some of the bilpaplacian examples are very simple and illustrative  
at least the ones that turn u\_{xxxx} into two equations.

```auto
`FreeFem-sources-master/examples$ find -name "*.edp" | grep -i bilap
./misc/bilap.edp
./plugin/bilapMorley.edp
./plugin/bilapP3-hct-like.edp
./plugin/bilapHCT.edp
./hpddm/bilaplace-2d-PETSc.edp

For example AFAICT this creates a new variable uu as the laplacian of
u and then indicates the coupling by the test functions. 

```

solve bilap([u,uu],[v,vv],solver=sparsesolver,eps=1.0e-6) =  
int2d(Th)( laplacien(u,vv)+uu\*vv // - Delta u + uu =0 (vv)  
+ laplacien(uu,v) ) // - Delta uu = 1 (v)

- int2d(Th)(f\*v)

- on(1,2,3,4,u=0); // =\> v=0 also on 1,2,3,4

```auto

Any "solve" line
with vector notation ( that should grep ) may be helpful. 

```

grep solve `find -name "*.edp" ` | grep “[”| wc

```auto

```

grep varf `find -name "*.edp" ` | grep “[”| wc

```auto
In doing diffusion of several species that can change into each other (
one species enzymatically converts a second specieis stoichiometirically
into a third ) I set up a bunch of varfs and made a composite matrix
with the matrix from each varf as the diagonal blocks. The the coupling
was going to go on the off diagonal blocks. However for now I'm just
time stepping doing FD in home made code. 

`

```

---

<div class="post-metadata">

**Author:** ![Aud](https://avatars.discourse-cdn.com/v4/letter/a/3ab097/32.png) [@Aud](https://community.freefem.org/u/Aud)\
**Post date:** [March 1, 2023, 10:59am UTC](https://community.freefem.org/t/solve-coupled-partial-differential-equations/2295/4 "2023-03-01T10:59:58Z")

</div>

Thank you very much for your help marchywka
