Question 8.7: Numerical partial differentiation. The following two-dimensi......

Numerical partial differentiation.

The following two-dimensional data for the x component of velocity u as a function of the two coordinates x and y is measured from an experiment:

x=1.0x=1.5x=2.0x=2.5x=3.0y=1.0163205250298349y=2.0228291361437517y=3.0265350448557676\begin{array}{llllll} & x=1.0 & x=1.5 & x=2.0 & x=2.5 & x=3.0 \\ y=1.0 & 163 & 205 & 250 & 298 & 349 \\ y=2.0 & 228 & 291 & 361 & 437 & 517 \\ y=3.0 & 265 & 350 & 448 & 557 & 676\end{array}

(a) Using central difference approximations, calculate ∂u/∂x, ∂u/(∂y), ∂²u/∂y², and ∂²u/∂x∂y at the point (2,2)

(b) Using a three-point forward difference approximation, calculate ∂u/∂x at the point (2,2).

(c) Using a three-point forward difference approximation, calculate ∂u/∂y at the point (2,1).

Step-by-Step
The 'Blue Check Mark' means that this solution was answered by an expert.
Learn more on how do we answer questions.

(a) In this part xi=2,yi=2,xi1=1.5,xi+1=2.5,yi1=1,yi+1=3,hx=0.5,hy=1x_{i}=2, y_{i}=2, x_{i-1}=1.5, x_{i+1}=2.5, y_{i-1}=1, y_{i+1}=3, h_{x}=0.5, h_{y}=1.

Using Eqs. (8.59) and (8.60),

fxx=xiy=yi=f(xi+1,yi)f(xi,yi)hx(8.59)fyx=xiy=yi=f(xi,yi+1)f(xi,yi)hy(8.60)\begin{aligned} & \left.\frac{\partial f}{\partial x}\right|_{\substack{x=x_i \\ y=y_i}}=\frac{f\left(x_{i+1}, y_i\right)-f\left(x_i, y_i\right)}{h_x} \qquad (8.59) \\ & \left.\frac{\partial f}{\partial y}\right|_{\substack{x=x_i \\ y=y_i}}=\frac{f\left(x_i, y_{i+1}\right)-f\left(x_i, y_i\right)}{h_y} \qquad (8.60) \end{aligned}

the partial derivatives ∂f/∂x and ∂u/∂y are:

uxx=xiy=yi=u(xi+1,yi)u(xi1,yi)2hx=u(2.5,2)u(1.5,2)20.5=4372911=146uyx=xiy=yi=u(xi,yi+1)u(xi,yi1)2hy=u(2,3)u(2,1)21=4482502=99 \begin{gathered} \left.\frac{\partial u}{\partial x}\right|_{\substack{x=x_{i} \\ y=y_{i}}}=\frac{u\left(x_{i+1}, y_{i}\right)-u\left(x_{i-1}, y_{i}\right)}{2 h_{x}}=\frac{u(2.5,2)-u(1.5,2)}{2 \cdot 0.5}=\frac{437-291}{1}=146 \\ \left.\frac{\partial u}{\partial y}\right|_{\substack{x=x_{i} \\ y=y_{i}}}=\frac{u\left(x_{i}, y_{i+1}\right)-u\left(x_{i}, y_{i-1}\right)}{2 h_{y}}=\frac{u(2,3)-u(2,1)}{2 \cdot 1}=\frac{448-250}{2}=99 \end{gathered}

The second partial derivative ∂²u/∂y² is calculated with Eq. (8.64):

2uy2x=xiy=yi=u(xi,yi1)2u(xi,yi)+u(xi,yi+1)hy2=250(2361)+44812=24 \left.\frac{\partial^{2} u}{\partial y^{2}}\right|_{\substack{x=x_{i} \\ y=y_{i}}}=\frac{u\left(x_{i}, y_{i-1}\right)-2 u\left(x_{i}, y_{i}\right)+u\left(x_{i}, y_{i+1}\right)}{h_{y}{ }^{2}}=\frac{250-(2 \cdot 361)+448}{1^{2}}=-24

The second mixed derivative ∂²u/∂x∂y is given by Eq. (8.65):

2uxyx=xiy=yi=[u(xi+1,yi+1)u(xi1,yi+1)][u(xi+1,yi1)u(xi1,yi1)]2hx2hy=[u(2.5,3)u(1.5,3)][u(2.5,1)u(1.5,1)]20.521=[557350][298205]20.521=57 \begin{aligned} & \left.\frac{\partial^{2} u}{\partial x \partial y}\right|_{\substack{x=x_{i} \\ y=y_{i}}}=\frac{\left[u\left(x_{i+1}, y_{i+1}\right)-u\left(x_{i-1}, y_{i+1}\right)\right]-\left[u\left(x_{i+1}, y_{i-1}\right)-u\left(x_{i-1}, y_{i-1}\right)\right]}{2 h_{x} \cdot 2 h_{y}} \\ & =\frac{[u(2.5,3)-u(1.5,3)]-[u(2.5,1)-u(1.5,1)]}{2 \cdot 0.5 \cdot 2 \cdot 1}=\frac{[557-350]-[298-205]}{2 \cdot 0.5 \cdot 2 \cdot 1}=57 \end{aligned}

(b) In this part xi=2,xi+1=2.5,xi+2=3.0,yi=2x_{i}=2, x_{i+1}=2.5, x_{i+2}=3.0, y_{i}=2, and hx=0.5h_{x}=0.5. The formula for the partial derivative ∂u/∂x with the three-points forward finite difference formula can be written from the formula for the first derivative in Section 8.4.

uxx=xiy=yi=3u(xi,yi)+4u(xi+1,yi)u(xi+2,yi)2hx==3u(2,2)+4u(2.5,2)u(3.0,2)20.5=3361+443751720.5=148 \begin{gathered} \left.\frac{\partial u}{\partial x}\right|_{\substack{x=x_{i} \\ y=y_{i}}}=\frac{-3 u\left(x_{i}, y_{i}\right)+4 u\left(x_{i+1}, y_{i}\right)-u\left(x_{i+2}, y_{i}\right)}{2 h_{x}}= \\ =\frac{-3 u(2,2)+4 u(2.5,2)-u(3.0,2)}{2 \cdot 0.5}=\frac{-3 \cdot 361+4 \cdot 437-517}{2 \cdot 0.5}=148 \end{gathered}

(c) In this part yi=1,yi+1=2,yi+2=3,xi=2y_{i}=1, y_{i+1}=2, y_{i+2}=3, x_{i}=2, and hy=1.0h_{y}=1.0. The formula for the partial derivative ∂u /∂y with the three-points forward difference formula can be written from the formula for the first derivative in Section 8.4.

uyx=xiy=yi=3u(xi,yi)+4u(xi,yi+1)u(xi,yi+2)2hy==3u(2,1)+4u(2,2)u(2,3)21=3250+436144821=123 \begin{aligned} & \left.\frac{\partial u}{\partial y}\right|_{\substack{x=x_{i} \\ y=y_{i}}}=\frac{-3 u\left(x_{i}, y_{i}\right)+4 u\left(x_{i}, y_{i+1}\right)-u\left(x_{i}, y_{i+2}\right)}{2 h_{y}}= \\ & =\frac{-3 u(2,1)+4 u(2,2)-u(2,3)}{2 \cdot 1}=\frac{-3 \cdot 250+4 \cdot 361-448}{2 \cdot 1}=123 \end{aligned}

Related Answered Questions