1. Not finding help here? Sign up for a free 30min tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Finite Differences Method for Physics

  1. Apr 9, 2013 #1
    1. The problem statement, all variables and given/known data
    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.


    2. Relevant 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
    3. 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: Apr 9, 2013
  2. jcsd
  3. Apr 9, 2013 #2

    rude man

    User Avatar
    Homework Helper
    Gold Member

    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 continous case?

    EDIT: I'm guessing you reported the end-to-end swing. In which case are you sure it's not right?
     
    Last edited: Apr 9, 2013
  4. Apr 9, 2013 #3
    How do I attach via email on physics forum?
     
  5. Apr 9, 2013 #4

    rude man

    User Avatar
    Homework Helper
    Gold Member

    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.
     
  6. Apr 9, 2013 #5
    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.
     
  7. Apr 9, 2013 #6

    rude man

    User Avatar
    Homework Helper
    Gold Member

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

    Now you'd better be able to explain why! :smile:
     
  8. Apr 9, 2013 #7
    Am I calculating what the "theoretical max extension" should be incorrectly?
     
  9. Apr 9, 2013 #8

    rude man

    User Avatar
    Homework Helper
    Gold Member

    Well, the mass swings from 0 to - 9.8, so what would you call the "max. extension"?
     
  10. Apr 9, 2013 #9
    Wouldn't it be 9.8 then?
     
  11. Apr 9, 2013 #10

    rude man

    User Avatar
    Homework Helper
    Gold Member

    I would argue no.
    Max. extension = 4.9, max. compression = 4.9, total swing = 9.8.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted



Similar Discussions: Finite Differences Method for Physics
Loading...