It should be A = (2/a)**(0.5), not 1/2 because that's treated as an integer and gives 1/2 = 0, hence your plot reached a max value of 1, not A, which would be sqrt(2/a) = sqrt(1/pi) = 0.5642...
1/2 is treated as float in python 3.x -- this is a python 2.x specific issue. And fixing it is easy too ``` >> from __future__ import division ``` edit: it's a double underscore (darn, formatting)
Hey man, i just wanted you to know that I love your videos. I am a high school student and I want to major in physics and your videos have provided so much guidance and I don't feel insecure about it anymore :)
sfruizmiranda thats great to hear! im in a similar boat! my high school pushes engineering very much but personally the conceptual parts of physics always interested me a little more. after watching andrew i became much more confident in my interest towards physics and its been great!
Andrew Dotson YEA I just started wacthing your vids and they've really help me get a better picture as to what I'm going to major in because at first I was thinking about math but now physics really looks amazing.
I am Kunal and i have got a project to draw graph of a particle in a 1 dimensional box . Your vidieo has been very helpful in my project . Thankyou for making this vidieo.
I'm pursuing undergraduate degree in physics currently. This video had been very helpful for me. It'll be more helpful if you make some more like this on plotting Schrödinger's Wave function along with tunneling, bound state, regeneration of wave function and etc. Thank you.❤️
Great vid!! Could you do one on graphing a set of values from a file? As in showing the results from an experiment and fitting it with the expected model.
My problem is that my x values are from 0-L in the potential well. How do I write that in python? L is not a number. L is equivalent to your "a" but it looks like you just chose random values.
L = np.pi*2 #for instance you L = 2*pi N = 100 #number of points x = np.linspace(0 , L , N ) the thing is, if you define L outside your x values, you may change it quickier, inside x AND psi, you'll just have to change it once instead of twice (might sound lazy, but pretty useful for biiiiiig expressions, so you won't mess up). Why did he chose 2*pi ? because you may see that at the limit in L, x = a, hence the sine in your psi = sin(n*pi) with n en integer, that means psi = 0. Which is prettier to end it where it began than let's say 35
When I started my research internship last year, my mentor had me writing toy scripts to get more familiar with python, and he used 2.7. So that was the only reason really.
disappointed when i clicked on the video and awkwardly assumed the intro was gonna be the *clap* "wuts going on smart ppl". Lets just say i took matter into my own hands prior.
I know it's an old video and commenting probably doesn't make much sense anymore, however, multiplying a by 1.0 to avoid integer division is a good thought but pi is a float and so is a. the 1.0 doesn't change much about it. and I hope that by now you switched to a version 3 of python. not just because the end of life for 2.7 is near but also because you don't have to worry about integer division anymore.
@@AndrewDotsonvideos Can u help me bro to solve this problem few days I am worried for my project because it will decide my a lot of marks How much marks i will get in this course,which is using Variational monte carlo for 1D Square Well.(Problem 10.9 , Book Name - Nicholas J.Giardiano Computational physics ) find wave function for ground state. if you can help me or give me some ideas how can i start Python Code for this problem. it will be very helpful for me.
So the reason you had to do all that annoying shit around convincing python that the numbers are actually floating point is because you're using python 2. If you upgrade to Python 3 then it'll treat the numbers as floating by default.
It should be A = (2/a)**(0.5), not 1/2 because that's treated as an integer and gives 1/2 = 0, hence your plot reached a max value of 1, not A, which would be sqrt(2/a) = sqrt(1/pi) = 0.5642...
Wow thanks for the good catch. Pinning this comment
1/2 is treated as float in python 3.x -- this is a python 2.x specific issue.
And fixing it is easy too ``` >> from __future__ import division ```
edit: it's a double underscore (darn, formatting)
Just started my first physics research/internship today and went straight to this for help. Just wanted to say thanks!!
Have you considered using Jupyter or SpyDer? It makes this process waaaay easier.
Hey man, i just wanted you to know that I love your videos. I am a high school student and I want to major in physics and your videos have provided so much guidance and I don't feel insecure about it anymore :)
sfruizmiranda yep same here
sfruizmiranda thats great to hear! im in a similar boat! my high school pushes engineering very much but personally the conceptual parts of physics always interested me a little more. after watching andrew i became much more confident in my interest towards physics and its been great!
These comments mean a lot! Really glad to know some people enjoy these videos.
Alex Arteaga are you taking physics this year
Andrew Dotson YEA I just started wacthing your vids and they've really help me get a better picture as to what I'm going to major in because at first I was thinking about math but now physics really looks amazing.
Great video! I am currently graphing a bit in python so this was really helpful!
I am Kunal and i have got a project to draw graph of a particle in a 1 dimensional box . Your vidieo has been very helpful in my project . Thankyou for making this vidieo.
Wow this is awesome, ive had this exact question in my head for a while as im taking a computational methods class next year in python.
Good luck in computational! Such a fun class
Same over here, next year I'm starting with python and wanting something like this.
Really Helpful sir
Form India 🇮🇳
I'm pursuing undergraduate degree in physics currently. This video had been very helpful for me. It'll be more helpful if you make some more like this on plotting Schrödinger's Wave function along with tunneling, bound state, regeneration of wave function and etc. Thank you.❤️
I'm so glad that python is intuitive like Matlab. Matlab and robot c++ being the only languages I've used.
This is a great video about the basics of using matplotlib! thanks
This is awesome do more of these, not lots of physics specific computational resources.
Great vid!! Could you do one on graphing a set of values from a file? As in showing the results from an experiment and fitting it with the expected model.
now how do you show time evolution of a linear combination of them?
Im using vscode to run but error at wavefuction what can I do
Thank you,this was very helpful.
Can u plz make a video on plotting of Psi for H-like atom with (r,theta,phi)
This is awesome, thanks!
Can u show how to use python to visualize H-atom problem !!!!!!!!!
Perfect!
My problem is that my x values are from 0-L in the potential well. How do I write that in python? L is not a number. L is equivalent to your "a" but it looks like you just chose random values.
L = np.pi*2 #for instance you L = 2*pi
N = 100 #number of points
x = np.linspace(0 , L , N )
the thing is, if you define L outside your x values, you may change it quickier, inside x AND psi, you'll just have to change it once instead of twice (might sound lazy, but pretty useful for biiiiiig expressions, so you won't mess up).
Why did he chose 2*pi ? because you may see that at the limit in L, x = a, hence the sine in your psi = sin(n*pi) with n en integer, that means psi = 0.
Which is prettier to end it where it began than let's say 35
Hey can u make Heisenberg hamiltonian in python
Thanks.
thanks a lot
What's your motivation for using Python 2 rather than 3?
When I started my research internship last year, my mentor had me writing toy scripts to get more familiar with python, and he used 2.7. So that was the only reason really.
disappointed when i clicked on the video and awkwardly assumed the intro was gonna be the *clap* "wuts going on smart ppl". Lets just say i took matter into my own hands prior.
I know it's an old video and commenting probably doesn't make much sense anymore, however, multiplying a by 1.0 to avoid integer division is a good thought but pi is a float and so is a. the 1.0 doesn't change much about it. and I hope that by now you switched to a version 3 of python. not just because the end of life for 2.7 is near but also because you don't have to worry about integer division anymore.
Hi,
Yes I've changed over to 3 since then! And yeah, you're right. Since pi is already a float it wasn't necessary.
@@AndrewDotsonvideos Can u help me bro to solve this problem few days I am worried for my project because it will decide my a lot of marks How much marks i will get in this course,which is using Variational monte carlo for 1D Square Well.(Problem 10.9 , Book Name - Nicholas J.Giardiano Computational physics ) find wave function for ground state. if you can help me or give me some ideas how can i start Python Code for this problem. it will be very helpful for me.
its fun however origin is much more straightforward
So the reason you had to do all that annoying shit around convincing python that the numbers are actually floating point is because you're using python 2. If you upgrade to Python 3 then it'll treat the numbers as floating by default.
Ewwww programming
Professor Potato ewwww python