MHB Order of Accuracy for Finite Difference Method Backward Euler

  • Thread starter Thread starter evinda
  • Start date Start date
  • Tags Tags
    Accuracy
AI Thread Summary
The discussion focuses on calculating the order of accuracy for the finite difference method using the backward Euler scheme applied to the heat equation. The user has implemented a code to approximate the solution and is seeking clarification on whether varying the number of spatial subintervals (N_x) is necessary to determine the order of accuracy. They report obtaining a value of approximately 0.1008 for the order of accuracy with specific subinterval settings but expect it to approach 2. The user is questioning if there might be an error in their code affecting the accuracy result. The conversation emphasizes the importance of correctly assessing the order of accuracy in numerical methods.
evinda
Gold Member
MHB
Messages
3,741
Reaction score
0
Hello! (Wave)
We are given the boundary / intial value problem for the heat equation:

$\left\{\begin{matrix}
u_t(t,x)=u_{xx}(t,x), \ \ x \in [a,b], \ \ t \geq 0\\
u(0,x)=u_0(x), \ \ \forall x \in [a,b] \\
u(t,a)=u(t,b)=0, \ \ \forall t \geq 0
\end{matrix}\right.$

I have written a code to approximate the solution of the problem.

How do we calculate the order of accuracy of the finite difference method backward euler?

I have found the error $$E^n=\max_{1 \leq i \leq N_x+1}|u^n_i-u(t_n, x_i)|, n=1, \dots, N_t+1$$

Do we have to take different values for $N_x$ to find the order of accuracy? (Thinking)
 
Mathematics news on Phys.org
I have tried the following:function [p1]=order_fin_dif_back_euler [u1, ex1]=finite_difference_backward - Pastebin.com

The first two arguments of the function [m]finite_difference_backward_euler[/m] stands for the interval $[a,b]$, the third is the number of subintervals of this interval, the fourth one is $T_f$ ($t \in [0,T_f]$) , the last argument is the number of subintervals of $[0,T_f]$.

For [m]number of subintervals of [a,b]=20[/m] and [m]number of subintervals of [0,T_f]=400[/m] I got that:
[m]p1 = 0.1008[/m]The order of accuracy should tend to $2$. Is there a mistake at my code? (Thinking)
 
Suppose ,instead of the usual x,y coordinate system with an I basis vector along the x -axis and a corresponding j basis vector along the y-axis we instead have a different pair of basis vectors ,call them e and f along their respective axes. I have seen that this is an important subject in maths My question is what physical applications does such a model apply to? I am asking here because I have devoted quite a lot of time in the past to understanding convectors and the dual...
Insights auto threads is broken atm, so I'm manually creating these for new Insight articles. In Dirac’s Principles of Quantum Mechanics published in 1930 he introduced a “convenient notation” he referred to as a “delta function” which he treated as a continuum analog to the discrete Kronecker delta. The Kronecker delta is simply the indexed components of the identity operator in matrix algebra Source: https://www.physicsforums.com/insights/what-exactly-is-diracs-delta-function/ by...
Back
Top