Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Suppose I want to plot a surface defined by equations involving redundant variables. Consider, for example, plotting the surface defined by the equations: $$ \left\{ \begin{array}{l} \cos x + \sin y = z^2+\cos w \\ \sin w=0 \end{array} \right.$$ for $-2 \pi \leq x \leq +2\pi$, $-2 \pi \leq x \leq +2\pi$, $-2 \leq z \leq +2$.

I have used the following code for this:

eqs = Flatten[ Quiet @ Eliminate[{Cos[x] + Sin[y] == z^2 + Cos[w], Sin[w] == 0}, 
                                 {w}]];
ContourPlot3D[ Evaluate[eqs], {x, -2 π, 2 π}, {y, -2 π, 2 π}, {z, -2, 2}]

It works quite well for simple examples like this, but it is not a good alternative for similar problems involving more complex equations (or more redundant variables).
Is there a more efficient algorithm for plotting surfaces defined this way?

share|improve this question
    
I guess your question in this form cannot be reasonably answered since there is no restriction on possible systems of equations. A constructive question would involve a system where your approach fails. Look e.g. at this answer Efficient code for solve this equation where I demonstrated that Solve with the third argument eliminating variables is more clever than Eliminate. –  Artes May 7 at 17:14
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.