# mathematica examples

x1[v_,w_]:=3Cos[v]Cos[w];
x2[v_,w_]:=Cos[v]Sin[w];
x3[v_,w_]:=Sin[v]

x[v_,w_]:={x1[v,w], x2[v,w], x3[v,w]};

ParametricPlot3D[x[s,t], {s,-1.5,1.5}, {t,-2,2}]

—————–         ——————————–

x[u_,v_] := {Cos[v] Cos[u],Cos[v] Sin[u], Sin[v]}

eeh[u_,v_]:=D[x[u,v],u].D[x[u,v],u]

ffh[u_,v_]:=D[x[u,v],u].D[x[u,v],v]

ggh[u_,v_]:=D[x[u,v],v].D[x[u,v],v]

<<efg.m

<< christoffel.m

<<gdesolv.m

soln1= gdesolv[0,0,1,0,0,-5,5]

soln2= gdesolv[0,0,1,-3,0,-5,5]

soln3= gdesolv[0,0,1,3,0,-5,5]

aa=ParametricPlot[Evaluate[{u[t],v[t]}/.soln1], {t,-Pi,Pi}, AspectRatio -> Automatic, ImageSize ->200,DisplayFunction->Identity] ;

bb=ParametricPlot[Evaluate[{u[t],v[t]}/.soln2], {t,-Pi,Pi}, AspectRatio -> Automatic, ImageSize ->200,DisplayFunction->Identity] ;

cc=ParametricPlot[Evaluate[{u[t],v[t]}/.soln3], {t,-Pi,Pi}, AspectRatio -> Automatic, ImageSize ->200,DisplayFunction->Identity] ;

Show[GraphicsArray[{aa,bb,cc}]];

eew=ParametricPlot3D[Evaluate[x[u[t],v[t]]/.soln1], {t,0,3Pi/2}, ImageSize ->200,DisplayFunction->Identity];

ffw=ParametricPlot3D[Evaluate[x[u[t],v[t]]/.soln2], {t,0,3Pi/2}, ImageSize ->200,DisplayFunction->Identity] ;

ggw=ParametricPlot3D[Evaluate[x[u[t],v[t]]/.soln3], {t,0,3Pi/2}, ImageSize ->200,DisplayFunction->Identity]

Show[GraphicsArray[{eew,ffw,ggw}]];

Show[ ParametricPlot3D[Evaluate[x[u[t],v[t]]/.soln1], {t,0,Pi/1.1}, ImageSize ->200],

ParametricPlot3D[Evaluate[x[u[t],v[t]]/.soln2], {t,0,Pi/3}, ImageSize ->200],

ParametricPlot3D[Evaluate[x[u[t],v[t]]/.soln3], {t,0,Pi/3}, ImageSize ->200],

PointParametricPlot3D[x[u,v],{u,0,2 Pi},{v,0,2 Pi},PlotPoints->30,Axes-> True,ViewPoint->{1.659, 1.242, 3.035}]

]

Show[%,ViewPoint->{3, 5, 2},ImageSize ->600

–ParametricPlot3D[4{Sech[v]Sin[w],v-Tanh[v],Sech[v]Cos[w]},{v,0,5},{w,0,2 Pi}]

### 21 responses to “mathematica examples”

1. kitu♪

COMANDOS PARA LA:

x[u_, v_] := {u, v, 0.25 v^2 – 0.20 u^2}

eeh[u_, v_] := D[x[u, v], u].D[x[u, v], u]
ffh[u_, v_] := D[x[u, v], u].D[x[u, v], v]
ggh[u_, v_] := D[x[u, v], v].D[x[u, v], v]

<< efg.m
<< christoffel.m
<< gdesolv.m

soln1 = gdesolv[0, 0, 1, 0, 0, -5, 5]
soln2 = gdesolv[0, 0, 1, 4, 0, -5, 5]
soln3 = gdesolv[0, 0, 1, 8, 0, -5, 5]

gg1:=ParametricPlot3D[x[u[t], v[t]] /. soln1, {t, -4, 4}, PlotStyle -> Thickness[0.02]]
gg2:=ParametricPlot3D[x[u[t], v[t]] /. soln2, {t, -2, 2}, PlotStyle -> Thickness[0.01]] ;
gg3:=ParametricPlot3D[x[u[t], v[t]] /. soln3, {t, -2, 2}, PlotStyle -> Thickness[0.01]] ;
gg4 := ParametricPlot3D[x[u, v], {u, -7, 7 }, {v, -7, 7}, Mesh -> None, PlotStyle -> Opacity[0.5]];

Show[gg1, gg2, gg3, gg4, PlotRange -> All]

ESTA SIGUIENTE PLOTEA DOS PUNTOS EN EL ESPACIO

Graphics3D[{PointSize[0.1], Point[{-{1, 1, 1}, {1, 1, 1}}, VertexColors -> {Red, Green}]}, PlotRange -> 1.5]

2. kitu♪

curva[t_] := {(5 + Cos[3 t]) Cos[4 t], (5 + Cos[3 t]) Sin[4 t], Sin[3 t]};

3. kitu♪

a = ParametricPlot3D[curva[t], {t, 0, 7}, PlotStyle -> {Thickness[0.02]}]
b = ParametricPlot3D[{(5 + Cos[w]) Cos[v], (5 + Cos[w]) Sin[v], Sin[w]}, {v, 0, 2 \[Pi]}, {w, 0, 2 \[Pi]}];
Show[a, b]

4. c-kit

On $\Lambda^2(V)$

A = {{0, a/2, b/2}, {-a/2, 0, c/2}, {-b/2, -c/2, 0}};
B = {{0, aa/2, bb/2}, {-aa/2, 0, cc/2}, {-bb/2, -cc/2, 0}};
G = {{5, 0, 0}, {0, 1, 1}, {0, 1, 2}};
{MatrixForm[A], MatrixForm[B], MatrixForm[G]}
MatrixForm[Inverse[G].A.Inverse[G]]
MatrixForm[Inverse[G].A.Inverse[G].Transpose[A]]
MatrixForm[Inverse[G].A.Inverse[G].Transpose[B]]
{Tr[%], Tr[%%]}
Simplify[%]

5. c-kit

A = {{0, a/2, b/2}, {-a/2, 0, c/2}, {-b/2, -c/2, 0}};
B = {{0, aa/2, bb/2}, {-aa/2, 0, cc/2}, {-bb/2, -cc/2, 0}};
G = {{1, 0, 0}, {0, 1, 1}, {0, 1, 2}};
{MatrixForm[A], MatrixForm[B], MatrixForm[G]}
MatrixForm[Inverse[G].A.Inverse[G]]
MatrixForm[Inverse[G].A.Inverse[G].Transpose[A]]
MatrixForm[Inverse[G].A.Inverse[G].Transpose[B]]
Tr[%]
Simplify[%]

6. chimp

EJEMPLO PARA MATHEMATICA-5

curva1[t_] := {2.7 Cos[t], 2.7 Sin[t], 0.7};
curva2[t_] := {Cos[t], Sin[t], 0};
a1 = ParametricPlot3D[Append[curva1[t], Thickness[0.020]] // Evaluate, {t, 0, 7}, PlotPoints -> 200];
a2 = ParametricPlot3D[Append[curva2[t], Thickness[0.020]] // Evaluate, {t, 0, 7},
PlotPoints -> 200];
b = ParametricPlot3D[{ {(2 + Cos[u]) Cos[v], (2 + Cos[u]) Sin[v], Sin[u]}, {u Cos[v/1], u Sin[v/1], u^2/11}},
{u, 0, 2 \[Pi]}, {v, \[Pi]/2, 2 \[Pi]}];
Show[a1, a2, b, PlotRange -> All]

7. chimp

curva[t_] := {4 (Cos[3 t] + Cos[2 t]), 4 (5 – Cos[t]) Sin[3 t],7 Sin[t]};
a=ParametricPlot3D[Append[curva[t], Thickness[0.009]] // Evaluate, {t, 0, 7}, PlotPoints -> 200];
b=ParametricPlot3D[{(8 + Cos[w]) Cos[v], (8 + Cos[w]) Sin[v], 4 Sin[w]}, {v, 0, 2 \[Pi]}, {w, 0, 2 \[Pi]}];
c=ParametricPlot3D[{(15 + 13 Cos[w]) Cos[v], (15 + 13 Cos[w]) Sin[v], -3 Sin[w]}, {v, \[Pi]/3, \[Pi]}, {w, 0, 2 \[Pi]}];
Show[b, c, PlotRange -> All]
Show[a, b, c, PlotRange -> All]

8. peace'n'love

\[CapitalPhi][u_, v_] := {(7 + 2 Cos[u]) Cos[v], (7 + 2 Cos[u]) Sin[v], 2 Sin[u]};

\[Alpha]1[t_] := \[CapitalPhi][t, 2 t];

\[Alpha]2[t_] := \[CapitalPhi][t + \[Pi]/2, 2t];

\[CapitalPsi]1[s_,w_] := s \[Alpha]1[w] + (1 – s) \[Alpha]2[ w + \[Pi]]; \[CapitalPsi]2[s_, w_] :=
s \[Alpha]1[w] + (1 – s) \[Alpha]2[w];

\[Beta]1[t_] :=
t \[Alpha]1[0 + t0] + (1 – t) \[Alpha]2[0 + t0];

\[Beta]2[t_] :=
t \[Alpha]1[\[Pi] + t0] + (1 – t) \[Alpha]2[\[Pi] + t0];

\[Beta]3[
t_] := t \[Alpha]1[
0 + t0] + (1 – t) \[Alpha]2[\[Pi] + t0];

\[Beta]4[t_] := t \[Alpha]1[\[Pi] + t0] + (1 – t) \[Alpha]2[0 + t0]; t0 := \[Pi]/4

nudo1 = ParametricPlot3D[\[Alpha]1[r], {r, 0, 2 \[Pi]},
PlotStyle ->
AbsoluteThickness[
5]]; \

nudo2 = ParametricPlot3D[\[Alpha]2[r], {r, 0, 2 \[Pi]},
PlotStyle ->
AbsoluteThickness[
2]]; \

aro1 = ParametricPlot3D[\[CapitalPsi]1[s, w], {s, 0, 1}, {w, 0,
2 \[Pi]}, PlotStyle -> Opacity[0.68], Mesh -> None,
PlotPoints -> 25, ColorFunction -> “BlueGreenYellow”];

aro2 = ParametricPlot3D[\[CapitalPsi]2[s, w], {s, 0, 1}, {w, 0, 2 \[Pi]},
PlotStyle -> Opacity[0.88], Mesh -> None, PlotPoints -> 25,
ColorFunction -> “Rainbow”];

bet1 = ParametricPlot3D[\[Beta]1[t], {t, 0, 1},
PlotStyle ->
AbsoluteThickness[
5]];

bet2 =
ParametricPlot3D[\[Beta]2[t], {t, 0, 1},
PlotStyle ->
AbsoluteThickness[
5]];

bet3 =
ParametricPlot3D[\[Beta]3[t], {t, 0, 1},
PlotStyle ->
AbsoluteThickness[
5]];

bet4 =
ParametricPlot3D[\[Beta]4[t], {t, 0, 1},
PlotStyle ->
AbsoluteThickness[
5]];

Show[nudo1, nudo2, aro1, aro2, bet1, bet2, bet3, bet4, PlotRange -> All, Ticks -> None]

9. peace&love

tres bandas de Mobius

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

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

z[u_, v_] := {(1 + v Cos[u/2]/2)Cos[u], (1 + v Cos[u/2]/2)Sin[u], -1 + v Sin[u/2]/2}

gra1 = ParametricPlot3D[x[u, v], {u, 0.4, 2\[Pi] – 1}, {v, -1, 1}, PlotPoints -> 15, Axes -> True,
ViewPoint -> {3.659, 1.242, 3.035}];

gra2 = ParametricPlot3D[y[u, v], {u, 0.4, 2\[Pi] – 1.5}, {v, -1, 1}, PlotPoints -> 15, Axes -> True];

gra3 = ParametricPlot3D[z[u, v], {u, 0.4, 2\[Pi] – 0.5}, {v, -1, 1}, PlotPoints -> 15, Axes -> True];

Show[gra1, gra2, gra3, ViewPoint -> {5.960, -5.572, 3.464}]

10. juan

with

x1[v_, w_] := (1 + w Cos[v/2]/2)Cos[v]
x2[v_, w_] := (1 + w Cos[v/2]/2)Sin[v]
x3[v_, w_] := w Sin[v/2]/2

we get the mobius strip:

X[v_, w_] := {x1[v, w], x2[v, w], x3[v, w]}

ParametricPlot3D[X[s, u], {s, 0, 2π}, {u, -0.3, 0.3}, Shading -> False]
ParametricPlot3D[Append[{Cos[t], Sin[t], 0}, Thickness[0.019]] // Evaluate, {t, -10π, 10π},
PlotPoints -> 100];

11. peace

PARA UN EJEMPLO DE LA CURVATURA GAUSSIANA

x[u_, v_] := {u, v, 5 u – v^2};

a11 = Det[{D[x[uu, vv], uu, uu], D[x[uu, vv], uu], D[x[uu, vv], vv]}];
a22 = Det[{D[x[uu, vv], vv, vv], D[x[uu, vv], uu], D[x[uu, vv], vv]}];
a12 = Det[{D[x[uu, vv], uu, vv], D[x[uu, vv], uu], D[x[uu, vv], vv]}];

g11 = D[x[uu, vv], uu].D[x[uu, vv], uu];
g22 = D[x[uu, vv], vv].D[x[uu, vv], vv];
g12 = D[x[uu, vv], uu].D[x[uu, vv], vv];

Simplify[a11 a22 – a12^2]
Simplify[g11 g22 – g12^2]^2

12. $S^1\times S^1$, “el torus”

x1[v_, w_] := (2 + Cos[v])Cos[w];
x2[v_, w_] := (2 + Cos[v])Sin[w];
x3[v_, w_] := Sin[v]

x[v_, w_] := {x1[v, w], x2[v, w], x3[v, w]}

ParametricPlot3D[x[v, w], {v, 0, 2 Pi}, {w, 0, 2 Pi}]

13. juan

ZIRKELS FATTA ROTATED

AA[x_] := {{1, 0, 0}, {0, Cos[x], -Sin[x]}, {0, Sin[x], Cos[x]}}
BB[y_] := {{Cos[y], 0, -Sin[y]}, {0, 1, 0}, {Sin[y], 0, Cos[y]}}
MatrixForm[BB[y].AA[x]]

cc[t_] := {0, Cos[t], Sin[t]}
dd1[t_] := BB[0].AA[0].cc[t]
dd2[t_] := BB[π/6].AA[3π/4].cc[t]
dd3[t_] := BB[5π/6].AA[π/12].cc[t]

zirkel1 = ParametricPlot3D[Append[0.8dd1[t], Thickness[0.03]] // Evaluate, {t, 0, 2π}];
zirkel2 = ParametricPlot3D[Append[0.8dd2[t], Thickness[0.03]] // Evaluate, {t, 0, 2π}];
zirkel3 = ParametricPlot3D[Append[0.8dd3[t], Thickness[0.03]] // Evaluate, {t,0, 2π}];

Show[{zirkel1, zirkel2, zirkel3}]

Show[% , Axes ->; True]

14. juan

MOBIUS CON CURVA G

x[v_, w_] := (1 + w Cos[v/2]/2)Cos[v]
y[v_, w_] := (1 + w Cos[v/2]/2)Sin[v]
z[v_, w_] := w Sin[v/2]/2

F[v_, w_] := {x[v, w], y[v, w], z[v, w]}

ParametricPlot3D[F[s, u], {s, 0, 2π}, {u, -0.3, 0.3}, Shading -> False]
ParametricPlot3D[Append[{Cos[t], Sin[t], 0}, Thickness[0.019]] // Evaluate, {t, -10π, 10π}, PlotPoints -> 100];

15. curva[t_] := {(5 + Cos[t]) Cos[3t], (5 + Cos[t])Sin[3t], Sin[t]};

a = ParametricPlot3D[Append[curva[t], Thickness[0.03]] //Evaluate, {t,0,7}, FaceGrids -> None, ViewPoint-> {2.688, 1.427, 2.0}, PlotPoints -> 200]

b = ParametricPlot3D[{(5 + Cos[w])Cos[v], (5 + Cos[w])Sin[v], Sin[w]}, {v, 0, 2π}, {w, 0, 2π}];

Show[a, b, ViewPoint -> {0.663, 1.075, 1.017}]

16. c-qit

AA[x_] := {{1, 0, 0}, {0, Cos[x], -Sin[x]}, {0, Sin[x], Cos[x]}}
BB[y_] := {{Cos[y], 0, -Sin[y]}, {0, 1, 0}, {Sin[y], 0, Cos[y]}}
MatrixForm[BB[y].AA[x]]

cc[t_] := {0, Cos[t], Sin[t]}
dd1[t_] := BB[0].AA[0].cc[t]
dd2[t_] := BB[\[Pi]/6].AA[3\[Pi]/4].cc[t]
dd3[t_] := BB[5\[Pi]/6].AA[\[Pi]/12].cc[t]

zirkel1=ParametricPlot3D[0.8dd1[t], {t, 0, 2\[Pi]}];
zirkel2=ParametricPlot3D[2dd2[t], {t, 0, 2\[Pi]}];
zirkel3=ParametricPlot3D[dd3[t], {t, 0, 2\[Pi]}]; Show[{zirkel1, zirkel2, zirkel3}]

Show[%, Axes -> False]

17. ma

cc[t_] := {0, Cos[t], Sin[t]}

zirkel1=ParametricPlot3D[BB[-1].AA[\[Pi]/4].cc[t], {t, 0, 2\[Pi]}];
zirkel2=ParametricPlot3D[BB[\[Pi]/6].AA[3\[Pi]/4].cc[t], {t, 0, 2\[Pi]}];
zirkel3=ParametricPlot3D[0.5BB[5\[Pi]/6].AA[\[Pi]/12].cc[t], {t, 0, 2\[Pi]}];

Show[{zirkel1,zirkel2, zirkel3}]

18. ma

AA[x_]:={{1,0,0},{0,Cos[x],-Sin[x]},{0,Sin[x],Cos[x]}}

BB[y_]:={{Cos[x],0,-Sin[x]},{0,1,0},{Sin[x],0,Cos[x]}}

MatrixForm[BB.AA[x]]