3

Obviously, Taylor expansion for $(a(x)\cdot u'(x))'$ is to be used somehow, but I'm not sure how to start at all... The scheme that I'm looking to derive is actually $\frac{(a\cdot u_{\bar{x}})_{x}+(a\cdot u_{x})_{\bar{x}}}{2}$, where $v_{x}=\frac{v(x+h)-v(x)}{h}$ is forward difference and $v_{\bar{x}}=\frac{v(x)-v(x-h)}{h}$ is backward difference (and $h$ is, of course, finite differences grid step), but any other scheme, or a hint on how to start constructing a scheme, would do.

Crni
  • 647
  • Does the asterisk denote convolution? I'm guessing not, but it's hard to be sure sometimes. Also, perhaps due to not being a numerical analyst, I don't understand what a difference sceme for an operator is. What is the underlying problem? – Harald Hanche-Olsen Dec 29 '14 at 13:12
  • Also, you might want to post your second question separately, it's a bit more interesting. – user14717 Dec 29 '14 at 13:15
  • Sorry, the asterisk was there to denote multiplication, I've replaced it with $\cdot$. The underlying problem is as follows: Given boundary value problem $(a(x)\cdot u'(x))'-d(x)=f(x)$ for $x\in(0,L)$ and $u(0)=u(L)=0$, construct finite difference scheme to approximate values of $u(x_{i})$ in points $x_{i}=i\cdot h$, where $i=1,\ldots,N-1$ and $h=\frac{L}{N}$. Of course, inputs $a(x)$, $d(x)$ and $f(x)$ are satisfying appropriate differentiability requirements: $a(x)\in C^{1}[0,L]$, $d(x)\in C[0,L]$ and $f(x)\in C[0,L]$. – Crni Dec 29 '14 at 13:26

2 Answers2

2

You need a fourth-order accurate first derivative finite-difference approximation so that when it's multiplied by another fourth order accurate first derivative, it becomes third-order accurate. A fourth-order accurate first derivative is given by \begin{align} \frac{d}{dx}u(x) = \frac{u(x-2h)-8u(x-h) + 8u(x+h)-u(x+2h)}{12h} + \mathcal{O}(h^{4}) \end{align} and a fourth order accurate second derivative is given by \begin{align} \frac{d^2}{dx^{2}}u(x) = \frac{u(x+h) -2u(x) + u(x-h)}{h^2} + \mathcal{O}(h^{2}) \end{align} Using the product rule, we have \begin{align} \frac{d}{dx}\left(a(x)\frac{d}{dx} u(x) \right) &= \frac{d}{dx}a(x) \frac{d}{dx}u(x) + a(x) \frac{d^2}{dx^{2}}u(x) \\ &= \left(\frac{u(x-2h)-8u(x-h) + 8u(x+h)-u(x+2h)}{12h}\right)\\&\phantom{=}\cdot\left(\frac{a(x-2h)-8a(x-h) + 8a(x+h)-a(x+2h)}{12h}\right) \\ &\phantom{=} + a(x)\frac{u(x+h) -2u(x) + u(x-h)}{h^2} + \mathcal{O}(h^{2}) \end{align}

user14717
  • 4,902
  • Do you mean that someone has already told you that this is the solution, and you need to show that it is $\mathcal{O}(h^2)$? – user14717 Dec 29 '14 at 14:22
  • Yes, that's correct - I'm reading lecture notes on the analysis of finite difference schemes, and it is said that the scheme mentioned in my first post is $\mathcal{O}(h^2)$, so I'm trying to derive the scheme in order to prove that (it's not homework, just a side note really, but I'm wondering how would one be able to derive a scheme like this one). – Crni Dec 29 '14 at 14:37
  • I replaced an asterisk of yours by a dot. Asterisks are for convolutions! (Pet peeve of mine, sorry.) – Harald Hanche-Olsen Dec 29 '14 at 15:51
  • @HaraldHanche-Olsen: You're completely right. I think the typesetting of that equation is a total mess-I need more space! – user14717 Dec 29 '14 at 15:53
2

A very useful second order accurate discretisation is given by

$$(au')' = \frac{a_{x+h/2}u_{x+h} + a_{x-h/2}u_{x-h} - (a_{x-h/2}+a_{x+h/2})u_x}{h^2} + \mathcal{O}(h^2)$$

where $a_{x\pm h/2} \equiv \frac{1}{2}(a_x + a_{x\pm h})$. To prove that this discretisation is second order follows from writing

$$(au')' = au'' + a'u'$$

The first term to second order is

$$au'' = a_x\frac{u_{x+h} + u_{x-h}-2u_x}{h^2} + \mathcal{O}(h^2)$$

The second term to second order is

$$a'u' = \frac{1}{2}\left(\frac{u_{x+h} - u_x}{h}\frac{a_{x+h} - a_x}{h} + \frac{u_{x-h} - u_x}{h}\frac{a_{x-h} - a_x}{h}\right) + \mathcal{O}(h^2)$$

This follows from

$$\frac{u_{x+h} - u_x}{h}\frac{a_{x+h} - a_x}{h} = [u_x' + u_x'' \frac{h}{2} + \mathcal{O}(h^2)][a_x' + a_x'' \frac{h}{2} + \mathcal{O}(h^2)]$$ $$\frac{u_{x-h} - u_x}{h}\frac{a_{x-h} - a_x}{h} = [-u_x' + u_x'' \frac{h}{2} + \mathcal{O}(h^2)][-a_x' + a_x'' \frac{h}{2} + \mathcal{O}(h^2)]$$

By combinding the two discretisations for $au''$ and $a'u'$ we obtain the discretisation quoted in the begining.

Winther
  • 24,478
  • That's a nice method to keep it on a small stencil--never seen that before. But doesn't dividing the $\mathcal{O}(h^2)$ approximation of $(au')_{x+h}$ by $h$ make the scheme $\mathcal{O}(h)$? – user14717 Dec 29 '14 at 14:41
  • @NickThompson I have used it quite often, to solve highly non-linear 3D PDE (which have nasty stability properties), and it works very well in practice and is surprisingly stable numerically. – Winther Dec 29 '14 at 14:44
  • @NickThompson Thanks for your comment, it made me spot the error in the discretisation I had. – Winther Dec 29 '14 at 16:05
  • Many thanks both to Nick Thompson and Winther for comments. It does not look that complicated now, albeit certainly I would not be able to derive it myself; I hope it will come with experience... – Crni Dec 29 '14 at 17:22