# Contour plots?

pegasusroe shared this question 9 years ago

Is it possible that we can define a function, say f(x,y)=x^3+y^3, and then draw its contour plot f(x,y)=k, say k from 1 to 5? What if we want to change the definition of f later on?

How do we do that?

Regards,

Pegasus Roe 2

Hi,

if you just want to draw, maybe you can use slider for k, and TraceOn command on function.

Something like this (you need to turn on animation)

I hope that can be useful. 1

Hi

Quickely like that but must be finished later Daniel 1

hello

x^3+y^3=k is possible with implicitcurve because it is a polynomial expression, but another like x^2+ exp(-x) it is more hard

contour plots are implicit functions really

i could try with this methods

saludos 1

Hi,

Thanks for your replies, but maybe I didn't make my point clear enough,

I'm sorry about that, let me try again. :)

The situation is this: now I have a function, say f(x,y)=x^3+sin(y) (or anything else), and a slider k,

and a textfield linked to function f.

I want to draw the curve f(x,y) = k, and then I will drag the slider k to observe its movement,

and then I still want to change the definition of function f through that textfield assigned to it,

and observe the curve's movement again.

How can I achieve that?

Regards,

Pegasus Roe 1

This feature (f(x, y) = k) would be very handy in mutivariable calculus! 1

Hi, I think this is possible to add for polynomials, but I'm afraid once sin() or sqrt() are involved you'll have to use the SolveOde command. E.g. for function sin(x)+sin(y) create a point A and type

SolveODE[cos(x),-cos(y),x(A),y(A),2,0.1]

http://tube.geogebra.org/ma... 1

hello

for more difficult contours you can use the "ghost" method of rafael losada

saludos 1

I think this is possible to add for polynomials ...

Hi, kondr

Can you show me how to do that for polynomials? Thanks.

but nothing showed up, except for the point A and an error message showing that

something's wrong with the operation "-1*e(x,y)" :? Regards,

Pegasus Roe 1

Hi Pegasus Roe,

what I meant was that we can add this feature into 4.0 for polynomials (now there is even a ticket http://www.geogebra.org/tra...), but with more complicated functions one will have to find workarounds. My demo (which now works, sorry for the bug with -1*e(x,y)) shows that it's not hard to algorithmically draw contours for a "nice" non-polynomial function that go through given point. Unfortunatelly it's harder to draw contours with given z-value. But maybe in 5.0 or 6.0 ...

Cheers,

Zbynek 1

Hello,

I use an implicit features that are in GG today. I want to propose to this problem a method based on Taylor series.

In the example pegasusroe:

f(x,y)=x^3+sin(y) -->y^3+sin(x)=k

sin(x)= 0.09983 + 0.995 (x - 0.1) - 0.09983(x - 0.1)² / 2! - 0.995(x - 0.1)³ / 3! + 0.09983(x - 0.1)⁴ / 4! + 0.995(x - 0.1)⁵ / 5! - 0.09983(x - 0.1)⁶ / 6! - 0.995(x - 0.1)⁷ / 7! With grad 7!!!

Unfortunately, in an implicit function (yet?) you cannot insert the Taylor series, it should be done by hand. The graph shows that in the interval (-3.3) approximation of the sinus with Taylor is good. For another intervals is necessary to changed slider a.

As you can see the implicit curve b: & the exact solution p (x) on the interval (-3.3) is very well suited.

P.s. I had been asked, or is or may be in an implicit function opportunity to record the explicit function. E.g b: x ^ 2 + f (x, y) * y = 5, where f (x, y) = x + y.

This wil l be very useful!

Roman Chijner

https://ggbm.at/549939  1

If you have f(x,y)=x^3+y^3, you can try f(x,y)>1, f(x,y)>2, etc. (syntax f>3 is automatically rewritten as f(x,y)>3). Extending this from inequalities to equations is planned.

For single variable functions you can try e.g. TaylorPolynomial[sin(x),0,7]>0.5. 1

Hi, just to play with javascript

I'd hope that axes don't desapear but how ?

Michel

https://ggbm.at/549941 1

P.s. I had been asked, or is or may be in an implicit function opportunity to record the explicit function. E.g b: x^2 + f(x, y) * y = 5, where f(x, y) = x + y.

This will work in the next release (together with ImplicitCurve[<f(x,y)>] )

[polynomials only] 1

Thanks, works !!!