Math 21a, Fall 2007
Exhibits page Math 21a 07, Multivariable Calculus
Use of Multivariable Calculus
Course head: Oliver Knill
Office: SciCtr 434
Here are 8 of the 100 slides from the intro meeting of Tuesday Sep 18. The story illustrates that multivariable calculus concepts can be useful to visualize concepts. The example is a NYT article by Floyd Norris of September 15, 2007 titled "Double Warning That a Recession May Be on the Way". Below I describe in more detail, how a Mathematica program extracts yield spread and employment change functions y(t), e(t) and produces a curve r(t) = (e(t),y(t)) which illustrates better the indications.
Click on one of the thumbnails to see the slide larger.

The NYT article

The Source and the scanned version:

The graphs

Here are the graphs extracted from the illustration "Bonds and Employment".

The mathematica program

The Mathematica program takes these pictures, produces from it functions and plots the parametrized curve r(t) = (e(t),y(t)).

The point is that Computer algebra systems like Mathematica allow programming in a high level. Objects can be graphics, functions etc. The following function for example takes a bitmap graphics which contains a graph and extracts a function by checking for each x coordinate the lowest y1 and highest y value y2 where a pixel is dark and choosing f(x) = (y1+y2)/2. Many, many such programs - of course sufficiently refined - can work together to read text (OCR) and extract data given in graphical form. It is a primitive optical graph recognition program.

ExtractFunction[graphics_]:=Module[{A,B,B1,B2},
    A=Import[graphics]; B=A[[1]]; B1=B[[1]]; B2=2-Transpose[B1]; {width,height} = A[[2,2]];
    FindLeftBorder[v_] :=Module[{k},k=1; While[v[[k]]==0 && k < Length[v],k++];k];
    FindRightBorder[v_]:=Module[{k},k=Length[v]; While[v[[k]]==0 && k>1,k--];k];
    FindCenter[v_]:=(FindRightBorder[v]+FindLeftBorder[v])/2;
    {width,height,Function[x,FindCenter[B2[[Floor[x]]]]]}
];

{w1,h1,f1}=ExtractFunction["yieldspread.gif"]; 
{w2,h2,f2}=ExtractFunction["employment.gif"];  

w=Min[w1,w2]; {start,end}={1985,2007.75};  scale[x_]:= (x-start) (w-1)/(end-start); 
rec1=scale[1990]; r1l=scale[1989]; r1r=scale[1990];
rec2=scale[2001]; r2l=scale[2000.8]; r2r=scale[2001.4];
rec3=scale[2007]; r3l=scale[2006.7]; r3r=scale[2007.75];
S1= ParametricPlot[{f1[x],f2[x]},{x,1,w},PlotStyle->{RGBColor[1,1,0],Thickness[0.003]}]
S2= ParametricPlot[{f1[x],f2[x]},{x,r1l,r1r},PlotStyle->{RGBColor[1,0,0],Thickness[0.01]}]
S3= ParametricPlot[{f1[x],f2[x]},{x,r2l,r2r},PlotStyle->{RGBColor[0,1,0],Thickness[0.01]}]
S4= ParametricPlot[{f1[x],f2[x]},{x,r3l,r3r},PlotStyle->{RGBColor[0,0,1],Thickness[0.01]}]
S=Show[{S1,S2,S3,S4},Frame->False,Axes->False,Background->RGBColor[0,0,0]]


Note that in this course, we are not programming in Mathematica. We are using it mainly for graphing, computing integrals etc.
Questions and comments to knill@math.harvard.edu
Math21b | Math 21a | Fall 2007 | Department of Mathematics | Faculty of Art and Sciences | Harvard University