Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Plotting Complex Wavefunction - Matlab

  1. Oct 16, 2015 #1
    Hi,
    I am wondering how to plot a complex function of the form:
    Ψ(t) = Ansin(n⋅pi⋅x/L)e-iEnt/h + Bnsin(m⋅pi⋅x/L)e-iEmt/h + .... +
    where m and n are known eigenvalues of the infinite square well with corresponding energy En, for any particular x? So, this will be a function of solely t.
    Any help appreciated,
    Thanks.
     
  2. jcsd
  3. Oct 17, 2015 #2

    blue_leaf77

    User Avatar
    Science Advisor
    Homework Helper

    Does "+...+" mean infinite series? If yes you can't plot it in a computer, you first have to know which terms have more weight than the others and plot only those significant terms.
     
  4. Oct 17, 2015 #3
    I should have specified; my intent was not for that to represent an infinite series, but rather other arbitrary terms for a linear combination of a finite number of energy eigenfunctions of the infinite square well.
     
  5. Oct 17, 2015 #4

    blue_leaf77

    User Avatar
    Science Advisor
    Homework Helper

    If I get your point correctly, you want to plot your wavefunction for a fixed x as a function of t, and this wavefunction is a linear combination of finite number of eigenfunctions of infinite square well.
    Well, the wavefunction is a complex number, hence it can be either written in terms of its real and imaginary parts, or modulus and phase. So, you will have two curves for ##\psi(x,t)##, one for real part ##\textrm{Re}[\psi(x,t)]## and one for imaginary part ##\textrm{Im}[\psi(x,t)]##, if you use real-imaginary representation. If you use modulus-phase, they will be ##|\psi(x,t)|## and ##\textrm{Arg}(\psi(x,t))##
     
  6. Oct 18, 2015 #5
    Correct. If I want a Re-Im representation, how would I go about plotting that on Matlab? Actually, it would be good to know how to plot both types.
    Thanks
     
  7. Oct 18, 2015 #6

    blue_leaf77

    User Avatar
    Science Advisor
    Homework Helper

    Given ##Z## a complex number, then its real part, imaginary part, modulus, and phase can be accessed through
    Code (Matlab M):
    real(Z);
    imag(z)
    abs(Z)
    angle(Z)
     
    , respectively.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Plotting Complex Wavefunction - Matlab
  1. Plotting bands (Replies: 2)

Loading...