Mathematica, gradient plot on the graph

Click For Summary
SUMMARY

The discussion focuses on plotting a vector field representing the gradient of the function x^2 + y^2 using Mathematica. The user initially attempted to use ListVectorPlot3D but encountered issues, leading to the successful implementation of VectorPlot3D with specified vector points. The final solution combines Plot3D for the paraboloid and VectorPlot3D to visualize the gradient, achieving the desired result. The user seeks further assistance on adjusting the arrow positions in the vector plot.

PREREQUISITES
  • Familiarity with Mathematica syntax and functions
  • Understanding of vector fields and gradients
  • Knowledge of 3D plotting techniques in Mathematica
  • Basic concepts of parametric surfaces, specifically paraboloids
NEXT STEPS
  • Explore the use of VectorPlot3D options in Mathematica
  • Research methods to adjust arrow starting points in vector plots
  • Learn about customizing Plot3D visualizations in Mathematica
  • Investigate advanced vector field visualization techniques
USEFUL FOR

Mathematica users, data visualizers, educators, and students interested in 3D vector field plotting and gradient visualization techniques.

PeetPb
Messages
29
Reaction score
0
Hi,
I need to plot a vector field 2x,2y,0 which is the gradient of the function x^2+y^2. I need to plot it only in some interesting points (points on the paraboloid x^2+y^2). So I tried something like

a=Table[{{x,y,x^2+y^2},{2x,2y,0}},{x,-2,2,0.5},{y,-2,2,0.5}]
ListVectorPlot3D[a]

It did not work. The definition of ListVectorPlot3D[{{x,y,z},{a,b,c}},...] says that it generates a 3D vector plot from vector field values {a,b,c} given at specified points {x,y,z}.

Any idea how I might plot that gradient on the paraboloid ? It would be really unpleasant if I had to do every single vector with Graphics3D[]

thanks
 
Physics news on Phys.org
Code:
pnts = Flatten[Table[{x, y, x^2 + y^2}, {x, -2, 2, 1/4}, {y, -2, 2, 1/4}], 1];

plv = VectorPlot3D[{2 x , 2 y, 0}, {x, -2, 2}, {y, -2, 2}, {z, 0, 8},  VectorPoints -> pnts, VectorColorFunction -> "ThermometerColors",    VectorScale -> Small];

plp = Plot3D[x^2 + y^2, {x, -2, 2}, {y, -2, 2},  ColorFunction -> "GrayTones", BoxRatios -> {3, 3, 2}];

Show[plp, plv, ImageSize -> 600]

Gives me this: It took me a bit of time, but I have always wanted to learn how to do this anyway so 30 minutes well spent.

Does anyone know how i can make the arrows START at the point rather than be centered at it?
 

Attachments

  • arrowsonparabola.jpg
    arrowsonparabola.jpg
    36.4 KB · Views: 1,393
Last edited:

Similar threads

  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 9 ·
Replies
9
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K