# Solver for Elliptic PDE with Dirichlet and Neumann BCs

**URL:** https://discourse.julialang.org/t/solver-for-elliptic-pde-with-dirichlet-and-neumann-bcs/111668
**Category:** Numerics
**Created:** [March 15, 2024, 3:38pm UTC](https://discourse.julialang.org/t/solver-for-elliptic-pde-with-dirichlet-and-neumann-bcs/111668 "2024-03-15T15:38:43Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![mleprovost](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mleprovost/32/7166_2.png) [@mleprovost](https://discourse.julialang.org/u/mleprovost)
#### Post date: [March 15, 2024, 3:38pm UTC](https://discourse.julialang.org/t/solver-for-elliptic-pde-with-dirichlet-and-neumann-bcs/111668/1 "2024-03-15T15:38:43Z")

</div>

Hello,

I am interested in developing a finite difference solver for a 2D elliptic PDE (~ Darcy flow) from ([https://arxiv.org/pdf/2205.09322.pdf](https://arxiv.org/pdf/2205.09322.pdf)). Do you have recommended packages to solve this PDE?

The PDE is given by:

-\text{div}(e^{u(x)} \nabla u(x)) = f(x), \text{for } x=(x\_1, x\_2) \in [0,1] \times [0,1]  
with boundary conditions:  
v(x\_1, 0) = 100, \frac{\partial v}{\partial x\_1}(1, x\_2) = 0, -e^{u(x)} \frac{\partial v}{\partial x\_1}(0, x\_2) = 500, \frac{\partial v}{\partial x\_2}(x\_1, 1) = 0,  
and forcing term  
f(x) = f(x\_1, x\_2) = \begin{cases} 0 & 0 \leq x\_2 \leq \frac{4}{6},\\ 137 & \frac{4}{6} \< x\_2 \leq \frac{5}{6},\\ 274 & \frac{5}{6} \< x\_2 \leq 1 \end{cases}

We assume that the log diffusion term is given by  
u(x\_1, x\_2) = \sum\_{i=0}^{19} \sum\_{j=0}^{19} u\_{i,j} \varphi\_{i,j}(x\_1, x\_2),

with \varphi\_{i, j}(x\_1, x\_2) = \cos(i \pi x\_1) \cos(j \pi x\_2).

A coarse mesh ~ 20 \times 20 grid points is sufficient =)

I would appreciate your help.
