Ask Your Question

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

asked 2016-05-16 11:03:59 -0500

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 )(X − Z^3)=0,$$

$$XY + Y^2=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

edit retag flag offensive close merge delete

3 answers

Sort by » oldest newest most voted

answered 2016-05-17 08:12:03 -0500

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.

edit flag offensive delete link more

answered 2016-05-17 04:58:33 -0500

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 $\mathbb R^3$ 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 $\mathbb R^3$, 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]]
edit flag offensive delete link more


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 ( 2016-05-17 06:08:53 -0500 )edit

answered 2016-05-17 10:32:27 -0500

Minkowski gravatar image

Perfect! Thanks both of you. It can be seen perfecty. I needed to see the irreducible components of $\mathbb{C}[x,y,z]/((x+y)(x-z^2),xy+y^2)$.

edit flag offensive delete link more

Your Answer

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

Add Answer

Question Tools


Asked: 2016-05-16 11:03:59 -0500

Seen: 372 times

Last updated: May 17 '16