Questions tagged [finite-difference-methods]

113 questions
7
votes
3 answers

Finite differences second derivative as successive application of the first derivative

The finite difference expressions for the first, second and higher derivatives in the first, second or higher order of accuracy can be easily derived from Taylor's expansions. But, numerically, the successive application of the first derivative, in…
4
votes
1 answer

Discrete entropy inequality for scalar conservation laws

Consider a scalar conservation law $u_t+f(u)_x=0.$ A three point monotone scheme given by, \begin{eqnarray} u_i^{n+1}=u_i^{n}-\lambda (F(u_i^n,u_{i+1}^n)-F(u_{i-1}^n,u_i^n)) \end{eqnarray} where $F(u,u)=f(u).$ For a general entropy flux pair…
4
votes
2 answers

Local truncation error of Crank-Nicolson for PDE $u_t+au_x = 0$

Exercise 4: The Crank-Nicolson scheme for $u_t + a u_x = 0$ is given by $$ \frac{U_{j,n+1}-U_{j,n}}{\Delta t} + \frac{a}{2}\frac{D_xU_{j,n}}{2\Delta x} + \frac{a}{2}\frac{D_xU_{j,n+1}}{2\Delta x} = 0 .$$ Show that the LTE is given by $$…
3
votes
1 answer

Truncation error, finite differences

Consider the following FDM problem: Find $u$ such that $$ -u^{\prime \prime}(x)+b(x) u^{\prime}(x)+c(x) u(x)=f(x) ~~\text { in }(0,1), $$ and conditions $u(0) = u(1) = 0$, where $$ b(x)=x^{2}, \qquad c(x)=1+x, \qquad f(x)=-2+13 x^{2}+3…
3
votes
0 answers

How to use finite difference in this situation?

I want to compute Dupire's local volatility, but I'm struggling since several days. Here is the formula to get the local variance, with $y=\ln \left(\frac{ K}{F} \right)$ and $w=\sigma_{BS}^2\,T$, and I get $\sigma_{BS}$ from $\tilde{BS}^{-1}$ …
3
votes
1 answer

Numerical method for steady-state solution to viscous Burgers' equation

I am reading a paper in which a specific partial differential equation (PDE) on the space-time domain $[-1,1]\times[0,\infty)$ is studied. The authors are interested in the steady-state solution. They design a finite difference method (FDM) for…
3
votes
2 answers

Error in Crank-Nicolson scheme for diffusion equation

I'm solving the diffusion equation $$\frac{\partial u}{\partial t}=D\frac{\partial^2u}{\partial^2x}$$ subject to the BCs $\partial_xu(x=0)=0$ and $u(x)=1$, using the Crank Nicolson scheme. For the middle points I'm using…
3
votes
1 answer

Intuition behind convergence and consistency

What is the definition of consistency? I have seen a proof that shows a finite difference scheme is consistent, where they basically plug a true solution $u(t)$ into a finite difference scheme, and they get every term, for example $u^{i+1}_{j}$ and…
3
votes
2 answers

Lax-Wendroff method for linear advection - Matlab code

$$ {\bf u}^{n+1} = {\bf u}^{n} - \frac{\Delta t}{2 \Delta x} {\bf c}.^*({\bf D}_{\bf x}{\bf u}^n) + \frac{\Delta t^2}{2 \Delta x^2} {\bf c}^2.^*({\bf D}_{\bf x x}{\bf u}^n) + \frac{\Delta t^2}{8 \Delta x^2} {\bf c}.^*({\bf D}_{\bf x}{\bf…
2
votes
1 answer

fourth-order finite difference for $(a(x)u'(x))'$

Previously I asked here about constructing a symmetric matrix for doing finite difference for $(a(x)u'(x))'$ where the (diffusion) coefficient $a(x)$ is spatially varying. The answer provided there works for getting a second order accurate method.…
2
votes
2 answers

Numerical Solution of nonlinear P-B Equation in unbounded domain for determining the EDL potential distributions around a spherical particle

For my project I am studying a paper, namely "Perturbation solutions for the nonlinear Poisson–Boltzmann equation with a higher order-accuracy Debye–Huckel approximation" by Cunlu Zhao, Qiuwang Wang and Min Zeng, Zeitschrift für angewandte…
2
votes
1 answer

Determining if a difference operator is of positive type

My question is about c. As per the definition, a difference operator $L_hU_m:=-a_mU_{m-1}+b_mU_m-c_mU_{m+1}$ is positive type if $a_m\geq0$, $c_m\geq0,$ $b_m\geq a_m+c_m$, and $b_m>0$. Application of central difference for both the first and second…
2
votes
1 answer

Change in a weighted average due to exit

I've been struggling with this for a while, but I am not smart enough to figure it out. Suppose I have a weighted average of an economic variable $x$ across $n$ firms: $$x=\sum_{i=1}^{n}x_i\lambda_i$$ where $\lambda_i=L_i/L$ is the employment share…
2
votes
0 answers

Implementing Crank-Nicolson scheme for 1-D wave equation

I am trying to implement the Crank-Nicolson scheme directly for the second order wave equation by replacing $E^n$ terms in spatial derivative with $(E^(n-1)+2E^(n)+E^(n+1))/4$. I am sure I have obtained the coefficients correctly as I have checked…
2
votes
0 answers

How can I linearize sine-Gordon PDE to apply Von Neumann stability analysis?

Specifically, I have this equation $\frac{\partial^{2}u}{\partial t^{2}}(x, t) = \frac{\partial^{2}u}{\partial x^{2}}(x, t) -sen(u(x, t)); \quad L_{0} \le x \le L_{1}; \quad t \geq t_{0}$ and them I applied the finite difference method and found…
1
2 3 4 5 6 7 8