Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
sagemanifolds
GitHub Repository: sagemanifolds/IntroToManifolds
Path: blob/main/03Manifold_Graph.ipynb
Views: 80
Kernel: SageMath 9.6

3. Function graph as a manifold

This notebook is part of the Introduction to manifolds in SageMath by Andrzej Chrzeszczyk (Jan Kochanowski University of Kielce, Poland).

version()
'SageMath version 9.6, Release Date: 2022-05-15'

The graph Γ(f)={(x,f(x))Rm+n:xU},Γ(f)=\{(x, f(x))\in R^{m+n}: x ∈ U \},

for a smooth function f:URmf : U → R^{m} and an open subset URnU\subset R^n is a simple example of a smooth manifold having an atlas with a single chart

(Γ(f),φ),ϕ:(x,f(x))x,xU.(Γ( f ), φ ),\quad \phi: (x, f (x)) \to x,\quad x\in U.

One-dimensional function graph as a manifold


Since we don't use any predefined charts or transitions in this case, we can use general manifold (not the Euclidean space as previously).


Example 3.1

Here we use an open interval (0,2π)(0,2\pi):

J = manifolds.OpenInterval(0, 2*pi) # open interval J as manifold c.<t>=J.chart() # chart on J

First we plot U=(0,2π)U=(0,2\pi) as a subset of R2R^2 defined as x(t)=t,y(t)=0.x(t)=t,\quad y(t)=0.

R2 = Manifold(2, 'R^2') # manifold R^2 X.<x,y> = R2.chart() # chart on R^2 # F1: J -> R^2 : F1 = J.continuous_map(R2,{(c, X):[t,0]}, name='F1') # plot c p1=c.plot(X,mapping=F1,thickness=4,color='grey') p1.show(figsize=[4,3]) # show plot
Image in a Jupyter notebook

And next the image of UU under sinus function as a subset of R2R^2.

# continuous map x=t,y=sin(t): F2 = J.continuous_map(R2, {(c, X): [t,sin(t)]}, name='F2') p=c.plot(X,mapping=F2,color='grey',thickness=2) # plot image of J p.show(figsize=[4,3]) # under F2
Image in a Jupyter notebook

Example 3.2

Below, we map the same open interval into R3R^3.

# continuation po1={'thickness':5,'color':'darkblue'} # param. po2={'fontsize':20,'color':'black'} ax =line3d([(0,0,0), (1+0.15,0,0)], **po1) # axes ax+=line3d([(0,0,0), (0,1+0.15,0)], **po1) ax+=line3d([(0,0,0), (0,0,6.28+0.15)], **po1) ax+=text3d("x",(1.25,0,0),**po2) ax+=text3d("y",(0,1.25,0),**po2) ax+=text3d("z",(0.,0.,6.9),**po2)
J=manifolds.OpenInterval(0,2*pi) # open interval as manifold c.<t>=J.chart() # chart on J R3 = Manifold(3, 'R^3') # manifold R^3 X.<x,y,z> = R3.chart() # chart on R^3 # F: J -> R^3: F=J.continuous_map(R3,{(c,X):[cos(3*t),sin(3*t),t]},name='F') p=c.plot(X,mapping=F,color='grey',thickness=3, plot_points=200,label_axes=False) # plot image of J (p+ax).show(aspect_ratio=[1,1,0.3],frame=False) # show plot

Two-dimensional function graph as a manifold


Example 3.3

Now let UU be an open rectangle (π,π)×(π,π)(-\pi,\pi)\times (-\pi,\pi) in R2R^2.

R2 = Manifold(2, 'R^2') # manifold R^2 c_xy.<x,y> = R2.chart() # chart on R^2 U = R2.open_subset('U', # open subset of R^2 coord_def={c_xy: [x>-pi,x<pi,y>-pi,y<pi]}) c_U.<x,y>=U.chart() # chart on U

First we plot the coordinate lines in the set (π,π)×(π,π)(-\pi,\pi)\times(-\pi,\pi).

p=c_U.plot(number_values={x:15,y:15},color='grey') # plot p.show(figsize=4) # coordinate lines on U
Image in a Jupyter notebook

The graph of the function f(x,y)=cos(x2+y2)f(x,y)=\cos(\sqrt{x^2+y^2}) as a subset of R3R^3:

R3 = Manifold(3, 'R^3') # manifold R^3 c_XYZ.<X,Y,Z> = R3.chart() # chart on R^3 F = U.continuous_map(R3, # F: U -> R^3 {(c_U, c_XYZ): [x,y,cos(sqrt(x^2+y^2))]}, name='F') # plot the image of coordinate lines in U: p1=c_U.plot(c_XYZ,mapping=F,number_values={x:15,y:15}, color='black',thickness=2,label_axes=False) s=plot3d(cos(sqrt(x^2+y^2)),(x,-pi,pi),(y,-pi,pi), color='lightgrey',opacity=0.7) # plot image of U (p1+s).rotateZ(-pi/6).show(frame=False,aspect_ratio=[1,1,1.8]) # show plot