How do we choose the number of subintervals?

  • Context: MHB 
  • Thread starter Thread starter evinda
  • Start date Start date
Click For Summary

Discussion Overview

The discussion centers on the selection of the number of subintervals, denoted as \(N_x\) and \(N_t\), for approximating the solution of the heat equation using uniform partitions. Participants explore criteria for determining these values in the context of boundary and initial value problems.

Discussion Character

  • Technical explanation, Conceptual clarification, Debate/contested

Main Points Raised

  • One participant describes their approach to partitioning the interval \([a,b]\) into \(N_x\) subintervals and \([0,T_f]\) into \(N_t\) subintervals for numerical approximation.
  • Another participant suggests that if the exact solution is not available, one could verify the adequacy of the partition by checking the convergence of solutions as the subintervals are refined, using a tolerance metric.
  • A later reply clarifies that in this case, since the exact solution is known, the comparison should be made directly between the approximation and the exact solution, recommending a method involving evaluating differences at random points in the \((x,t)\) plane.

Areas of Agreement / Disagreement

Participants generally agree on the need for a method to evaluate the adequacy of the partition, but there is a divergence in approaches based on whether the exact solution is known or not.

Contextual Notes

The discussion does not resolve the specific criteria for choosing \(N_x\) and \(N_t\), and assumptions regarding the nature of the solution and the method of comparison remain implicit.

evinda
Gold Member
MHB
Messages
3,741
Reaction score
0
Hello! (Wave)

I have written a code to approximate the solution of the heat equation. I want to consider uniform partitions in order to approximate the solution of the given boundary / initial value problem.

So we partition $[a,b]$ in $N_x$ subintervals with length $h=\frac{b-a}{N_x}$, where the points $x_i, i=1, \dots ,N_x+1$, are given by the formula $x_i=a+(i-1)h$, and so we have $a=x_1<x_2< \dots <x_{N_x}<x_{N_{x+1}}=b$ and respectively we partition $[0,T_f]$ in $N_t$ subintervals of length $\tau=\frac{T_f-t_0}{N_t}$ and the points are $t_n=t_0+(n-1)\tau, n=1, \dots ,N_t+1$, so we have $t_0=t_1<t_2<\dots< t_{N_t}<t_{N_{t+1}}=T_f$.


Is there a criterion to choose $N_x$ and $N_t$ ? (Thinking)
 
Physics news on Phys.org
Well, if you don't have the exact solution available, then one way to show your partition is good enough is to pretend your metric space is complete (Cauchy sequences converge). What I mean by that is you would show that your partition is good enough if, say, you divided each subinterval in half, and your solution did not differ from your previous solution by more than some pre-specified tolerance. The hope is that you're working in a complete space, so that if your solutions differ from each other by a very little bit, they are close to the true solution. Does that make sense?
 
In our case, the solution is given.
 
In that case, you would compare your approximation with the exact solution, and see if it's in some tolerance. Now, you have to be careful how you compare. I would probably do something like this: pick a bunch of random points in the $(x,t)$ plane, evaluate your approximation there and the exact solution there, square the difference (or take its magnitude), and add them all up. You might have some predetermined method of comparison, but I would think it would need to be something like this method.
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 65 ·
3
Replies
65
Views
8K
  • · Replies 24 ·
Replies
24
Views
4K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 16 ·
Replies
16
Views
4K
  • · Replies 16 ·
Replies
16
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K