FrontEndExecute[FrontEndToken["DeleteGeneratedCells"]]

Problem 1

Clear["Global`*"]

{x,y,z}=DiagonalMatrix[{1,1,1}];
{x,y,z} //TableForm

?Dot

tmp1=Outer[dot,{"x","y","z"},{"x","y","z"}];
tmp1 //MatrixForm

tmp2=Outer[Dot,{x,y,z},{x,y,z},1];
tmp2 //TableForm[#,TableHeadings->{{"x","y","z"},{"x","y","z"}}]&

{tmp1,tmp2}  //Transpose//TableForm

?Cross

tmp3=Outer[cross,{"x","y","z"},{"x","y","z"}];
tmp3 //MatrixForm

tmp4=Outer[Cross,{x,y,z},{x,y,z},1];
tmp4 //MatrixForm[#,TableHeadings->{{"x","y","z"},{"x","y","z"}}]&

{tmp3,tmp4}   //Transpose //TableForm

{tmp3,tmp4}    //Transpose //Flatten[#,1]& //MatrixForm[#,TableDepth->3]&

Problem 2

Clear["Global`*"]

f1={x,y,0};
f2={-y,x,0};

?Div

Div[f1,{x,y,z}]

Div[f2,{x,y,z}]

?Curl

Curl[f1,{x,y,z}]

Curl[f2,{x,y,z}]

?VectorPlot

VectorPlot[f1[[1;;2]],{x,-1,1},{y,-1,1},PlotLegends->Automatic,VectorScale->Automatic]

VectorPlot3D[f1,{x,-1,1},{y,-1,1},{z,-1,1},PlotLegends->Automatic,VectorScale->Automatic]

VectorPlot[f2[[1;;2]],{x,-1,1},{y,-1,1},PlotLegends->Automatic,VectorScale->Automatic]

VectorPlot3D[f2,{x,-1,1},{y,-1,1},{z,-1,1},PlotLegends->Automatic,VectorScale->Automatic]

Problem 3

Clear["Global`*"]

f1={r,0,0};
f2={1/r^2,0,0};

Div[f1,{r,θ,z},"Cylindrical"]

Div[f1,{r,θ,ϕ},"Spherical"]

Div[f2,{r,θ,z},"Cylindrical"]

Div[f2,{r,θ,z},"Spherical"]

Curl[f1,{r,θ,ϕ},"Cylindrical"]

Curl[f1,{r,θ,ϕ},"Spherical"]

Curl[f2,{r,θ,ϕ},"Cylindrical"]

Curl[f2,{r,θ,ϕ},"Spherical"]

tx1={x,y,z}-> CoordinateTransform[ "Spherical" -> "Cartesian",{r,θ,ϕ}] //Thread

tx2={r,θ,ϕ}-> CoordinateTransform["Cartesian" ->  "Spherical" ,{x,y,z}]//Thread

f1 /.tx2

VectorPlot3D[ {x,y,z}  /.tx2,{x,-1,1},{y,-1,1},{z,-1,1},PlotLegends->Automatic,VectorScale->Automatic]

VectorPlot3D[ {x,y,z}  /.tx2,{x,-1,1},{y,-1,1},{z,-1,1},PlotLegends->Automatic,VectorScale->None]

VectorPlot[ ( {x,y,z}  /.tx2)[[1;;2]] /.{z->0},{x,0,1},{y,0,1},PlotLegends->Automatic,VectorScale->Automatic]

VectorPlot3D[ 1/r^2 {x,y,z}  /.tx2,{x,-1,1},{y,-1,1},{z,-1,1},PlotLegends->Automatic,VectorScaling->Automatic]

VectorPlot[ (1/r^2 {x,y,z}  /.tx2)[[1;;2]] /.{z->0},{x,0,1},{y,0,1},PlotLegends->Automatic,VectorScaling->Automatic]

VectorPlot[ (1/r^2 {x,y,z}  /.tx2)[[1;;2]] /.{z->0},{x,0,1},{y,0,1},PlotLegends->Automatic,VectorScale->None]

Problem 4

Clear["Global`*"]

f1={0,r,0};
f2={0,0,r Sin[θ] };

Div[f1,{r,θ,z},"Cylindrical"]

Curl[f1,{r,θ,ϕ},"Cylindrical"]

Div[f2,{r,θ,z},"Spherical"]

Curl[f2,{r,θ,ϕ},"Spherical"]

Problem 5

Clear["Global`*"]

eqy= y==y0 + vy0 t + (1/2) (-g ) t^2

eqx= x== x0 + vx0 t

values={x0->0, y0->h, vx0->v0 Cos[θ], vy0->v0 Sin[θ] };

tRoot=Roots[eqy /.{y->0},t]

(* _IF_ it  were to start and end at same height  *)
tRoot /.{y0->0} //PowerExpand

sol1=Solve[tRoot[[2]],t][[1]] (* Take the positive root *)

xSol=Solve[eqx /.sol1,x][[1]]

xSol /.values //FullSimplify

xSol /.values /.{h->0}//PowerExpand//FullSimplify

ticks =15 Range[0,6] Degree

Plot[Sin[2θ],{θ,0,π/2},Ticks->{ticks, Automatic},GridLines->{ticks,Automatic}]

xSol0=Solve[eqx,x][[1]]
ySol0=Solve[eqy,y][[1]]

{x,y} /.xSol0 /.ySol0 //.values

ff[t_,θ_,h_:40,v0_:20]={x,y} /.xSol0 /.ySol0 //.values /.{g->+10}
SetAttributes[ff,Listable]

ParametricPlot[ff[t,30 Degree,0],{t,0,3},PlotRange->{0,Automatic},AspectRatio->1/GoldenRatio]

list=5Range[ 17] Degree

list=15Range[ 5] Degree

ParametricPlot[  ff[t,list ,0] //Evaluate,
{t,0,10},
PlotRange->{{0,50},{0,Automatic}},
PlotLegends->list
]

ParametricPlot[  ff[t,list ,20] //Evaluate,
{t,0,10},
PlotRange->{{0,60},{0,Automatic}},
PlotLegends->list
]

Manipulate[
ParametricPlot[ Join[{ ff[t,theta Degree ,h]} , ff[t,list ,h] ] //Evaluate,
{t,0,10},
PlotRange->{{0,80},{0,Automatic}},
PlotLegends->Join[{theta Degree} ,list],
PlotStyle->{{Thickness[0.012],Dashing[0.03],Red},Green,Cyan,{Thickness[0.008],Blue},Orange,Purple, Black}
],
{{theta,40},0,90,5},
{{h,20},5,60,5}
]

Max Height

eqyv= 2 a (ymax-y0) == (vy^2) - (vy0^2)

solh=Solve[eqyv ,ymax][[1]]

values

solh /.values /.{a->-g, vy->0} //Simplify

Problem 6

Clear["Global`*"]

sol=Solve[m v^2/r == q v b,r][[1]]

r0=r /.sol /.{
m-> Quantity["ProtonMass"], 
q-> Quantity["ElectronCharge"],
 v-> Quantity["SpeedOfLight"], 
b->Quantity[7.7,"Teslas"] }

radius =UnitConvert[r0, "Meters"]

circumference= 2 π  radius

(* Fermilab *)
γ= (10^3);
γ circumference // UnitConvert[#, "Miles"]&

(* LHC *)
γ=7  (10^3);
γ circumference // UnitConvert[#, "Miles"]&