Contour plots?

pegasusroe shared this question 8 years ago
Answered

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?

/blob

What if we want to change the definition of f later on?

How do we do that?


Regards,

Pegasus Roe

Comments (14)

photo
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)


https://ggbm.at/549647


I hope that can be useful.

photo
1

Hi

Quickely like that but must be finished later7354aa88d94871b9dc1da60255b217ff


https://ggbm.at/549649


Daniel

photo
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

http://www.geogebra.org/for...


saludos

photo
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

photo
1

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

photo
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...

photo
1

hello

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


saludos

photo
1

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

Hi, kondr


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


P.S. I tried to link to your demo file:

http://www.geogebratube.org...


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)" :?

6fcfcbd01451ede13e2344dfba61a636

Regards,

Pegasus Roe

photo
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

photo
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/5499394cb3d7a809df2f1802165fe0baceebea

photo
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.

photo
1

Hi, just to play with javascript

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

Michel

https://ggbm.at/549941

photo
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]

photo
1

Thanks, works !!!

© 2019 International GeoGebra Institute