# Question on boundary conditions in DiffEqOperators.jl for 2D-case

**URL:** https://discourse.julialang.org/t/question-on-boundary-conditions-in-diffeqoperators-jl-for-2d-case/33079
**Category:** Numerics
**Tags:** question
**Created:** [January 7, 2020, 8:46pm UTC](https://discourse.julialang.org/t/question-on-boundary-conditions-in-diffeqoperators-jl-for-2d-case/33079 "2020-01-07T20:46:46Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Eben60](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/eben60/32/13475_2.png) [@Eben60](https://discourse.julialang.org/u/Eben60)
#### Post date: [January 7, 2020, 8:46pm UTC](https://discourse.julialang.org/t/question-on-boundary-conditions-in-diffeqoperators-jl-for-2d-case/33079/1 "2020-01-07T20:46:47Z")

</div>

I just started to play around with DiffEqOperators. I’d like to extend the example at  
[https://github.com/JuliaDiffEq/DiffEqOperators.jl/blob/master/examples/poisson.jl](https://github.com/JuliaDiffEq/DiffEqOperators.jl/blob/master/examples/poisson.jl) to a 2D case.

Here is the adapted code:

```julia
using DiffEqOperators, Plots

f = 5.0
a = -1.0
b = 2.0

nknots = 10
h = 1.0/(nknots+1)
ord_deriv = 2
ord_approx = 2

Δ = CenteredDifference(ord_deriv, ord_approx, h, nknots)
bc = DirichletBC(a, b)

u = (Δ*bc) \ fill(f, (nknots, nknots))

knots = range(h, step=h, length=nknots)
plot(knots, u[nknots÷2, 1:end])
plot!(knots, u[1:end, nknots÷2])

```

It works somehow - but so to say in 1D ![Bildschirmfoto 2020-01-07 um 21.39.12](https://global.discourse-cdn.com/julialang/original/3X/2/c/2cddbd7bfd99632d8b22b8296ce390d93067e3b5.png)

So, my question: How do I define the BC for 2D (or more)? Or maybe there are more things to be changed in the script?
