Artificial intelligent assistant

In solutions to Wave eq. that involve "ghost points", how are the values at ghost points found? In solutions to Wave eq. that involve "ghost points", how are the values at ghost points found? It seesm that different BCs lead to the need for using "ghost points". Such as $u_x(0,t)=u_x(1,t)=0$, however I don't understand how to use the BCs to decide on the ghost values. For example, here it's written that: > For a boundary condition $u_x=0$, the ghost value must equal the value at the associated inner mesh point. But why is this?

The linked web page concerns finite-difference methods applied to the wave equation $u_{tt}-c^2u_{xx}=0$ for $x\in[0,1]$. Both the time derivative and the space derivative are discretized using second-order centered finite differences. Using the notation $u_i^n \simeq u(i\Delta x,n\Delta t)$, the time-stepping procedure reads $$ u_{i}^{n+1} = -u_{i}^{n-1} + 2u_i^n + \left(\frac{c\Delta t}{\Delta x}\right)^2 (u_{i+1}^n - 2 u_i^n + u_{i-1}^n) \, . $$ Therefore, the stencil requires that one ghost cell is added on each side of the spatial domain. The ghost cell at $x=0$ has index $i=-1$. The homogeneous Neumann boundary condition $u_x|_{x=0} = 0$ is discretized using second-order centered finite differences too: $$ 0 = u_x|_{x=0} \simeq \frac{u_{1}^n-u_{-1}^n}{2\Delta x} \, , $$ i.e. $u_{-1}^n = u_1^n$ at all times. The ghost cell value is equal to the interior cell value.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy d528701867db5ec82ac4f89de494d90d