Differential Properties of Curves

Two examples of closed curves:

Here are two vectors with components given in terms of the parameter t:

In[68]:=

PrettyFlower[t_] := (1/4 + 3/4Cos[3t]) { Cos[t]^3, Sin[t]^3, Sin[t] Cos[t]^2}

Both of these functions define a list of 3 positions along each axis in terms of a single parameter

In[69]:=

Bendy[t_ ] := { Cos[t], Sin[t], Sin[t] Cos[t]}

Defining Functions to Display Them

In[70]:=

In[71]:=

showline[VecFunc_ , tl_ ] := Graphics3D[{Thickness[0.01], Hue[1], Line[{{0, 0, 0}, VecFunc[tl]}]}]

In[72]:=

showcurveline[VecFunc_ , tl_ ] := Show[{showcurve[VecFunc, tl], showline[VecFunc, tl]}, DisplayFunction→$DisplayFunction]

In[73]:=

CurveLineSequence[VecFunc_ ] := Table[showcurveline[VecFunc, i], {i, .1, 3 Pi, .1}]

Animating the Curves with Their Parameter

The following command produces a sequence of 3D graphics objects that can be animated.  To animate: Select all the graphics objects that are output; use the "Cell" menu to access "Cell Grouping" and select "Open/Close Group" (this will collapse the output to a single plot and make your notebook less cluttered); then use the "Cell" menu again and select "Animate Selected Graphics."

In[74]:=

CurveLineSequence[PrettyFlower] ;

[Graphics:HTMLFiles/Lecture-12_102.gif]

Do the same thing for a different parameterized vector function:

In[75]:=

CurveLineSequence[Bendy] ;

[Graphics:HTMLFiles/Lecture-12_198.gif]

Calculating Arc Length and Re-parameterizing

Here is a general way to take a function of a general parameter, t, and compute the arc length traversed as t varies from one value to another:

In[76]:=

dFlowerDt = D[Flower[t], t]

Out[76]=

Flower^′[t]

This is the arclength up to the parameter t

In[77]:=

sFlower = Integrate[Sqrt[dFlowerDt . dFlowerDt], t]

General :: spell1 : Possible spelling error: new symbol name \"sFlower\" is similar to existing symbol \"Flower\".  More…

Out[77]=

∫ (Flower^′[t] . Flower^′[t])^(1/2) t

Applying this to the function Bendy defined above:

In[78]:=

dBendyDt = D[Bendy[t], t]

Out[78]=

{-Sin[t], Cos[t], Cos[t]^2 - Sin[t]^2}

In[79]:=

sBendy = Integrate[Sqrt[dBendyDt . dBendyDt], t]

General :: spell1 : Possible spelling error: new symbol name \"sBendy\" is similar to existing symbol \"Bendy\".  More…

Out[79]=

EllipticE[2 t, 1/2]/2^(1/2)

The arc length in this case is given by a tabulated  function called an elliptic integral and after checking its behavior at t = 0 we can plot it over the range {t,0,2π}:

In[80]:=

sBendy/.t→0

Out[80]=

0

In[81]:=

Plot[sBendy, {t, 0, 2Pi}]

[Graphics:HTMLFiles/Lecture-12_213.gif]

Out[81]=

-Graphics -

Alternatively, we can evaluate the expression for arc length numberically using the following:

In[82]:=

Plot[Evaluate[NIntegrate[Sqrt[dBendyDt . dBendyDt], {t, 0, uplim}]], {uplim, 0, 6.4}]

NIntegrate :: nlim : t = uplim is not a valid limit of integration. More…

[Graphics:HTMLFiles/Lecture-12_217.gif]

Out[82]=

-Graphics -

In[83]:=

FlowerPot[u_, v_] := {(3 + Cos[v]) Cos[u], Sin[u] + (3 + Cos[v]) Sin[u], (3/2 + Cos[u + v]) Sin[v]}

Example of a parameritized surface

In[84]:=

<<Graphics`ParametricPlot3D`

In[85]:=

Flowerplot = ParametricPlot3D[FlowerPot[u, v], {u, 0, 2 Pi}, {v, 0, 2 Pi}, ViewPoint-> {0.141, 1.653, 1.117}, PlotPoints-> {120, 40}]

[Graphics:HTMLFiles/Lecture-12_222.gif]

Out[85]=

-Graphics3D -

A Curve on a parameritized surface

In[86]:=

Vines[t_] := 1.025 * FlowerPot[t Cos[t], -t^2Sin[ t]]

vineplot = ParametricPlot3D[Vines[t], {t, 0, 2 Pi}, ViewPoint-> {0.141, 1.653, 1.117}, PlotPoints->500]

[Graphics:HTMLFiles/Lecture-12_226.gif]

Out[87]=

-Graphics3D -

In the above, I want to put the vine outside the surface so I scale it out a little bit...

Out[53]=

-Graphics3D -

In[88]:=

thickvineplot = Show[{Graphics3D[Thickness[0.02]], Graphics3D[Hue[0.333, 0.5, 0.5]], vineplot}]

[Graphics:HTMLFiles/Lecture-12_230.gif]

Out[88]=

-Graphics3D -

In[89]:=

Show[thickvineplot, Flowerplot]

[Graphics:HTMLFiles/Lecture-12_233.gif]

Out[89]=

-Graphics3D -

In[90]:=

Show[Flowerplot, thickvineplot]

[Graphics:HTMLFiles/Lecture-12_236.gif]

Out[90]=

-Graphics3D -

Multivariable Calculus: Mathematica Review

AScalarFunction is defined everywhere in (x,y,z)

In[91]:=

AScalarFunction[x_ , y_ , z_] := SomeFunction[x, y, z]

In[92]:=

AScalarFunction[x, y, z]

Out[92]=

SomeFunction[x, y, z]

The following lines print and they define expressions.

In[93]:=

Print["derivative w/r to first argument is " ] ;   dFuncX = D[AScalarFunction[x, y, z], x]

Print["derivative w/r to second argument is " ] ;   dFuncY = D[AScalarFunction[x, y, z], y]

Print["derivative w/r to third argument is " ] ;   dFuncZ = D[AScalarFunction[x, y, z], z]

derivative w/r to first argument is

Out[93]=

SomeFunction^(1, 0, 0)[x, y, z]

General :: spell1 : Possible spelling error: new symbol name \"dFuncY\" is similar to existing symbol \"dFuncX\".  More…

derivative w/r to second argument is

Out[94]=

SomeFunction^(0, 1, 0)[x, y, z]

General :: spell : Possible spelling error: new symbol name \"dFuncZ\" is similar to existing symbols  {dFuncX, dFuncY} .  More…

derivative w/r to third argument is

Out[95]=

SomeFunction^(0, 0, 1)[x, y, z]

In the output lines above, partial derivatives are denoted by superscripts: e.g., (1,0,0) indicates the first partial derivative with respect to the first variable, x. The second partial with respect to y and z would be denoted by a superscript (0,1,1).

x(w,v), y(w,v), z(w,v) is a restriction of all space to a surface parameterized by (w,v),
AScalarFunction is now defined on the surface as a function of (w,v)

In[96]:=

AScalarFunction[x[w, v], y[w, v], z[w, v]]

Out[96]=

SomeFunction[x[w, v], y[w, v], z[w, v]]

Because it is now a function of w and v, the derivative with respect to x will vanish:

In[97]:=

D[AScalarFunction[x[w, v], y[w, v], z[w, v]], x]

Out[97]=

0

Two more flavors of derivatives, these are partial derivatives evaluated on the surface

In[98]:=

dFuncW = D[AScalarFunction[x[w, v], y[w, v], z[w, v]], w]

General :: spell : Possible spelling error: new symbol name \"dFuncW\" is similar to existing symbols  {dFuncX, dFuncY, dFuncZ} .  More…

Out[98]=

In[99]:=

dFuncV = D[AScalarFunction[x[w, v], y[w, v], z[w, v]], v]

General :: spell : Possible spelling error: new symbol name \"dFuncV\" is similar to existing symbols  {dFuncW, dFuncX, dFuncY, dFuncZ} .  More…

Out[99]=

On the surface x(w,v), y(w,v), z(w,v), we can prescribe a curve w(t), v(t), now we have
AScalarFunction defined on that curve

In[100]:=

AScalarFunction[x[w[t], v[t]], y[w[t], v[t]], z[w[t], v[t]]]

Out[100]=

SomeFunction[x[w[t], v[t]], y[w[t], v[t]], z[w[t], v[t]]]

The following is a derivative of the function along the curve parameterized by t

In[101]:=

dFuncT = D[AScalarFunction[x[w[t], v[t]], y[w[t], v[t]], z[w[t], v[t]]], t]

General :: spell : Possible spelling error: new symbol name \"dFuncT\" is similar to existing symbols  {dFuncV, dFuncW, dFuncX, dFuncY, dFuncZ} .  More…

Out[101]=

Note on the step immediately above: by specifying w and v, values of x and y are specified, and additionally values of z.  The three functions x(w,v), y(w,v), and z(w,v) together describe a surface---it specifies that three points can be specified by two values (A familiar case is when w=x, and v=y, then z(x,y) is a surface that can be specified over the x-y plane. The functions w(t) and v(t) trace out a plane curve on the w-v surface and map onto a corresponding twisted curve (see Kreyszig p.429 for distinction between "plane" and "twisted" if it is not obvious).

Finally, we could skip the surface and just define a space curve x(t), y(t), z(t) and  take the derivative of AScalarFunc along  that curve:

In[102]:=

dFuncT = D[AScalarFunction[x[t], y[t], z[t]], t]

Out[102]=

z^′[t] SomeFunction^(0, 0, 1)[x[t], y[t], z[t]] + y^′[t] SomeFunction^(0, 1, 0)[x[t], y[t], z[t]] + x^′[t] SomeFunction^(1, 0, 0)[x[t], y[t], z[t]]

Here, dF is interpreted as any change in the scalar function if its variables are also changed dx, dy, dz

Visualizing approximations (Taylor Expansions)  to surfaces at points

Getting Mathematica to represent a general change in a function--multidimensional versions of Taylor expansions

In[103]:=

SmallChangeSeries = Expand[Series[AScalarFunction[x + dx, y + dy, z + dz], {dx, 0, 1}, {dy, 0, 1}, {dz, 0, 1}]] - AScalarFunction[x, y, z]

Out[103]=

In[104]:=

dScalarFunction = Expand[Normal[SmallChangeSeries]]

Out[104]=

The next step eliminates second- and third-order terms… (remember, dx, dy, and dz are small)

In[105]:=

dScalarFunction = dScalarFunction/.{dx dy → 0, dy dz→0, dx dz→0}

Out[105]=

dz SomeFunction^(0, 0, 1)[x, y, z] + dy SomeFunction^(0, 1, 0)[x, y, z] + dx SomeFunction^(1, 0, 0)[x, y, z]

The above form is like the thermodynamic expression : dF = ∂F/∂xdx + ∂F/∂ydy   + ∂F/∂zdz

Example of using Taylor Expansion to turn a function of two variables into an approximating function of four  variables:

In[106]:=

CrazyFun[x_, y_] := (Sin[5π x] Sin[5π y] )/(x y) + ( Sin[5π (x - 1)] Sin[5π (y - 1)])/((x - 1) ( y - 1))

Plot this function over suitable range of the variables x and y:

In[107]:=

theplot = Plot3D[CrazyFun[x, y], {x, 0.1, .9}, {y, 0.1, .9}, PlotRange→All, Mesh→False]

[Graphics:HTMLFiles/Lecture-12_280.gif]

Out[107]=

-SurfaceGraphics -

Now, approximate the function about a specific point (xo, yo), using Mathematica's Series function:

In[108]:=

Approxfunction[x_, y_ , xo_ , yo_] := Series[CrazyFun[x, y], {x, xo, 2}, {y, yo, 2}]//Normal

and plot the approximate function in the neighborhood of (xo, yo):

In[109]:=

anapprox = Plot3D[Evaluate[Approxfunction[x, y, .7, .1]], {x, .7 - .1, .7 + .1}, {y, .1 - .1, .1 + .1}]

[Graphics:HTMLFiles/Lecture-12_284.gif]

Out[109]=

-SurfaceGraphics -

Both the original and the approximate function can be plotted simultaneously:

In[110]:=

Show[anapprox, theplot]

[Graphics:HTMLFiles/Lecture-12_287.gif]

Out[110]=

-Graphics3D -

This final little bit selects random points (xo, yo) and fits Taylor expansions to ten different points, then displays them individually as well as with a superposed plot of the original function.

In[111]:=

Table[{xo[i] = Random[], yo[i] = Random[]}, {i, 1, 100}] ;

The next function automates the small approximating surface patch

In[112]:=

To build a sequence of graphics, I'll build a stack of ten graphics objects by using a recursive method. The next command sets the end of the recursion loop.

In[113]:=

Clear[GraphicsStack]

In[114]:=

GraphicsStack[0] = Show[ApproxPlot[1], DisplayFunction→Identity]

Out[114]=

-SurfaceGraphics -

Here is the recursive function.

In[115]:=

GraphicsStack[i_] := GraphicsStack[i] = Show[GraphicsStack[i - 1], ApproxPlot[i + 1]]

In[116]:=

Show[GraphicsArray[{GraphicsStack[10], Show[theplot, GraphicsStack[10]]}], DisplayFunction→$DisplayFunction]

Graphics :: realu : Argument in RGBColor[0.19477, 0.193858, 1.00834] is not a real number between 0 and 1. More…

Graphics :: realu : Argument in RGBColor[0.19477, 0.193858, 1.00834] is not a real number between 0 and 1. More…

Graphics :: realu : Argument in RGBColor[0.19477, 0.193858, 1.00834] is not a real number between 0 and 1. More…

General :: stop : Further output of Graphics :: realu will be suppressed during this calculation. More…

[Graphics:HTMLFiles/Lecture-12_300.gif]

[Graphics:HTMLFiles/Lecture-12_301.gif]

Out[116]=

-GraphicsArray -


Created by Mathematica  (October 14, 2005) Valid XHTML 1.1!