Loading [MathJax]/jax/output/HTML-CSS/fonts/TeX/fontdata.js
Ask Your Question
2

Plot the intersection of two surfaces (or solutions of a system of eqs)

asked 8 years ago

this post is marked as community wiki

This post is a wiki. Anyone with karma >750 is welcome to improve it.

Hi everybody,

I'd like to plot the solutions of the system

(X+Y)(XZ3)=0,

XY+Y2=0.

in 3D, I mean, the set of points (X,Y,Z) in IR^3 that verify the system. I don't know how to do it. I was searching how to plot the intersection of both surfaces, but neither I could. ¿Could anyone tell me how to do it?

Thanks in advance

Preview: (hide)

3 Answers

Sort by » oldest newest most voted
1

answered 8 years ago

calc314 gravatar image

You can plot the solutions from the solve command by treating them as parametric equations for a surface and a line. Note that one of the solutions listed by solve is a subset of another of the solutions.

p=parametric_plot3d((r1,-r1,r2),(r1,-4,4),(r2,-2,2))
p+=parametric_plot3d((0,0,r3),(r3,-2,2),thickness=3)
p+=parametric_plot3d((r4^3,0,r4),(r4,-2,2),thickness=3)
Preview: (hide)
link
4

answered 8 years ago

B r u n o gravatar image

Here is a partial answer (I hope somebody can come with a better one!):

Plotting the solutions of an equation in R3 can be done using the method implicit_plot3d. So you can visualize the solutions of both equations as follows:

sage: var('x,y,z')
sage: s1 = implicit_plot3d((x+y)*(x-z^3), (x,-2,2),(y,-2,2), (z,-2,2))
sage: s2 = implicit_plot3d(x*y+y^2, (x,-2,2),(y,-2,2), (z,-2,2), color="red")
sage: show(s1)
[solutions of the first equation]
sage: show(s2)
[solutions of the second equation]

You can also visualize both solution sets together:

sage: show(s1+s2)

Since you are looking for solutions in R3, having both equations equal zero is the same as the sum of their squares equal zero. So in principle you could do

sage: implicit_plot3d(((x+y)*(x-z^3))^2+(x*y+y^2)^2, (x,-2,2),(y,-2,2), (z,-2,2))

But the problem is that if you try this you will see an empty set of solutions. I am not sure about the reason.

Finally, even though it is not visualization, note that you can have also the set of solutions using solve:

sage: sol = solve([(x+y)*(x-z^3),x*y+y^2], [x,y,z])
sage: sol
[[x == r1, y == -r1, z == r2], [x == 0, y == 0, z == r3], [x == r4^3, y == 0, z == r4]]
Preview: (hide)
link

Comments

Thank you very much! In order to see the intersection of the two surfaces, could I plot the solutions of the system, I mean, can "sol" be plotted?

Minkowski gravatar imageMinkowski ( 8 years ago )
0

answered 8 years ago

Minkowski gravatar image

Perfect! Thanks both of you. It can be seen perfecty. I needed to see the irreducible components of C[x,y,z]/((x+y)(xz2),xy+y2).

Preview: (hide)
link

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 8 years ago

Seen: 3,234 times

Last updated: May 17 '16