Tuesday, October 29, 2019

Multivariable prints on display


Visualizing Multivariable Calculus
These 3D printed objects are designed and printed by students in Math 401, Fall 2019, taught by Instructor Dr. Evelyn Sander with the assistance of Chloe Ham and Colin Chung.

Saddles, discontinuous functions, gradient descent, Lagrange multipliers
Learning multivariable calculus involves a lot of algebraic manipulations, but it all becomes much
easier when getting to see what the concepts look like in 3D.

Monday, October 28, 2019








MATH 401: Math Through 3D Printing
Taylor Fountain
Fall 2019, Section 001

1 Period of w = arcsin(z)
Functions, surfaces, and transformations are 3 of several mathematical ideas that are introduced strictly on the field of real numbers: a real number undergoes an operation, outputting some amount of other real numbers, that are often represented on a graph with 2 or 3 real axes. But, when generalizing these concepts to the set of complex numbers, graphing becomes significantly harder: to map these functions from the complex plane onto the complex plane, 4 dimensions are required, while our feeble human minds can only visualize in 3. In the 19th century, Bernhard Riemann introduced a workaround for this: complex valued functions can be shown with two 3-dimensional plots: 1 from the complex plane to the real axis that represents the real component of the function, and 1 from the complex plane to the imaginary axis that represents it’s imaginary component, producing two Riemann surfaces.

The main difficulty in graphing these surfaces is taking the complex valued function and separating it into the real and complex components. For the inverse sine function ( w=sin-1(z) ), the separation process starts with inverting the function ( sin(w) = z ) and rewriting the sine function as in it’s exponential form, resulting in

by rearranging the equation into the form of a polynomial where u = eiw and using the quadratic equation, we can rewrite this equation as

Note that the +/- is kept in only when using the multi-valued inverse sine function. When using the single-valued inverse sine function, only the positive branch is shown. Then, using the complex logarithm identity,

Solving for w and simplifying, we get

To find the real component of this, we again use the complex logarithm identity to rewrite the function as

And, because, when z is strictly real, Arg[z] = 0 and the magnitude is equal to the function itself, we can reduce the equation to
Next came the process of plotting the function, where I used the ParametricPlot3D function in Mathematica, using the polar definitions of x and y with Euler’s formula to get it in a form that Mathematica can render. The resulting graph will only show one period of oscillation; however, due to the multivalued nature of theta in the complex plane, the functions can be stacked to form a complete (and consequently infinite) representation.
 
To simplify printing, the plot was broken into 2 components, which were identical due to the functions symmetry. Two copies of the piece were rotated onto their side to reduce print time, and were printed with rafts and supports in 1hr 30min on the Makerbot; no problems arose. The pieces were then glued to form the real Riemann surface of w = sin-1(z).

Object - 2 were printed and glued to form Riemann surface

Sunday, October 27, 2019

Ambiguous objects on display


Ambiguous Objects 
These 3D printed objects are designed and printed by students in Math 401, Fall 2019, taught by Instructor Dr. Evelyn Sander with the assistance of Chloe Ham and Colin Chung.
Sugihara Cylinders

Take a look at each object and its reflection. They are not the same! This optical illusion created using mathematics. 

Wednesday, October 23, 2019

A Visualization of Gradient Descent

MATH 401: Math Through 3D Printing Fall 2019
Savannah Crawford


Gradient descent is a popular optimization method for finding the  minimum of a function. The algorithm is simple and easy to implement in various languages, but can take a long time to run depending on stopping conditions, initial conditions and local minimums.

The algorithm uses the power of the gradient of a given function. Since the gradient gives the direction of greatest increase at a point, the gradient descent takes a given point a0, and calculates . Then

 where delta is fixed step size. The algorithm then runs until the difference between an and an+1 is sufficiently small.

Python code implementation of gradient descent


In particular this print finds the local minimum of


 with a0 = (2,7) and delta = .01. The local minimum was found to be  at (4.12, 4.55).


Graph of F(x,y) generated in Mathematica



The gradient decent was run in Python and the points were exported as a text file. The data was imported into Mathematica to plot a tube around the list of points generated in Python, with the addition of the z-component as F(xn,yn). The supports for the print were generated in openSCAD. I was unable to export the gradient descent points and the surface together, so they were exported as separate .stl files and combined with supports in MeshLab.

Final 3D model meshed in MeshLab



Overall, I'm very happy with the way this print came out and I learned a few new things about file I/O in Mathematica. It demonstrates very nicely the power of the gradient and gradient descent algorithm.

Wednesday, October 16, 2019

Octopus Saddle

by: Khalilah Hamer

This week, the Math 401: Mathematics Through 3D Printing class created 3D figures inspired by multivariable calculus concepts. Inspired by the hyperbolic paraboloid or saddle and the dubbed “monkey saddle” I decided to recreate an “octopus saddle” containing 8 maxima and 8 minima. 
I used the application Mathematica in creating this saddle and the equation f_8 (x,y) = (x^8 - 28 x^6 y^2 + 70 x^4 y^4 - 28 x^2 y^6 + y^8)/7.

I derived this equation from  z(r, θ) = r^n e^(i n θ) = r ^n [cos(n θ) + i sin(n θ) =

 With the knowledge of i^2 being -1, I kept k at even numbers to derive the equation.  Having the final equation = f_8 (x,y) = (x^8 - 28 x^6 y^2 + 70 x^4 y^4 - 28 x^2 y^6 + y^8). The final equation is divided by 7 which will be discussed when I examine the problems I’ve had when creating the print. 

Going about coding the project. I examined the example codes and saw that it was much easier and made more sense to define everything at the beginning of the code so when I go back through the code to troubleshoot if any problems occur, I can read the words like "range" and "tubess" then I will know what to change or edit as opposed to a bunch of numbers and equations trying to figure out what will help shrink the image. Then I worked on the the tubes first. The code is below.
 Below is a comparison of the original equation vs when I divided the equation by 7, as you can see the print turned out to be really tall and if I did try to change the range a bit, the minima would be cut off.





Overall the coding was simple and the print looked good. I decided not to add the “feet” to the bottom of the graph since it seemed with eight legs to be quite stable already. The only problem I encountered was that the sides of the print was very tall. I didn't want to necessarily scale the graph and from the way the code was, editing the plotRange did not actually affect the range when the code was opened on the ultimaker. The way I solved this problem was dividing the equation to flatten the graph. The end result was a divide by 7 which did flatten the graph quite a bit but it wasn’t nearly as tall and the print didn't take over a day. Below is a figure of my final print.




Wednesday, October 9, 2019

Ambiguous Object

Joseph Kerns
M401
Assignment 3

Ambiguous Object
            Everyone has looked at an optical illusion before and thought, “how does that work?” With the advent of 3D printers, the world of optical illusions has opened up to including complex mathematical models. Using additive technology, we can construct sophisticated mathematical models and visualize them in virtual spaces, but then we can print them out and hold them in our hands. 

Kokichi Sugihara has written papers formulating how to construct 3-dimensional objects that appear differently than their reflection in a mirror. For our assignment, I relied heavily on his formulas to execute my design. Below you will see examples of Sugihara’s ambiguous objects, and then the designs that I made.







I decided to design a hexagon inscribed in a unit circle. In order to construct the figure, I utilized Wolfram Mathematica. The Piecewise[] function was an integral part of my construction, due to the nature of a hexagon. After the figure had been created, the next goal was to subtract the two functions from each other, and divide by 2. The goal is to “indent” one function on the other, so that as the viewing angle changes, the figure changes shape.

Dual Overlapping Cylinders

Jean-Marc Daviau-Williams

For the print this week, we made ambiguous objects where when viewed from a 45 degree angle is seen as one shape, but when viewed from the opposite direction is seen as another.  My object was a dual, overlapping cylinder where they look like diamond cylinders with one side over the other and elliptical/circular cylinders from the opposite direction with the other side over.  The process of making this print was a learning experience, but came out well.

First, I had to greater familiarize myself with Mathematica, understanding how the function for creating the 3d model interacts with the mathematical functions put through it.  I started with the function ParametricPlot3D[], with the boilerplate code provided with the assignment.  Next, I copied the arguments, shifted them by plus or minus 1, and pasted them as additional arguments in the same function.  This created the initial plan of the two shapes, ensuring the optical illusion could be achieved.  



Next, I had to use the same ParametricPlot3D[] function to create the full 3d model to print.  This added an additional layer of complexity, as the code required many more nested, curly-bracket arguments.  After some playing around with the values, I was able to get my cylinders positioned one over the other and overlapping in the x direction.  Overall, this took the most effort in the whole process.



Finally was the process of printing the actual object.  During my print slot, the only printer available was the makerbot as the ultimaker and lulzbot were experiencing technical difficulties, which is common for cutting-edge technology.  With the .stl file I exported from Mathematica, it was sliced on the makerlab computer and took x hours to print.




This assignment was an important learning experience.  Many 3d objects that are hard to visualize are only possible to create through the use of mathematical functions in cartesian, polar, or spherical coordinates in software like Mathematica.  This will be even more apparent in the next assignment, where I am to print a visual representation of the discontinuity of a surface, differentiable in the x and y directions but non-differentiable itself.