# The impedance boundary condition in the FreeFem++

**URL:** <https://community.freefem.org/t/the-impedance-boundary-condition-in-the-freefem/2681>\
**Category:** General Discussion\
**Created:** [September 4, 2023, 12:47pm UTC](https://community.freefem.org/t/the-impedance-boundary-condition-in-the-freefem/2681 "2023-09-04T12:47:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![clthu](https://avatars.discourse-cdn.com/v4/letter/c/f04885/32.png) [@clthu](https://community.freefem.org/u/clthu)\
**Post date:** [September 4, 2023, 12:47pm UTC](https://community.freefem.org/t/the-impedance-boundary-condition-in-the-freefem/2681/1 "2023-09-04T12:47:56Z")

</div>

Dear all,  
I am trying to make the impedance boundary condition in the FreeFem++ to simulate the acoustic wave. I have found it a little puzzle when I solve the linear Euler equations for (ux,uy,p,rho) and use such a boundary condition on the outlet like p = i \* omega \* Z \* ux .  
I add **int1d(th, outlet)(1e30 \* (p - i \* omega \* Z \* ux) \* vx)** to my problem ( vx is my test function), but the results are not OK. Is there any suggestion or example for such problem?  
Thanks a lot.

---

<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:** [September 4, 2023, 2:25pm UTC](https://community.freefem.org/t/the-impedance-boundary-condition-in-the-freefem/2681/2 "2023-09-04T14:25:04Z")

</div>

The problem is you use a penalty method with eps = 1e-30 ( this is to big)

try with pena = 1e5 to 1e10 no more due to number of digits in double precision.

**int1d(th, outlet)(pena \* (p - i \* omega \* Z \* ux) \* vx)**
