Differential Properties of Curves and Surfaces

Examples of a parameterized surface with embedded curves

Create an example function that returns a position {x, y, z} as a function of two parameters

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

Visualize it.

Flowerplot = ParametricPlot3D[FlowerPot[u,v],{u,0,2 Pi},{v,0,2 Pi},PlotPoints->{120,40},PlotStyle->Directive[Brown,Opacity[0.6],Specularity[White,40]],Mesh->None]

A Curve on a parameritized surface

Now, we call the function again, but make the two parameters {u,v}, depend on a single parameter t (*note when visualizing this curve, it has been scaled in and out a little so it will be visible in subsequent visualizations*)

Vines[t_] :=FlowerPot[t Cos[t],-t^2Sin[ t]]
vineplot =ParametricPlot3D[{1.05*Vines[t],0.95*Vines[t]},{t,0, 2 Pi},PlotStyle->{{Thickness[0.025],Darker[Green]},{Thickness[0.025],Darker[Green]}},PlotRange->All]

This is the paramertized surface with a curve embedded in the surface.

Show[vineplot,Flowerplot]

Arc Length and Re-parameterizing Curves

Make up two functions that will illustrate the difference between a curve's parameter and its arclength

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

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

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:

dFlowerDt =Simplify[D[PrettyFlower[t],t]]

This is the arclength up to the parameter t, the integral does not have a closed-form

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

In other words, (ds^2)=    (dx^2)   +    (dy^2)    +     (dz^2)   so integrating the square root of this is the arclength

Applying this to the function Bendy defined above:

dBendyDt = D[Bendy[t],t]

This is the arclength up to the parameter t, the integral does have a closed-form, but is not easily invertible.

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

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π}:

sBendy/.t->0

However, the inverse exits, we can find a t(s) (the curve parameter t for any arclength s)

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

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

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

Multivariable Calculus: Mathematica Review

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

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

AScalarFunction[x,y,z]

The following lines print and they define expressions.

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]

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)

AScalarFunction[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:

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

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

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

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

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

AScalarFunction[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

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

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:

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

This last equation is  the form: (dF/dt)= ((∂F)/(∂x))(dx/dt) + ((∂F)/(∂y))(dy/dt)  + ((∂F)/(∂z))(dz/dt)  which looks like a thermodynamic expression if we multiply both sides by dt:

dF= ((∂F)/(∂x))dx + ((∂F)/(∂y))dy  + ((∂F)/(∂z))dz
Here, dF is interpreted as any change in the scalar function if its variables are also changed dx, dy, dz

Approximations (Taylor Expansions) as a function of the point of expansion

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

This is  symbolic representation of a first order expansion (keeping all terms) of a function near x,y,z

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

Using normal converts the approximation into an expression, but higher order terms are still present

dScalarFunction = Expand[Normal[SmallChangeSeries]]

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

dScalarFunction = dScalarFunction/.{dx dy -> 0, dy dz->0, dx dz->0}

The above form is like the thermodynamic expression:
dF= ((∂F)/(∂x))dx + ((∂F)/(∂y))dy  + ((∂F)/(∂z))dz

Interactive Visualization of a Approximations to Different Points on a Surface.

Example function of two variables:

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:

theplot = Plot3D[CrazyFun[x,y],{x,0.1,.9},{y,0.1,.9},PlotRange->All,Mesh->False,PlotStyle->{Opacity[0.5]}]

Now, approximate the function about a specific point (xo, yo), using Mathematica's Series function (this is now a function of four variables)

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):

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

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

Show[ theplot,anapprox]

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

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

The next function automates the small approximating surface patch

ApproxPlot[i_] := Plot3D[Evaluate[Approxfunction[x,y,xo[i],yo[i]]],{x,xo[i]-.1,xo[i]+.1},{y,yo[i]-.1,yo[i]+.1},PlotPoints->6,Mesh->True,ColorFunction->(RGBColor[0.9xo[i],0.9yo[i],#]&)]

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.

GraphicsStack[1] = Show[ApproxPlot[1]];

Here is the recursive function.

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

Manipulate[Show[theplot,GraphicsStack[i]],{{i,3},1,20,1}]