# The problem definition in G. Sadaka's Wave Equation example

**URL:** <https://community.freefem.org/t/the-problem-definition-in-g-sadakas-wave-equation-example/1366>\
**Category:** General Discussion\
**Created:** [December 5, 2021, 10:20am UTC](https://community.freefem.org/t/the-problem-definition-in-g-sadakas-wave-equation-example/1366 "2021-12-05T10:20:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kilasuelika](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/kilasuelika/32/868_2.png) [@kilasuelika](https://community.freefem.org/u/kilasuelika)\
**Post date:** [December 5, 2021, 10:20am UTC](https://community.freefem.org/t/the-problem-definition-in-g-sadakas-wave-equation-example/1366/1 "2021-12-05T10:20:01Z")

</div>

G. Sadaka provide an [example](https://www.um.es/freefem/ff++/pmwiki.php?n=Main.WaveEquation)in solving Wave Equation. Math equation is:

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

The problem definition in Sadaka’s code is:

```auto
problem tambour(uh,vh) = int2d(Th)(uh*vh + Grad(uh)'*Grad(vh)*(c*dt)^2*.5 )
					+ int2d(Th)(Grad(uh0)'*Grad(vh)*(c*dt)^2*.5 ) 
					- int2d(Th)(2.*uh1*vh - uh0*vh)
					+ on(1,2,3,4,uh=0.);

```

I want to know why there is a `int2d(Th)(Grad(uh0)'*Grad(vh)*(c*dt)^2*.5 ) ` term (the 2nd row). If we approximate `u_tt` with `(u-2*u_{t-1}+u_{t-2})/(dt)^2` and set `u_{t-1}` to `uh1`, `u_{t-2}` to `uh0`, then we can get the 1st and 3rd row but not the 2nd.

---

<div class="post-metadata">

**Author:** ![kilasuelika](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/kilasuelika/32/868_2.png) [@kilasuelika](https://community.freefem.org/u/kilasuelika)\
**Post date:** [December 5, 2021, 11:40am UTC](https://community.freefem.org/t/the-problem-definition-in-g-sadakas-wave-equation-example/1366/2 "2021-12-05T11:40:59Z")

</div>

Finally I find that Sadaka use `(\Delta u+\Delta u_{t-1})/2` to approximate `\Delta u`，so there is a `.5` in the problem.
