Exercise 1Let's do cylindrical first.
In[43]:=
Clear[x,y,z,r,theta,z]
In[44]:=
x[r_,t_,z_]:=r Cos[t]
y[r_,t_,z_]:=r Sin[t]
z[r_,t_,z_]:=z
In[45]:=
x[r,theta,z]
y[r,theta,z]
z[r,theta,z]
Out[45]=
r Cos[theta]
Out[46]=
r Sin[theta]
Out[47]=
z
In[48]:=
Clear[a,b,c]
{a,b,c}=Simplify[scalefactors[x,y,z][r,theta,z]]
Out[48]=
2
{1, Sqrt[r ], 1}
In[49]:=
Clear[u1,u2,u3,F,G]
In[50]:=
u1[r_,t_,z_]:=r^3 z^4 Sin[t]
u2[r_,t_,z_]:=z^3 r
F[r_,t_,z_]:={z^2,2,r}
G[r_,t_,z_]:={Cos[t],-Sin[t],0}
In[51]:=
newdiv[newcurl[F]][r,theta,z]
Out[51]=
0
In[52]:=
newcurl[newgrad[u1]][r,theta,z]
Out[52]=
{0, 0, 0}
In[53]:=
newcurl[newgrad[u2]][r,theta,z]
Out[53]=
{0, 0, 0}
In[54]:=
newdiv[newcurl[F]][r,theta,z]
Out[54]=
0
In[55]:=
Up to Exercises