I Different approximations for the same problem

  • I
  • Thread starter Thread starter Silviu
  • Start date Start date
AI Thread Summary
The discussion centers on the confusion regarding different finite difference approximations used in a Stat Mech problem. One approximation is second-order accurate in space, while the other is first-order accurate in time, leading to potential discrepancies in results. The choice of approximation can enhance accuracy in specific directions, such as using a second-order formula for spatial derivatives. The Crank-Nicholson method is mentioned as a way to apply second-order accuracy in time as well. Ultimately, the appropriateness of each approximation depends on the context of the calculations being performed.
Silviu
Messages
612
Reaction score
11
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.
 
Physics news on Phys.org
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)$$
 
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.
 
Chestermiller said:
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?
 
Silviu said:
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.
 
Thread 'Question about pressure of a liquid'
I am looking at pressure in liquids and I am testing my idea. The vertical tube is 100m, the contraption is filled with water. The vertical tube is very thin(maybe 1mm^2 cross section). The area of the base is ~100m^2. Will he top half be launched in the air if suddenly it cracked?- assuming its light enough. I want to test my idea that if I had a thin long ruber tube that I lifted up, then the pressure at "red lines" will be high and that the $force = pressure * area$ would be massive...
Back
Top