Different approximations for the same problem

  • I
  • Thread starter Silviu
  • Start date
  • #1
624
11

Main Question or Discussion Point

Hello I am looking at Stat Mech problem 2 from here (page 8) with solution here. I am confused about their approximations. They are all valid, but they are different. For example in part a) they use $$\frac{\partial P}{\partial x}(x+\frac{1}{2}\Delta x,t)=\frac{P(x+\Delta x,t)-P(x,t)}{\Delta x}$$ and a bit lower they use $$\frac{\partial P}{\partial x}(x,t)=\frac{P(x,t+\Delta t)-P(x,t)}{\Delta t}$$ Why would I use one over the other? If you know what answer you need, you might figure it out, but in general I think you would get a different answer if using different approximations (by a factor of 2 or something?). Also in part b) they use a Taylor series, which could have been used equally well in part a) and I am not sure why they used it here but not there.
 

Answers and Replies

  • #2
34,044
9,892
The second one should be a time derivative.

One might be more convenient for the following calculations. It doesn't really matter as you take the limit of ##\Delta x, \Delta t \to 0## later anyway.

In this limit,
$$\frac{\partial P}{\partial x}(x+\frac{1}{2}\Delta x,t)=\frac{\partial P}{\partial x}(x,t) = \frac{\partial P}{\partial x}(x+\Delta x,t)$$
 
  • #3
19,919
4,095
The first finite difference approximation is 2nd order accurate in ##\Delta x##, meaning that the error is on the order of ##(\Delta x)^2##. The second finite difference approximation is 1st order accurate in ##\Delta t##, meaning that the error is on the order of ##\Delta t##. A 2nd order approximation is more accurate than a 1st order approximation.
 
  • #4
624
11
The first finite difference approximation is 2nd order accurate in ##\Delta x##, meaning that the error is on the order of ##(\Delta x)^2##. The second finite difference approximation is 1st order accurate in ##\Delta t##, meaning that the error is on the order of ##\Delta t##. A 2nd order approximation is more accurate than a 1st order approximation.
Thank you for your reply! I remember we studied this in a numerical method class. However, why wouldn't one stick to a certain approximation for both space and time?
 
  • #5
19,919
4,095
Thank you for your reply! I remember we studied this in a numerical method class. However, why wouldn't one stick to a certain approximation for both space and time?
If you are solving a differential equation numerically like $$\frac{\partial P}{\partial t}=k\frac{\partial^2 P}{\partial x^2}$$you can get added accuracy (for free) in the x direction if you use the 2nd order formula. Sometimes (but not usually) a 2nd order approximation is used for the first derivative in the t direction also; this is called Crank-Nicholson.
 

Related Threads on Different approximations for the same problem

  • Last Post
Replies
1
Views
2K
Replies
6
Views
424
Replies
5
Views
2K
Replies
20
Views
3K
Replies
1
Views
1K
Replies
1
Views
500
Top