Overlay a surface and gradient feild

General discussion about Mathematica features and functionality...
Forum Rules
By using the Wolfram Faculty Program Forum, you agree not to post any abusive, obscene, vulgar, slanderous, hateful, threatening, or sexually oriented material. Wolfram Faculty Program Forum administrators have the right to remove, edit, move or close any topic at any time should we see fit.

Personal Information: Posts in this forum may be viewed by non-members; however, the forum prohibits non-members from viewing your profile. Although your email address is hidden from both non-members and members, your account is initially configured to allow members to contact you via email through the forum. If you wish to hide your profile, or prohibit others from contacting you directly, you may change these settings by updating your profile through the User Control Panel.

Attachments: Attachments are not currently enabled on this forum. To share a file with others on this site, simply upload your file to the online storage service of your choice and include a link to the file within your post. If your school does not offer an online file storage and sharing service, the following sites provide free basic online file storage and sharing: Mozy, FilesAnywhere, Adrive, and KeepandShare.

Overlay a surface and gradient feild

Postby Adam_Caudell » Tue Apr 06, 2010 4:19 am

I am trying to produce a single graphic that has the surface
Code: Select all
f[x_,y_]:=3x^2y+4xy^2-6xy^3+4x^2y^2
and below it its associated gradient field. I can generate the surface and the gradient field, but I cannot combine them into a single graphic. I have tried naming each plot and using the Show[ ] function, but it does not work.

Essentially, I trying to get this: http://upload.wikimedia.org/wikipedia/e ... ient99.png

Albeit this is a different function, this is what I am trying to accomplish.

Any suggestions?

Thanks,

Adam
User avatar
Adam_Caudell
 
Posts: 4
Joined: Fri Feb 26, 2010 6:24 am
Organization: Minarets High School
Department: Mathematics

Re: Overlay a surface and gradient feild

Postby Jose_Luis_Gomez » Tue Apr 06, 2010 6:01 pm

f[x_, y_] := 3 x^2 y + 4 x*y^2 - 6 x*y^3 + 4 (x^2)*(y^2);
mygrad[x_, y_, z_] := Evaluate[D[f[x, y], {{x, y, z}}]];
vp3d = VectorPlot3D[ mygrad[x, y, z], {x, -1, 1}, {y, -1, 1}, {z, -16, -14}, VectorStyle -> "Dart"];
shiftedvp3d = vp3d /. {x_?NumberQ, y_?NumberQ, z_?NumberQ} :> {x, y, -20};
Show[Plot3D[f[x, y], {x, -1, 1}, {y, -1, 1}, PlotRange -> All, PlotStyle -> Opacity[0]], shiftedvp3d]
User avatar
Jose_Luis_Gomez
 
Posts: 22
Joined: Wed Feb 03, 2010 7:57 pm
Location: Mexico
Organization: ITESM CEM Mexico
Department: Ciencias Basicas

Re: Overlay a surface and gradient feild

Postby Adam_Caudell » Fri Apr 09, 2010 9:25 pm

Wow...would have never figured that out on my own. Thanks!
User avatar
Adam_Caudell
 
Posts: 4
Joined: Fri Feb 26, 2010 6:24 am
Organization: Minarets High School
Department: Mathematics


Return to General Mathematica Discussion

Who is online

Users browsing this forum: No registered users and 1 guest

cron