Here is a listing of my mathematica notebooks. The most recent of any of these notebooks can all be obtained from my github Mathematica repository.
The Wolfram CDF player can also be used to view a number of these notebooks after download.
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.
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.
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.
PHY454. Problem set 1.
Final grunt calculation.
Mathematica features used: 3x3 matrix, IdentityMatrix, Tr (trace), MatrixForm, evaluate last expression.
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.
PHY454 Problem set 1. Q3.
Confirm some manual matrix calculations.
Used Cross product function, and Orthogonalize for Gram-Schmidt like expansion.
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.
Based on phy454continuumProblemSet1Q2animated.cdf, with most stuff stripped out to ask about the errors on initial load in mathematica.stackexchange question.
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.
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.
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.
Figure3 for continuum mechanics problem set II. Used ChemicalData again and used Piecewise.
Exact solution to Q3 velocities. Return to this and plot it later.
erf Plot. Using AxesLabel
Plotting the two layer constant pressure gradient solution.
Generate figures for lecture 20 notes.
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.
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.
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.
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.
Take the previous calculation and display and do it in 3D instead. Very cool.
Add some explanatory text, and put in the format required for the wolfram demo upload page.
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.
The integral for chapter 7, problem 2 of Landau's fluids. Curve for a fluid meniscus up a wall.
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.