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)
 
Thread 'Video on imaginary numbers and some queries'
Hi, I was watching the following video. I found some points confusing. Could you please help me to understand the gaps? Thanks, in advance! Question 1: Around 4:22, the video says the following. So for those mathematicians, negative numbers didn't exist. You could subtract, that is find the difference between two positive quantities, but you couldn't have a negative answer or negative coefficients. Mathematicians were so averse to negative numbers that there was no single quadratic...
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...
Thread 'Unit Circle Double Angle Derivations'
Here I made a terrible mistake of assuming this to be an equilateral triangle and set 2sinx=1 => x=pi/6. Although this did derive the double angle formulas it also led into a terrible mess trying to find all the combinations of sides. I must have been tired and just assumed 6x=180 and 2sinx=1. By that time, I was so mindset that I nearly scolded a person for even saying 90-x. I wonder if this is a case of biased observation that seeks to dis credit me like Jesus of Nazareth since in reality...
Back
Top