Group Abstract Group Abstract

Message Boards Message Boards

0
|
4.5K Views
|
1 Reply
|
2 Total Likes
View groups...
Share
Share this post:

Embed Grad, Div & Curl directly into VectorPlot3D

Posted 6 years ago

Hi, Is it possible to directly embed functions such as (Grad, Div & Curl) directly into plot commands?

For example:

VectorPlot3D[
 Grad[{E^x Cos[y], E^x Sin[y], z}, {x, y, z}], {x, 0, 3}, {y, 0, 
  3}, {z, 0, 3}]

Thanks,

Mitch Sandlin

POSTED BY: Mitchell Sandlin

1) grad is an operation , that works on a scalar function

2) Embedding grad in a VectorPlot3D command :

grad[f_] := {D[f, x], D[f, y], D[f, z]}
VectorPlot3D[
 Evaluate[grad[x + y^3 Cos[x] - Sin[z]]], {x, 0, 3}, {y, 0, 3}, {z, 0, 3}]

3) that should work with curl as well

4) div is a scalar, that should be plotted in another way

div[a_] := D[a, x] + D[a, y] + D[a, z]
ContourPlot3D[
 Evaluate[div[{x^2, Sin[x y], Exp[- x y z]}]], {x, -2, 2}, {y, -2,   2}, {z, -2, 2}]
POSTED BY: Hans Dolhaine
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard