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)
 
Seemingly by some mathematical coincidence, a hexagon of sides 2,2,7,7, 11, and 11 can be inscribed in a circle of radius 7. The other day I saw a math problem on line, which they said came from a Polish Olympiad, where you compute the length x of the 3rd side which is the same as the radius, so that the sides of length 2,x, and 11 are inscribed on the arc of a semi-circle. The law of cosines applied twice gives the answer for x of exactly 7, but the arithmetic is so complex that the...
Thread 'Imaginary Pythagoras'
I posted this in the Lame Math thread, but it's got me thinking. Is there any validity to this? Or is it really just a mathematical trick? Naively, I see that i2 + plus 12 does equal zero2. But does this have a meaning? I know one can treat the imaginary number line as just another axis like the reals, but does that mean this does represent a triangle in the complex plane with a hypotenuse of length zero? Ibix offered a rendering of the diagram using what I assume is matrix* notation...
Fermat's Last Theorem has long been one of the most famous mathematical problems, and is now one of the most famous theorems. It simply states that the equation $$ a^n+b^n=c^n $$ has no solutions with positive integers if ##n>2.## It was named after Pierre de Fermat (1607-1665). The problem itself stems from the book Arithmetica by Diophantus of Alexandria. It gained popularity because Fermat noted in his copy "Cubum autem in duos cubos, aut quadratoquadratum in duos quadratoquadratos, et...
Back
Top