1. Limited time only! Sign up for a free 30min personal 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!

Homework Help: Solve Wave Function - Computational

  1. Nov 24, 2014 #1
    1. The problem statement, all variables and given/known data

    Hi all,

    I've been working on this assignment for some time now and seem to be stuck before I even get going!

    The wave equation:

    d^2 u(x,t) / dx^2 = d^2 u(x,t) / dt^2

    can be written as:

    du/dt = v
    dv/dt = dw/dx
    dw/dt = dv/dx
    w = du/dx

    I need to solve this using Python. I'm going to do it using Euler's method.

    Some initial conditions:

    u(x,0) = e^(-x^2 / 2*sigma^2)

    sigma = 0.1

    du(x,0) / dt = 0

    du(x,0) / dx = -100x*u(x,0)


    What I've figured, is that in order to implement Euler I need to use the u_dot, v_dot and w_dot as a vector of your RHS. So you use this do calculate the next time step since

    U(u,v,w)n+1 = U(u,v,w)n + dt*RHS(u_dot,v_dot,w_dot)

    u_dot being du/dt btw

    However, I have no idea how to actually do this, I'm completely thrown :(
    I've been trying to get somewhere on paper and on the computer coding and neither has really given me anything I can use. How do I find U(u,v,w)n for a start?? and the RHS is d^2u/dt^2 i think.. How am I ever going to put that into python :S :S :S??

    Any help and hints would really be helpful the deadline is coming up soon and I'm very stumped here.

    Cheers all
  2. jcsd
  3. Nov 24, 2014 #2
    Also, everywhere I look the wave function equation is written d^2u / dt^2 = c^2 * d^2u / dx^2

    I have no idea why the one in my question is different. Any ideas?
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted