Finite Differences Method for Physics

Click For Summary

Homework Help Overview

The discussion revolves around applying the finite differences method to a differential equation modeling a hanging mass influenced by gravity. The original poster seeks to derive a numerical solution and compare it to theoretical expectations regarding maximum extension of a spring.

Discussion Character

  • Exploratory, Assumption checking, Problem interpretation

Approaches and Questions Raised

  • Participants discuss the setup of the differential equation and its implications for initial conditions. There are inquiries about the interpretation of maximum extension and the results obtained from numerical simulations in Excel. Some participants share their own results and suggest potential discrepancies in the original poster's calculations.

Discussion Status

The conversation is ongoing, with participants providing insights and questioning the assumptions made in the setup. There is a mix of numerical and analytical perspectives being explored, and while some participants express confidence in their results, others seek clarification on the definitions and calculations involved.

Contextual Notes

Participants are working under the constraints of homework guidelines, which may limit the depth of their explorations. The original poster has specified values for mass and spring constant, but there are discussions about the implications of these choices on the results.

fredrogers3
Messages
40
Reaction score
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
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:
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?
 
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.
 
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.
 
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:
 
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?
 
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"?
 
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.
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
2K
Replies
2
Views
1K
Replies
2
Views
1K
  • · Replies 24 ·
Replies
24
Views
1K
  • · Replies 7 ·
Replies
7
Views
5K
  • · Replies 16 ·
Replies
16
Views
2K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 15 ·
Replies
15
Views
3K
Replies
4
Views
1K