Plotting Complex Wavefunction - Matlab

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
5 replies · 4K views
Nicolaus
Messages
73
Reaction score
0
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.
 
on Phys.org
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.
 
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.
 
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))##
 
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
 
Given ##Z## a complex number, then its real part, imaginary part, modulus, and phase can be accessed through
Matlab:
real(Z);
imag(z)
abs(Z)
angle(Z)
, respectively.
 
  • Like
Likes   Reactions: kreil