### some of my mathematica notebooks

 Some of these can also be viewed with the Wolfram CDF player after download. Nov 6, 2011 financials/ibm_stock_plot.cdf Plotting last couple weeks of IBM stock history. Mar 11, 2011 mathematica/FailedRealSimplify.nb tried to find real parts and had trouble. Mar 12, 2011 mathematica/FailedRealSimplify2.nb Same thing, simplified for stackoverflow question. Mar 12, 2011 mathematica/SphericalCurlAttempt.nb Trying to do some spherical polar calculations. Gave up and did them by hand. Mar 23, 2011 mathematica/phy450ps5rough.nb Generate figures for an electrodynamics problem set submission. Mar 11, 2011 mathematica/plot3dAttempt.nb An early plot attempt. Mar 10, 2011 mathematica/simple-1.nb Some very first basic attempts to use mathematica. Integrate and Plot and matrix syntax. Apr 21, 2011 blogit/minorTrigIntegrals.nb Integrate and TrigReduce Apr 25, 2011 papers/obliqueReciprocal.nb Generate figures for arxiv 1104.4829 paper. Apr 21, 2011 phy356/deltaFunctionPlots.nb Generate figures for square well and delta function well for phy356 notes.. Apr 21, 2011 phy450/mathematica/dipolePlot.nb plot of dipole moment Apr 21, 2011 phy450/mathematica/ps5IntegralTakeII.nb Integrate x sin(a - |x|)/|x| Sep 15, 2011 blogit/DiracGammaMatrix.nb Some gamma matrix calculations. Sep 15, 2011 blogit/eigenvectors_of_a_cross_product_matrix.nb Probably messing around with a Lorentz force problem. Sep 15, 2011 gabook/mathematica/matrixVectorPotentialsTrig.nb Some trig double angle reductions. Sep 15, 2011 gabook/mathematica/pendulumDouble.nb Generate some double pendulum figures. Sep 15, 2011 phy456/desai_S_24_2_1_verify.nb Some integrals related to QM hydrogen atom energy expectation values. Sep 24, 2011 phy456/problem_set_2,_problem_2,_verify_wavefunction_normalization.nb Some trig integrals that I didn't feel like doing manually. Sep 28, 2011 phy456/problem_set_3_integrals.nb Some gaussian integrals. Sep 24, 2011 phy456/exponential_integrals.nb More gaussian integrals and some that Mathematica didn't know how to do. Oct 2, 2011 phy456/24.4.3_attempt_with_mathematica.nb Some variational method calculations for QM energy estimation. Oct 5, 2011 phy456/gaussian_fitting_for_abs_function.nb Hankle function fitting for e^{-b|x|} and related plots. Oct 8, 2011 phy456/qmTwoL8figures.nb Plot of gaussian weighted cosine, its Fourier transform, and figure for perturbation of Harmonic oscillator system. Oct 9, 2011 phy456/qmTwoL9figures.nb Sinusoid plot turned on at t_0 and ongoing from there. Oct 6, 2011 phy456/stack_overflow_question_mathematica_exponential_Nth_derivative_treated_as_an_unknown_function.nb Stripped down example notebook for stackoverflow question about Derivative[2] not behaving well. Oct 6, 2011 phy456/stackoverflow_question_about_listable.nb Stripped down example notebook for stackoverflow question about Listable attribute defaults. Oct 16, 2011 phy456/desai_attempt_to_verify_section_16.3.nb Some energy expectation value calculations. Oct 15, 2011 phy456/desai_24_4_4.nb Another worked variational method problem. Oct 15, 2011 phy456/desai_24_4_5.nb Another worked variational method problem. Oct 15, 2011 phy456/desai_24_4_6.nb Another worked variational method problem. Looks like I've learned about the /. operator for evaluating variables with values. Oct 10, 2011 phy456/problem_set_4,_problem_2.nb Some trig integrals that Mathematica didn't evaluate correctly. Don't trust a tool without thinking whether the results are good! Oct 15, 2011 phy456/qmTwoL10figures.nb Some sinc function plots. Learned how to use Manipulate to make sliders. Oct 26, 2011 blogit/desai_24.4.1_wkb_harmonic_oscillator.nb A square root quadratic integral. Oct 28, 2011 blogit/qmTwoR3figures.nb Figure for square well with Perturbing potential in the well, and for degeneracy splitting. Oct 31, 2011 phy456/plot_question.nb Another stackoverflow mathematica question. Why no output in my plot. Learned about Mathematica local and global variables as a result. Oct 18, 2011 phy456/problem_set_5_integrals.nb Some integrals of first order linear polynomials. Oct 17, 2011 phy456/qmTwoL11figures.nb Some vector addition and function translation figures. Oct 19, 2011 phy456/qmTwoL12_figures.nb Some step and rect function plots. Oct 14, 2011 blogit/wolfram_twitter_tips.nb Take the wolfram twitter tip feed and try out some of the interesting recent ones. Oct 31, 2011 phy456/problem_set_7_verify_rotation_matrix_orthonormal.nb A sanity check on a rotation matrix calculated as part of a problem set. Dec 17, 2011 phy456/qmTwoExamReflection.cdf Exam problem 2a. Calculate the matrix of a Perturbation Hamiltonian $-\boldsymbol{\mu}_d \cdot \mathbf{E}$ with respect to the $n=2$ hydrogen atom wave functions. Dec 12, 2011 blogit/sincSquaredEvaluation.nb A SinIntegral plot and sinc integration with use of Limit[] Jan 17, 2012 phy454/mathematica/strainTensorCylindrical.cdf Compute the cylindrical strain tensor components to second order.Using the notation package for the first time to get results that make the mathematica notebook text intelligible as well as the final result.Also use the Collect[] function for the first time to group the results according to the differential products of interest. Jan 21, 2012 phy454/mathematica/strainTensorSpherical.cdf Like strainTensorCylindrical but for spherical coordinates.Here I used Coefficient instead of Collect so that I could factor out the additional portions of the area element differentials for constancy and comparison with the Landau and Lifshitz equation. Jan 17, 2012 phy454/mathematica/strainTensorSphericalColumnVectors.cdf Same as strainTensorSpherical, but I didn't pre-compute the line element differentials myself, instead letting mathematica do the grunt work.Note that in this version, I specified the definitions of rcap, thetacap, and phicap manually, but had some commented out code to verify that I had this right.This notebook was left using Collect instead of coefficient, so the collected factors do not match the text equation results without additional manual comparison work.Also use this to output the column matrices for rcap, thetacap and phicap and drcap/dt. Feb 3, 2012 phy454/mathematica/continuumProblemSet1Q1.cdf PHY454. Problem set 1.Final grunt calculation.Mathematica features used: 3x3 matrix, IdentityMatrix, Tr (trace), MatrixForm, evaluate last expression. Dec 21, 2011 blogit/moreTwitterTips.cdf Feb 4, 2012 phy454/mathematica/continuumProblemSet1Q2.cdf PHY454 Problem set 1. Q2.Confirm the characteristic equation calculated manually.Find the root, by solving the characteristic equation.Find the eigenvalues and normalized eigenvectors.Interesting mathematica functions used: Map which applies operation to list, Normalize, Solve, Table, Total -- adding all elements in a list. Feb 5, 2012 phy454/mathematica/continuumProblemSet1Q3.cdf PHY454 Problem set 1. Q3.Confirm some manual matrix calculations.Used Cross product function, and Orthogonalize for Gram-Schmidt like expansion. Feb 8, 2012 phy454/mathematica/continuumProblemSet1Q2animated.cdf PHY454 Problem set 1. Q2.Animate the stress tensor associated with the problem, for different points and values of Poisson's ratio.This generalizes the solution of the problem since answers visually whether the point is under expansion (blue arrow) or under compression (red arrow) at each point in space.Mathematica manipulate sliders are used to select the spatial points and the value of Poisson's ratio.Used a number of new (for me) mathematica features: Table, Arrow, If, Part, multiple colors in Graphics3D, DiagonalMatrix, Diagonal (select diagonal into list), Tr (not Trace!), Map, Eigenvalues, Eigenvectors, and in a later version Eigensystem to replace the last two.The code has links to various stackexchange questions for this notebook. There's an answer on scaling that's incorporated into the Graphics3D options. One more mathematica stackexchange question answered on this little notebook which motivated the Dynamic and DynamicModule calls now here, and one more that drove the change to use Eigensystem. Feb 12, 2012 phy454/mathematica/partErrorTestStandalone2D.cdf Based on phy454/mathematica/continuumProblemSet1Q2animated.cdf, with most stuff stripped out to ask about the errors on initial load in mathematica.stackexchange question. Feb 19, 2012 classicalmechanics/mathematica/infiniteCylinderPotential.cdf Attempt at evaluating the potential for an infinite cylinder. Feb 24, 2012 classicalmechanics/mathematica/psIIp4InfPlanePotTakeIII.cdf Attempt at evaluating the potential for an infinite plane. Experimenting with using mathematica to produce decent documents, as well as trying a variation of the previous calculation where I used $R^2 \sim e$.The final output is not as nice as latex, but the save as latex option seems promising. New Mathematica tools used in this notebook include HoldForm, TraditionalForm, and ReleaseHold, which can be used to generate traditional form by default for scratch display generation.Note that cut-and-pasting URLS in comments as I've been doing get mangled and can't be followed. Switched the ones in this doc to Insert->Hyperlink instead. Feb 27, 2012 classicalmechanics/mathematica/psIIp4InfCylPot.cdf Attempt evaluation of a cylindrical potential.New Mathematica methods used: HoldForm, Assuming, Assumptions. Mar 3, 2012 phy454/mathematica/twoLayerInclinedFlowDifferentDensities.cdf Plug in some numbers for the viscosities and densities for the inclined fluid flow down a plane problem. Insertion of an air layer above the water ends up with the air speed humongous! Steady state not realistic? What are the length scales required for steady state?New mathematica functions used: WolframAlpha, ChemicalData. Mar 4, 2012 phy454/mathematica/twoLayerInclinedFlowDifferentDensitiesTheCalculation.cdf Redo the hand calculation in twoLayerInclinedFlowDifferentDensities.tex completely in mathematica and verify the results. I did it right.Notable mathematica functions used: Do, Solve, Collect, ExpandAll. Mar 13, 2012 phy454/mathematica/continuumProblemSet2Fig1r2.cdf Generate figures for continuum mechanics problem set II figure 1. Using Show and ParametericPlot for the first time. First version used Wacom tablet and graphics drawing options to put in arrows. Text labels later added with Inkscape latex-pdf. Later version used Array of Arrows to draw vector field. Looks much better. Mar 14, 2012 phy454/mathematica/continuumProblemSet2Fig3.cdf Figure3 for continuum mechanics problem set II. Used ChemicalData again and used Piecewise. Mar 14, 2012 phy454/mathematica/problemSetIIQ3exactSolution.cdf Exact solution to Q3 velocities. Return to this and plot it later. Mar 16, 2012 phy454/mathematica/continuumL17Figures.cdf erf Plot. Using AxesLabel Mar 22, 2012 phy454/mathematica/problemSetIIQ3PlotWithManipulate.cdf Plotting the two layer constant pressure gradient solution. Mar 29, 2012 phy454/mathematica/continuumL20Figures.cdf Generate figures for lecture 20 notes. Mar 31, 2012 phy454/mathematica/channelFlowWithStepPressureGradient.cdf Animation for the time evolution of a channel flow due to constant pressure gradient turned on at an initial time for fluid at rest before that. Apr 4, 2012 phy454/mathematica/continuumL22Figures.cdf Figure for last lecture. Defined a rectGraphic function, just to create a drawing area. Toss that in a mathematica module file to learn how to make one. Apr 11, 2012 phy454/mathematica/couetteFlow.cdf Plot the Couette flow solutions. This is by far my coolest attempt to use Mathematica to do visualization so far. The velocity field is plotted in the appropriate circular contours, albeit without arrows and without an envelope with the contours of the field profile. New tricks learned for this notebook include the use of Slider, Dynamic, and RadioButtonBar. Row and Column were used to group the sliders and labels and resulting plots. I coded up a really cool viscosity and density selector too, but that did not get used here so I commented it out and disabled the initialization cell that I had put in for the ChemicalData lookup. Things were also coded in a nice clean fashion so that I could use one helper function to generate both the Manipulate like controls and also the table that I used to save an animation for my pdf file with the original calculations. Apr 14, 2012 phy454/mathematica/twoCylinders.cdf Plot the flow between two infinite cylinders. Mathematica coding style is getting nicer. This has no prologue attempting to be self contained with a nice text description ... too much work to do that in Mathematica instead of Latex. Used Manipulate to generate an animation that includes the sliders. Tried embedding this in the associated pdf, but ffmpeg cant handle it, and I do not know how to coerce it to do so. Apr 15, 2012 phy454/mathematica/twoCylinders3D.cdf Take the previous calculation and display and do it in 3D instead. Very cool. Apr 15, 2012 phy454/mathematica/demoTemplateTwoCylinders3D.nb Add some explanatory text, and put in the format required for the wolfram demo upload page. Apr 20, 2012 mathematica/aurorasPlotPlay.cdf Play around with sliders and 2D locator controls, doing something like what Aurora did in class automatically for larger numbers of lines. Apr 25, 2012 phy454/mathematica/bottomlessCoffee.cdf Plot the Bessel function fitting for the spin down of a bottomless coffee cup. Also animate the time evolution of the spin down with a Manipulate slider. As mentioned in the text, this does not match reality too well. Apr 25, 2012 phy454/mathematica/continuumFluidsReview.cdf The integral for chapter 7, problem 2 of Landau's fluids. Curve for a fluid meniscus up a wall. Apr 27, 2012 phy454/mathematica/coffeeCupWithBottom.cdf Solving the PDE for the non-bottomless coffee cup problem. Find Bessel functions of order 1. Find the fitting coefficients for stirring above the bottom, in the layer of fluid lower than the stirring. Plot this function, and verify against boundary condition. Apr 19, 2012 blogit/fragment.cdf Experimenting with Function and HoldFirst. Can use that instead of HoldForm for just one arg, and then do not need a ReleaseHold. May 3, 2012 blogit/BesselJIntegrals.cdf Some symbolic Bessel integrals over zeros. May 4, 2012 blogit/hyperbolicSineFourier.cdf Construct the sinh function using Fourier series and plot it with a Manipulate on the number of terms. Aug 5, 2012 phy485/mathematica/modernOpticsProblemCh2Pr6Plots.cdf Plots for problem 2.6 in Fowles Modern Optics. Aug 9, 2012 phy485/mathematica/ellipticalPolarizationRotationToStdForm.cdf Problem 2.9 in Fowles Modern Optics. General Jones vector Oct 4, 2012 phy485/mathematica/modernOpticsProblemSet1.cdf Problem set 1 numerical and plot stuff. Oct 17, 2012 phy485/mathematica/diffractionBesselFunctionTransformPair.cdf Attempt to verify the circular aperture Fourier transform result from the diffraction notes. Mathematica gives me a different result than what our Prof detailed. Oct 22, 2012 phy485/mathematica/modernOpticsProblemSet2work.cdf Problem set 2 work. Verify some results. Do the plots and numerical work. This includes the integral that yields the first order Bessel function. Oct 24, 2012 phy485/mathematica/randomVariate.cdf Thinking about problem set 2 problem 3b. Logical want to consider the solar originated rays as random variates in the lingo of mathematica ... functions that generate frequencies or frequency ranges as opposed to the probability that a frequency is found in a certain range. Oct 30, 2012 phy485/mathematica/gaussianScalingVerification.cdf Determine the scaling and variance for a gaussian Oct 30, 2012 phy485/mathematica/etalon.cdf Plot the Etalon function. Used Evaluate and the PlotLegends package to label the level curves automatically Nov 01, 2012 phy485/mathematica/lecture14figures.cdf Plots for lecture 14. One is a simple sine squared (using Ticks to mark only on 2 Pi multiples), and the other I was experimenting with Mathematica Text label placement. Nov 06, 2012 phy485/mathematica/etalonFancyLabellingApp.cdf Try out Belisaris's label placement "App" for the Etalon figure. Nov 06, 2012 phy485/mathematica/etalonFancyLabellingResult.cdf Results from Belisaris's label placement "App" for the Etalon figure. Nov 08, 2012 phy485/mathematica/lecture15figures.nb Plot the single slit diffraction wavefunction and N slit intensity, the latter using a Manipulate so that various parameters can be played with Nov 08, 2012 phy485/mathematica/problemSet3.nb Plots and rough calculations for problem set 3 Nov 20, 2012 phy485/mathematica/lecture18figures1DQuantumSHO.nb Plots for lecture 18. First couple 1D Quantum SHO solutions Dec 1, 2012 phy485/mathematica/lecture20figures.nb Plots for lecture 20. Dec 1, 2012 phy485/mathematica/gaussianBeamHandoutNotes.nb Plot of the lowest order Gaussian beam envelope. Verify normalization from page 2 of the notes. Use ContourPlot3D to plot the hyperboliod of revolution for the lowest order Gaussian beam mode. Dec 4, 2012 phy485/mathematica/fowles1028signError.nb Verify sign error in the characteristic poly in Fowles just before 10.28. Functions used: Collect, Solve. Also sets up a 2 by 2 matrix. Dec 4, 2012 phy485/mathematica/problemSet4problem2c.nb Compute characteristic equation coefficients for unequal focal radii. Functions used: Det, CoefficientList, Factor, FullSimplify. Nov 6, 2012 phy485/mathematica/etalonAngularFancyLabellingApp.nb likely using Belisaris's labeling app Nov 21, 2012 phy485/mathematica/negativeExponentialPlot.nb Plot of decreasing exponential Dec 7, 2012 phy485/mathematica/midtermReflectionAbsSincPlot.nb Plot of Abs[Sinc[]] for Lloyd's mirror problem post midterm reflection Dec 10, 2012 phy485/mathematica/2010finalQuestion3BesselIntegral.nb Bessel integral for 2010 question 3 exam practise Dec 11, 2012 phy485/mathematica/2010finalQuestion5numericalEvaluation.nb Numerical evaluation for 2010 question 5a and 5b exam practise. Used the new Mathematica 9 Quantity function for easy handling of units. Provides a nice check that the right numerical combinations end up dimensionless. Dec 15, 2012 phy485/mathematica/vanDrielz0z1z2stabilityAlgebra.nb Here's the algebra for the Van Driel notes that give expressions for z1 z2 z0 in terms of g1 g2, and for w(z) at these points. Too hard to do it by hand. Mathematica functions used include Notation package for subscript variables, Flatten, Solve, Eliminate, FullSimplify, and Factor. Dec 25, 2012 phy452/mathematica/atleeJackson1_13.nb Jan 1, 2013 phy452/mathematica/kittelCh2Fig1App.nb Use the labelling app for a figure Jan 1, 2013 phy452/mathematica/kittelCh2Fig1.nb Output of kittelCh2Fig1App.nb Jan 10, 2013 phy452/mathematica/lecture2Figures.nb Plots for lecture 2 Jan 10, 2013 phy452/mathematica/lecture2Fig7.nb Generated notebook for plot for lecture 2, figure 7 Jan 13, 2013 phy452/mathematica/normalizationCentralLimitTheoremVsBinomialLimitCheck.nb Check normalization of central limit theorem binomial fair coin result vs result given in class ... these are off by a factor of two Jan 19, 2013 phy452/mathematica/attemptAtProblemSet2Problem1iiIntegrals.nb Plots and integrals for problem set II. Jan 19, 2013 phy452/mathematica/attemptAtProblemSet2Problem1iiIntegralsLabelAppGenerated.nb Labelling app generated notebook Jan 30, 2013 phy452/mathematica/statMechProblemSet3.nb problem set 3 calculations and figures Feb 2, 2013 phy452/mathematica/shoPhaseSpacePlots.nb SHO elliptic plot. Have a Manipulate driven illustration of Liouville's theorem, showing the trajectory of an area in the phase space, allowing observation of the area invariance as it distorts around the path. Feb 6, 2013 phy452/mathematica/binomialPlotsExactAndApprox.nb Plot of unfair coin binomial and the Gaussian approximation. Feb 10, 2013 phy452/mathematica/kittelCh3Problem1Plots.nb Plots for chapter 3, problem 1. Used the new mathematica 9 PlotLegends, a bit better than the version 8 implementation, and now built in. Feb 10, 2013 phy452/mathematica/cyclindrialMomenta.nb Jacobian transformation, for the change of vars for the volume element from cartesian cylindrical coordinates. Feb 11, 2013 phy452/mathematica/nVolumeTrickToCalculateAreaOfCircle.nb integration of $x^2 + y^2$ over a circular quadrant. Used as an example in the easy way hyper volume discussion Feb 11, 2013 phy452/mathematica/sphericalPhaseSpaceChangeOfVars.nb Jacobian calculation for phase space change of vars, Cartesian to spherical. Also verifies the hand calculations for the momenta in spherical coordinates Feb 13, 2013 phy452/mathematica/midtermQ4twoEqualMassesCollision.nb verify the collision of two equal masses statement made in class. Particles swap velocities. The other solution is that the final velocities equal the initial.