These are chat archives for ellisonbg/phys202-2015

22nd
Apr 2015
SJSlavin
@SJSlavin
Apr 22 2015 02:26
Just wanted to note this: in ex03, the equation is NOT a hyperbolic cosecant, it is c * hyperbolic secant. i was struggling with it until I noticed this.
Patrick Steffanic
@CalPolyPat
Apr 22 2015 02:38
In matplotlibex03, do we really want to use L=0, the well will then have no length?
Patrick Steffanic
@CalPolyPat
Apr 22 2015 02:54
http://matplotlib.org/users/colormaps.html All of the names of all of the built in matplotlib colormaps. It took me forever to find.
Brian E. Granger
@ellisonbg
Apr 22 2015 03:17
You want to use L=1.0
Noah Sutton-Smolin
@telthien
Apr 22 2015 03:17
@bjshaw I still don't know what to do with it
Brian E. Granger
@ellisonbg
Apr 22 2015 03:19
Hold on let me look at that...
When I create the psi array in cell that has the assert tests, that is just to test your well2d function
Later on you will have to create your own psi array that has the full shape using meshgrid
Noah Sutton-Smolin
@telthien
Apr 22 2015 03:24
Two psi functions are needed?
Brian E. Granger
@ellisonbg
Apr 22 2015 03:24
I should have named the test array differently
Not two functions
Just one well2d function
Noah Sutton-Smolin
@telthien
Apr 22 2015 03:25
er, yeah
Brian E. Granger
@ellisonbg
Apr 22 2015 03:25
But you will have to create your own psi array in addition to the one that is created for the test
Noah Sutton-Smolin
@telthien
Apr 22 2015 03:26
Hm, so the well2d above needs to create a single one-dimensional array, and later on, we need to create a new thing that creates a two-dimensional array?
Brian E. Granger
@ellisonbg
Apr 22 2015 03:27
Not followign - the well2d function won't create any array
It just computes the value of the wavefunction given an x, y, etc.
But x, y could be an array so you have to use np.sin inside well2d
Otherwise meshgrid won't work for you to create your psi array
Noah Sutton-Smolin
@telthien
Apr 22 2015 03:28
Ahhh, I see.
That makes more sense! Thank you!
edwardd1
@edwardd1
Apr 22 2015 03:49
I'm still not seeing why well2d would create a one dimensional array in the test when the test gives an array of x and an array of y. "psi = well2d(np.linspace(0,1,10), np.linspace(0,1,10), 1, 1)" (From the test cell)
Brian E. Granger
@ellisonbg
Apr 22 2015 04:35
x and y are 1d arrays, so the np.sin*np.sin is the product of two 1d arrays, which is elementwise -> another 1d array
Brad Shaw
@bjshaw
Apr 22 2015 04:40
What does it mean when it says to add a colorbar to our visualizations?
Brian E. Granger
@ellisonbg
Apr 22 2015 04:41
Try googling "matplotlib colorbar"
You will have a hunt a bit - but that is deliberate on my part
Look for the colorbar in the pyplot module
Randy Sterbentz
@rsterbentz
Apr 22 2015 08:43
How do you make a figure work with a def? It keeps saying "'Figure' is not iterable".
Brian E. Granger
@ellisonbg
Apr 22 2015 16:08
I am not sure I understand what you are referring to. Can you paste a code sample here into gitter?
You can switch gitter to compose mode to enter code