Questions tagged [finite-difference-methods]
106 questions
9
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…
CFDIAC
- 103
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
$$…
italy
- 1,051
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…
silver58
- 31
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}$ …
quezac
- 31
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…
user312396
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…
AJHC
- 229
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…
Frank
- 910
3
votes
1 answer
Discretize derivative of heat flux with variable conductivity
How do i discretize this Temperature flow equation with the Fnite Difference method, when the conductivity K, is not constant?:
$$
\frac{\partial}{\partial x}\left(K\frac{\partial T}{\partial x}\right) +
\frac{\partial}{\partial…
Moh'd H
- 41
3
votes
1 answer
Crank-Nicolson for coupled PDE's
$\newcommand{\T}{T}$
$\newcommand{\partiald}[2]{\frac{\partial #1}{\partial #2}}$
$\newcommand{\partialdd}[2]{\frac{\partial^2 #1}{\partial #2^2}}$
I am trying to solve a set of coupled PDE's with the Crank-Nicolson method. So far I have used it to…
Kai
- 1,259
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…
italy
- 1,051
2
votes
2 answers
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.…
Physicist
- 293
- 1
- 7
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…
Deepak Gupta
- 21
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…
Bernhard Listing
- 833
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…
Schiav
- 23
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…
J.All
- 21