Reza Malek-Madani

Gradient, Divergence, and Curl

To access gradient, divergence, and curl first input

<<Calculus`VectorAnalysis`

To do computations in rectangular coordinates:

SetCoordinates[Cartesian[x,y,z]]

[Graphics:VectorCalculusgr2.gif][Graphics:VectorCalculusgr1.gif]

Gradient

To determine the gradient of f(x,y) = (x^2+y^2)^(1/2):

Grad[Sqrt[x^2+y^2]]

[Graphics:VectorCalculusgr2.gif][Graphics:VectorCalculusgr3.gif]

To plot the contours of f:


[Graphics:VectorCalculusgr2.gif]


[Graphics:VectorCalculusgr4.gif]



[Graphics:VectorCalculusgr2.gif][Graphics:VectorCalculusgr5.gif][Graphics:VectorCalculusgr2.gif][Graphics:VectorCalculusgr6.gif]

To make the picture smoother:


[Graphics:VectorCalculusgr2.gif]


[Graphics:VectorCalculusgr7.gif]



[Graphics:VectorCalculusgr2.gif][Graphics:VectorCalculusgr8.gif][Graphics:VectorCalculusgr2.gif][Graphics:VectorCalculusgr9.gif]

Divergence

To determine the divergence of v = <x y z, 1/(x^2-y^2), x^2 z>:

Div[{x y z, 1/(x^2 - y^2), x^2 z}]

[Graphics:VectorCalculusgr2.gif][Graphics:VectorCalculusgr10.gif]

Curl

To determine the divergence of v = <x y z, 1/(x^2-y^2), x^2 z>:

Curl[{x y z, 1/(x^2 - y^2), x^2 z}]

[Graphics:VectorCalculusgr2.gif][Graphics:VectorCalculusgr11.gif]

go to Top