Finite Differences Method for Physics

In summary, the conversation discussed solving a differential equation for a hanging mass influenced by gravity and comparing it to the solution obtained through finite differences. The solution for the differential equation was derived and used to create a graph in Excel. The discrepancy between the maximum extension of the spring in the numerical and finite differences solutions was explained and deemed to be correct. The conversation also touched on the concept of maximum extension and compression in the context of the mass's swing.
  • #1
fredrogers3
40
0

Homework Statement


I am to first write a differential equation that describes a hanging mass influenced by gravity and then write the finite differences equation. Then, the problem asks me to graph this numerical solution and make sure that maximum extension of the spring that I derive matches that of the finite differences result.

Homework Equations


The Differential equation is: m*(d^2x/dt^2)=-kx-mg
The second derivative is approximately equal to (Xn+1-2Xn+Xn-1)/Δt^2
Solved for Xn+1=

Xn+1=Δt^2*((-kXn-mg)/m)+2Xn-Xn-1

m=1kg
delta t= .1

The Attempt at a Solution


I worked out all of the above in the relevant equations section. I set k=2 (we were allowed to pick any value), so the max extension = 9.8/2 = 4.9

I did the finite differences on Excel but did not get 4.9 (or -4.9 if down is negative) as a max displacement. I got around 9.8. Anyone see my error?

Thanks
 
Last edited:
Physics news on Phys.org
  • #2
If you write mx'' = -kx - mg you are ipso facto calling x = 0 where the spring is relaxed. So now you're holding the mass attached to the spring at initial condition x = 0 and letting go. In other words, you are applying an initial condition F = -mg and then running the diff. eq. What will the mass do? Between what values of x will it vibrate?

I also ran an Excel (I used T = 0.01s.) and got about the right swing extrema.

If you want you can e-mail me your run. I use excel 2003 so I hope we'd be compatible. Or describe your program in detail. Also, what is your time response for the continuous case?

EDIT: I'm guessing you reported the end-to-end swing. In which case are you sure it's not right?
 
Last edited:
  • #3
rude man said:
If you write mx'' = -kx - mg you are ipso facto calling x = 0 where the spring is relaxed. So now you're holding the mass attached to the spring at initial condition x = 0 and letting go. In other words, you are applying an initial condition F = -mg and then running the diff. eq. What will the mass do? Between what values of x will it vibrate?

I also ran an Excel (I used T = 0.01s.) and got about the right swing extrema.

If you want you can e-mail me your run. I use excel 2003 so I hope we'd be compatible. Or describe your program in detail. Also, what is your time response for the continuous case?

How do I attach via email on physics forum?
 
  • #4
fredrogers3 said:
How do I attach via email on physics forum?

Before you do that, what is your solution to the differential equation? And what were the end-points of your excel mass swing? I suspect your simulation's OK.
 
  • #5
rude man said:
Before you do that, what is your solution to the differential equation? And what were the end-points of your excel mass swing? I suspect your simulation's OK.

I found the numerical solution rather than the analytical solution, thus I didn't solve the Diffeq. I plugged into Excel what I have under the "relevant equation" section solved for Xn+1. My graph comes out as a cosine graph with min -9.81192 and max zero. I took n from -1 to 100.
 
  • #6
fredrogers3 said:
I found the numerical solution rather than the analytical solution, thus I didn't solve the Diffeq. I plugged into Excel what I have under the "relevant equation" section solved for Xn+1. My graph comes out as a cosine graph with min -9.81192 and max zero. I took n from -1 to 100.

Well I have news for you. That result is correct.

Now you'd better be able to explain why! :smile:
 
  • #7
rude man said:
Well I have news for you. That result is correct.

Now you'd better be able to explain why! :smile:

Am I calculating what the "theoretical max extension" should be incorrectly?
 
  • #8
fredrogers3 said:
Am I calculating what the "theoretical max extension" should be incorrectly?

Well, the mass swings from 0 to - 9.8, so what would you call the "max. extension"?
 
  • #9
rude man said:
Well, the mass swings from 0 to - 9.8, so what would you call the "max. extension"?

Wouldn't it be 9.8 then?
 
  • #10
fredrogers3 said:
Wouldn't it be 9.8 then?

I would argue no.
Max. extension = 4.9, max. compression = 4.9, total swing = 9.8.
 

1. What is the Finite Differences Method for Physics?

The Finite Differences Method is a numerical technique used to solve differential equations in physics and engineering. It involves discretizing a continuous system into a finite number of points and approximating the derivatives at these points using finite difference equations.

2. How does the Finite Differences Method differ from other numerical methods?

The Finite Differences Method is a local method, meaning it only considers the values at neighboring points to approximate the derivatives. This makes it simpler and more efficient compared to other global methods such as the Finite Element Method.

3. What are the advantages of using the Finite Differences Method?

One of the main advantages of the Finite Differences Method is its simplicity and ease of implementation. It also allows for a fine discretization of a system, leading to more accurate solutions. Additionally, it can handle a wide range of boundary conditions and is computationally efficient.

4. Are there any limitations to using the Finite Differences Method?

Yes, there are some limitations to using the Finite Differences Method. It may not be suitable for systems with irregular or complex geometries, and the accuracy of the solutions may be affected by the choice of discretization. It also requires a large number of points to accurately capture steep gradients in a system.

5. How is the Finite Differences Method used in practical applications?

The Finite Differences Method has various applications in physics and engineering, such as solving partial differential equations in heat transfer, fluid dynamics, and electromagnetic fields. It is also commonly used in computer simulations and modeling to predict the behavior of physical systems.

Similar threads

  • Introductory Physics Homework Help
Replies
2
Views
174
  • Introductory Physics Homework Help
Replies
24
Views
262
  • Introductory Physics Homework Help
Replies
2
Views
1K
  • Introductory Physics Homework Help
Replies
7
Views
4K
  • Introductory Physics Homework Help
Replies
3
Views
2K
Replies
4
Views
846
  • Introductory Physics Homework Help
Replies
22
Views
2K
  • Introductory Physics Homework Help
Replies
2
Views
994
  • Introductory Physics Homework Help
Replies
5
Views
1K
  • Introductory Physics Homework Help
Replies
2
Views
631
Back
Top