New Reply

Mathematica, gradient plot on the graph

 
Share Thread Thread Tools
Aug1-12, 01:57 PM   #1
 

Mathematica, gradient plot on the graph


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
PhysOrg.com
PhysOrg
science news on PhysOrg.com

>> King Richard III found in 'untidy lozenge-shaped grave'
>> Google Drive sports new view and scan enhancements
>> Researcher admits mistakes in stem cell study
Aug2-12, 11:22 PM   #2
 
Recognitions:
Gold Membership Gold Member
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?
Attached Thumbnails
arrowsonparabola.jpg  
New Reply

Tags
gradient, mathematica, vectorfield
Thread Tools


Similar Threads for: Mathematica, gradient plot on the graph
Thread Forum Replies
Mathematica array plot won't plot and it erases all of my stored variables Math & Science Software 1
Mathematica:how to plot a maximum point in a graph Math & Science Software 4
Plot 3D matrix as 2D plot and 3rd dimension as color in Mathematica Math & Science Software 8
How to plot it graph in Mathematica General Physics 4
Rasterized density plot + countour plot in Mathematica (to solve EPS issues) Math & Science Software 0