Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [finite-difference-methods]

1
vote
0answers
20 views

How to implement Finite Difference Method ODE Boundary Value Problem in Python?

I implemented the Finite Differences Method for an ODE with Boundary Value Problem. Here is the approximations I used for the FDM: And here is the balk problem: with u(0) = u(L) = 0 (attached on ...
1
vote
1answer
18 views

Truncation error when applying a finite difference scheme to solve $u_x +Au_t = 0$

The wave equation in one space dimension is given as $$ u_t + Au_x = 0 $$ where $$ u := \begin{bmatrix} v(x,\, t) \\ w(x,\, t) \end{bmatrix}, \quad A = \begin{bmatrix} 0 & -1 \\ -1 & 0 \end{...
0
votes
0answers
12 views

Error analysis of finite difference method

Let's denote finite difference method by FDM. Let differential operator d/dx = D from 2nd order FDM, D^2 y= [y_(n+1) - 2y_n + y_(n-1)]/(DELTA x)^2 and it's error will be error = (DELTA x)^2 D^4 y ...
0
votes
0answers
17 views

Solving fourth order diffusion type equation using Finite Difference method

I am trying to solve a fourth order partial differential equation $$ {\partial u\over \partial t} = i{\partial^4 u\over \partial x^4} $$ where $i=\sqrt{-1}$ and periodic boundary conditions. I tried ...
1
vote
1answer
23 views

Derivation Sought for Solution of 1D Finite-Difference Equation

Context: This question arises from https://www.dartmouth.edu/~chance/teaching_aids/books_articles/probability_book/Chapter11.pdf (specifically problem 26 on page 427). The problem asks one to prove ...
0
votes
0answers
10 views

Prove neumann stable if condition met on operator

Please tell me if this is correct : Prove : A finite difference method realization is neumann stable provided for each $n$ and $i$ $|c_i^{n+1}|\leq |c_i^n|$. I think Neumann stable means $u^{n+1}\...
2
votes
1answer
22 views

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 ...
0
votes
0answers
16 views

Finite Difference Methods Optimal Weights

I am looking at a paper by Ronald Smith 1999, (attached). The optimal weights he claims, obtains exact results for the Area, Centroid, Variance, Skewness and Kurtosis of solutions to the unforced ...
0
votes
0answers
14 views

Eigenvalues of 1D laplacian discretized matrix

I have the matrix resulting form the finite difference discretization and now I should find its eigenvalues. the text of the exercise is Hint: Write out a typical equation of the system $Aw = λw$ ...
0
votes
0answers
12 views

Inconsistent finite difference scheme

I have the following: The Equation $$b\frac{\partial u}{\partial t} + \frac{\partial u}{\partial t} - c(x,t) = 0$$ b is a constant. The Equation is approximated at point $(x_i, t^n)$ in the $x-...
0
votes
0answers
57 views

Finite difference for non-uniform unstructured mesh/stencil

Below I have shown my non-uniform unstructured mesh (as in there is no pattern between the relative size of $h_i$ and $h_{i+1}$ etc. I've made the following equations using nodes $i-1$, $i$, and $i+1$...
1
vote
1answer
32 views

Finite difference stability problem

My apologies for the title I'm not quite sure how to title a problem like this. I need to show the following result: $$u_j^{n+1} = e^{\Delta t\partial/\partial t}u_j^n$$ Where $u_j^n$ is the ...
0
votes
1answer
25 views

$k$th order backward difference reduces $k$th degree polynomial

$X_t$ is a degree $k$ polynomial at $t$. How to deduce that $\triangledown ^kX_t$ is a constant?
2
votes
1answer
15 views

Simplifictaion: Taylor series expansion $U(x,t)$ about point $\bigg(x+\frac{1}{2}h , t\bigg)$

I am required to expand the $\partial_x^2U(x,y)$ in terms of a finite difference expression about the point (x+\frac{h}{2},t) instead of the usual $(x,t)$ point. This means one will get: $$ \partial_x^...
2
votes
1answer
99 views

Discretization of second order nonlinear ODE using finite difference approximation not correct

I have the differential equation $$y'' + x(y^2)' - 2y^2 = g(x) \Longleftrightarrow y'' + x2yy'-2y^2 = g(x).$$ Using finite-difference approximations $$y''(x_m) \approx \frac{Y_{m-1} - 2Y_m + Y_{m+1}}{...
0
votes
1answer
30 views

2 Layer Finite Difference Scheme PDE

I have this PDE, and I need to build a 2 layer Finite Difference scheme for it. $\frac{∂^2}{∂x^2}(k(x,t) \frac{∂^2U(x,t)}{∂t^2})=0$ k is just a parameter, which is dependent on x and t. The problem ...
0
votes
0answers
40 views

finite difference method to the delayed damped wave equation

I want to do the numerical simulations in MATLAB for the following partial delay differential equations with Dirichlet boundary condition. I need to know the simplest method to do that. \begin{...
0
votes
0answers
9 views

Error for forward difference

I got this formula for some notes for the maximum error of a central difference: $$\epsilon_{max}= \frac{M\Delta x^2}{3!} \,\, \text{Such that } \, M=max\{|f^{(3)}(x)|:x\in[A,B]\} $$ Can someone tell ...
0
votes
0answers
344 views

Finite Difference Method for second order ODE in MATLAB

I have an ordinary differential equation, $$\frac{d^2Y}{dX^2} - \frac{1}{R} \frac{dY}{dX} = 0,$$ where $R$ is a constant. I have to numerically integrate this ODE for a range from $0$ to $1$ using the ...
0
votes
1answer
48 views

Approximation of first derivative at $x_0$ using Five-point endpoint formula

Find the $f'(x=0)$ using Five-point endpoint formula. where $f$ is a long vector of length $n$, say $n=11$. ...
0
votes
0answers
4 views

Clarification on boundary condition and solution

I am attaching a photo of solved example for finite difference method. I have not understood the boundary condition at line two....should it not be at x=5 and y=4?(marked in pencil) Also in the third ...
0
votes
0answers
21 views

Numerical method for ODEs without frequency error

To solve an ODE numerically, one usually use finite difference methods. For example, simple harmonic oscillator, i.e. $$y''=-\omega^2y$$ can be discretized by $$\frac{y_{n+1}-2y_n+y_{n-1}}{\...
0
votes
0answers
30 views

Finite difference method in 2d

I know the value of a function, u, in N points on the boundary of a disk (i.e. a circle). I need to find the value of its gradient, $\nabla u$, in those points. How can I use the Finite Difference ...
1
vote
0answers
76 views

discretizing the convection-diffusion equation using finite difference method

I am new to to the finite difference method and I want to understand how a convection-diffusion equation is discretized in 2-D by using central differences: $$\nabla\cdot(\rho \vec{v} \Phi)=\nabla\...
0
votes
1answer
56 views

Finite Differences for Boundary Value Problems

I was presented with the following equation that has to be solved using Finite Difference Method in MATLAB. However, I am very lost here. I can't really figure it out how to put this in a matrix and ...
0
votes
0answers
13 views

Truncation error on a non-uniform finite difference scheme

For a function $f(r)$ defined on the grid, we write $f_j$ = $f(r_j)$, and the Taylor series expansions of $f_{j+1}$ and $f_{j-1}$ are given by, \begin{equation} f_{j+1} = f_j + dr_{j+1} \frac{df}{dr}\...
0
votes
1answer
90 views

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}\...
0
votes
0answers
16 views

Error estimate of a two-point boundary valued problem using the central finite difference method

I met the following problem in my homework and I have no idea how to start it. Consider the following two-point boundary value problem $$ -u''+q(x)u=f(x), \ \ u(0)=u(1)=0$$ with $f\in L^2([0,1])$, ...
0
votes
0answers
39 views

How to solve Fick's second law of diffusion (second order differential in space and first order in time ) for a ternary or higher order systems?

For a binary system Fick's second law can be solved, using Crank-Nicholson scheme followed by Gauss elimination and substitution (Thomas Algorithm). However, for a ternary system, there will be two ...
2
votes
0answers
50 views

Approximating finite differences by higher order derivatives of continuous functions

In a mathematical physics exercise, some discrete fields can conveniently be expressed using finite difference schemes as follows: \begin{align} A_6 &= \phi_{i+1}+\phi_{i-1}+4\phi_i \, , \\ A_7 &...
0
votes
0answers
43 views

Finite difference method in an infinite domain

I am trying to simulate the Schrodinger equation for a system inside a region that is finite in the vertical direction (so there is a boundary condition that must be satisfied) but infinite in the ...
2
votes
1answer
142 views

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 ...
4
votes
2answers
517 views

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
votes
0answers
47 views

Leap Frog/Multi step method stability

Background The finite difference Euler method is \begin{eqnarray} y_{n+1} &=& T(y_n,t_n)\\ &=& y_{n} + hf(y_n,t_n). \end{eqnarray} Then for some perturbation $\delta$ \begin{...
0
votes
1answer
48 views

Finite Difference Equation From a Non-Linear Equation

Given a Non-Linear Equation that is: $$I\ddot\theta = mgl \cdot \sin \theta + F_D \cdot l + k\theta $$ Where, $$F_D$$ is representative of Drag Force and is equal to: $$-1/2C_D\rho Av^2\cdot \...
2
votes
1answer
53 views

Finite difference method, boundaries

I have a problem solving this problem. $$ −3u''(x) + (x + 2)u(x) = 4x, \hspace{10pt} x \in (−1, 1), $$ subject to $$ u'(−1) + 4u(−1) = 3, \hspace{10pt} −u'(1) + 2u(1) = 0,\hspace{10pt} h=0.001 $$ ...
1
vote
1answer
220 views

Advection equation with discontinuous initial condition

I'm trying to solve in MatLab/Octave the advection equation, with $a > 0$ : $$\begin{cases} u_t + au_x=0\\ u(x,0)=u^{0}(x) \end{cases}$$ with $u^{0}(x)=\begin{cases} 1.5 \quad x<0 \\0.5 \quad ...
1
vote
2answers
55 views

Need help with inequality to understand stability analysis

I have this $$ | \xi |^{2} = 1 - 4p^{2}(1-p^{2})s^{4}$$ where $s = \sin\left(\frac\omega 2 \right)$. The method is said to be stable if $ | \xi|\leq1$. From here I am supposed to deduce that this ...
0
votes
0answers
21 views

information regarding numerics of pde

I am learning conservation laws at the moment and now I have to start numerical solutions of the pde. I have to do finite volume schemes, it is advisable to go through finite difference first and then ...
3
votes
2answers
1k views

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 \...
1
vote
1answer
510 views

Help deriving Lax-Wendroff scheme for advection equation $u_t+c(x)u_x = 0$

Question 1: Consider the wave equation $$ u_t + c(x) u_x = 0 , $$ where $x\in \Omega \subset \Bbb R$ and $c(x)$ is a function of $x$. (a) Show that the Lax-Wendroff scheme for this PDE is ...
0
votes
1answer
34 views

Central Differences to Solve Boundary-Value Problem (General Case)

I have the following boundary-value problem (BVP): \begin{align*} -a(x)u''+b(x)u'+c(x)u = f(x) && \text{for $0 \leq x \leq L$,}\\ \alpha_0u'+\beta_0u=\gamma_0 && \text{at x = 0,}\\ \...
0
votes
0answers
325 views

Mixed derivative finite difference

In my research work, I differentiated the following equation with respect to t $$\frac{\partial^2 u}{\partial t^2}=x(1-x)\frac{\partial^2 u}{\partial x^2}-(\omega^2-2)u$$ to get $$\frac{\partial^3 ...
1
vote
0answers
24 views

write second order difference as a convolution operator

For $h>0$, let \begin{equation} \phi(x) = \begin{cases} h+x, \quad \text{if} \quad -h\le x\le 0,\\ h-x, \quad \text{if} \quad \hspace{5mm}0\le x\le h,\\ 0, \quad \hspace{8mm}\text{otherwise}. \end{...
0
votes
1answer
63 views

Finite difference approximation of $u''(x)+u(x)=0, u(0)=1, u(\pi)=-1$

Finite difference approximation of $u''(x)+u(x)=0, u(0)=1, u(\pi)=-1$. For the approximation for this, do I get: $$\frac{1}{h^2}(U_{j-1}-2U_j+U_{j+1})+U_j$$ $$=\frac{1}{h^2}(U_{j-1}+(h^2-2)U_j+U_{j+...
2
votes
0answers
77 views

Particular order for a BVP problem with finite differences

I'm solving this BVP problem. $u''(x) + u^2(x) = \frac{15}{4} |x|^{1/2} + |x|^5$, $u(-1)=u(1)=1$, $x \in A=(-1,1)$. The solution is $u(x)=|x|^{5/2}$. What can we say about the ...
0
votes
0answers
162 views

Numerical Solution for the fourth order PDE?

I have a PDE in the form: $$ \frac{\partial^2 y}{\partial t^2} + \frac{\partial^4 y}{\partial x^4} = 0 $$ with boundary conditions $$ y(0,t) = 0 = y(1,t) $$ $$ \frac{\partial y}{\partial x}(0,t) = 0 ...
0
votes
0answers
53 views

Solving the PDE for elastic filament in viscous liquid

I want to solve the following 4th order PDE with the boundary conditions as written. It would be really helpful if someone could guide me on how to solve this. I have tried implicit finite ...
2
votes
0answers
58 views

How to applied finite difference into partial equation?

I am trying to use finite difference method to numerically solve a pair of partial differential equation by using Matlab. So far, this is my working . Did my working calculation on finite ...
0
votes
0answers
71 views

How to show stability for this discretization?

I am studying the 1D wave equation: $$ \frac{\partial^2u}{\partial t^2} - a^2 \frac{\partial^2u}{\partial x^2} = 0 $$ And solving it numerically with this implicit finite differences discretization: ...