Please turn on JavaScript

Wolfram CDF Experiments

I am currently exploring various options for web-based interactive visualizations. Below are my first attempts using Wolfram's Computable Document Format. The visualizations below require a browser plugin that comes with Wolfram's free CDF Player or Mathematica.

Paddlewheel interpretation of curl

This demonstration shows a paddlewheel anchored at a particular point in a vector field \(\vec{F}\) (which is not displayed here) interpreted as a fluid flow velocity field. The curl of the vector field at this point is represented by the green arrow (bad color choice, will change later). The axis of the paddlewheel is represented by the unit vector \(\hat{p}\) (black here). In the paddlewheel interpretatin, the fluid flow rotates the paddlewheel at a rate proportional to the component of the curl in the direction of \(\hat{p}\).

In the visualization below, you can change the orientation of the paddlewheel using the sliders for the angles \(\phi\) and \(\theta\). You can use a checkbox to show the vector field locally in the plane of the paddlewheel. The other checkbox shows the difference between the local vector field and the value of the vector field at the center of the paddlewheel. You can also change the viewpoint by dragging in the picture. This is smoothest if you first stop the animation using the controls for the parameter \(\alpha\). You can then adjust the viewpoint and restart the animation.

For future development:

Utility functions in economics

This demonstration is to explore a family of utility functions from consumer choice theory in economics. In consumer choice theory, econonmists are studying how a consumer makes rational choices. For a very simple setting, consider a consumer who is buying a bundle containing two goods called \(A\) and \(B\). For example, \(A\) might be apples and \(B\) bananas. We let \(x\) be the amount purchased of \(A\) and \(y\) be the amount purchased of \(B\). For apples and bananas, \(x\) and \(y\) could be the weight, in pounds, of each. We then assign a value of utility \(U\) to each bundle \((x,y\). Think of the utility as measuring the usefulness or non-monetary value of that bundle for the consumer. One standard model for utility is given by

\[ U=\Bigl(px^{s}+(1-p)y^{s}\Bigr)^{1/s} \]

This family of functions has two parameters, the preference factor \(p\) and the "substitutibility" \(s\). The economically meaningful range for \(p\) is \(0\) to \(1\) while the range for \(s\) is \(-\infty\) to \(1\). One purpose of the visualization below is to help us better understand the role of these parameters.

In choosing a bundle, the consumer's goal is to maximize utility given a budget constraint. If the consumer has a total \(T\) to spend and the price per unit of goods \(A\) and \(B\) are given by \(a\) and \(b\), respectively, then the budget constraint is \[ T=ax+by. \] In the case of apples and bananas, \(a\) and \(b\) would have units of dollars per pound.

In the visualization below, the plot shows level curves for the utility as a function of \(x\) and \(y\). (Blue corresponds to low values of utility, red to high values.) In this context, each level curve is called an indifference curve since the consumer has the same utility for any bundle on a fixed curve and is thus indifferent to which bundle along the curve. You can change values of the parameters \(p\) and \(s\) using the sliders. To see the constraint curve, click the checkbox. You can then adjust the total budget \(T\) and the unit prices \(a\) and \(b\) using the sliders. You can also display the optimal indifference curve and the optimal point using checkboxes.

For future development:

A very right triangle on a sphere

This visualization demonstrates a triangle with three right angles. This is, of course, not possible in the Euclidean plane. It is possible on a sphere. To think about constructing a triangle with three right angles, we'll think about the sphere as the surface of the earth. Start at the north pole facing toward your home town. Walk (and/or swim as needed) straight toward your home town. Keep going until you hit the equator (so you'll go past your home town if it is north of the equator). You will have gone one-fourth of the way around the world. At the equator, turn 90 degrees to your right so you'll be facing west. Walk (and swim) straight along the equator until you have gone one-fourth of the way around the world in that direction. Again, turn 90 degrees to your right. You'll now be facing north. Walk/swim straight until you have gone one-fourth of the way around the world. This puts you back at the north pole. So, the three straight legs of your journey trace out a triangle on the sphere. The angle at each vertex is 90 degrees so you have a triangle with three right angles!

In the visualization below, you can use the sliders to trace out each of the legs (with the first going through Tacoma, Washington). You can then use the checkbox to show the three right angles. Drag the sphere with the mouse to see the triangle from different viewpoints.

For future development: