MATLAB Plotting Complex Wavefunction - Matlab

AI Thread Summary
To plot a complex wavefunction in MATLAB, one can represent it as a linear combination of a finite number of energy eigenfunctions of the infinite square well. The wavefunction can be expressed in terms of its real and imaginary parts or in modulus and phase. For a real-imaginary representation, MATLAB functions such as real() and imag() can be used to extract the respective components. For modulus and phase, abs() and angle() functions will provide the necessary values. Understanding these representations allows for effective visualization of the wavefunction over time.
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.
 
Physics news 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 kreil

Similar threads

Back
Top