Physics 4321 : Homework #1 :

Problem #1:

Sketch a 2 - D vector field that has non - zero divergence but zero curl .

Clear["Global`*"]

grad= Grad[(x^2)+(y^2),{x,y}]

VectorPlot[{x,y}, {x,-1,1},{y,-1,1}]

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

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

Problem #2:

Sketch a 2-D vector field that has zero divergence but non-zero curl.

Clear["Global`*"]

VectorPlot[{-y,x}, {x,-1,1},{y,-1,1}]

Div[{-y,x},{x,y}]

Curl[{-y,x},{x,y}]

Problem #3:

Sketch a 2-D vector field that has non-zero divergence but non-zero curl.

Clear["Global`*"]

vec={x-y,y+x};
VectorPlot[vec, {x,-1,1},{y,-1,1}]

Div[vec,{x,y}]

Curl[vec,{x,y}]

Problem #4:

Sketch a 2-D vector field that has non-zero divergence but non-zero curl.

Clear["Global`*"]

f=(x^2)+(y^2)+(z^2);
Grad[f,{x,y,z}]

Plot3D[(x^2)+(y^2),{x,-1,1},{y,-1,1}]

VectorPlot[Grad[-f,{x,y,z}]//Drop[#,-1]& //Evaluate,{x,-1,1},{y,-1,1}]

VectorPlot3D[Grad[-f,{x,y,z}] //Evaluate ,{x,-1,1},{y,-1,1},{z,-1,1}]

Problem #5:

Sketch a 2-D vector field that has non-zero divergence but non-zero curl.

Clear["Global`*"]

f={x y,z/y,x y};
Div[f,{x,y,z}]

VectorPlot3D[{x y,z/y,x y},{x,-1,1},{y,-1,1},{z,-1,1}]

Plot3D[Div[f,{x,y,z}]//Evaluate,{y,-1,1},{z,-1,1}]

Problem #6:

Sketch a 2-D vector field that has non-zero divergence but non-zero curl.

Clear["Global`*"]

f={y,-x,0};
Curl[f,{x,y,z}]

VectorPlot[{y,-x},{x,-1,1},{y,-1,1}]

VectorPlot3D[Curl[f,{x,y,z}] //Evaluate ,{x,-1,1},{y,-1,1},{z,-1,1}]

OTHER STUFF

Clear["Global`*"]

tmp1=Series[Exp[I x],{x,0,5}]

tmp2= Series[Cos[x],{x,0,5}]

tmp3=Series[I Sin[x],{x,0,5}]

tmp2 + tmp3

tmp2 + tmp3 == tmp1

(((Exp[I x]+Exp[-I x]))/2) //FullSimplify

(((Exp[I x]-Exp[-I x]))/2) //FullSimplify

(((Exp[x]+Exp[- x]))/2) //FullSimplify

(((Exp[x]-Exp[-x]))/2) //FullSimplify

{Cos[ I x ],Sin[ I x ]} //FullSimplify

{Cosh[ I x ],Sinh[ I x ]} //FullSimplify

Plot[{Sin[x],Cos[x]},{x,0,2π},PlotStyle->{Red ,Green}]

Plot[{Sinh[x],Cosh[x]},{x,0,π},PlotStyle->{Red ,Green},PlotRange->{-5,5}]

Integrate[ Table[((Sin[x])^n),{n,0,10,1}],{x,0,2π}]

Integrate[ Table[((Cos[x])^n),{n,0,10,1}],{x,0,2π}]

?Zeta

Zeta[-1]

Zeta[2]

Sum[(1/(i^2)),{i,1,∞}]

Sum[(1/(i^a)),{i,1,10}]

Sum[(1/(i^2)),{i,1,∞}]