CoCalc Public FilesExos / Exos-21-09-2018.sagews
Author: Juan Carlos Bustamante
Views : 41
Compute Environment: Ubuntu 18.04 (Deprecated)

## Exercice n. 23, section 3.2

On condisère la fonction $f(x) = \frac{2x^2+3xy+4y^2}{3x^2 + 5y^2}$

var('x,y')
cm = colormaps.Blues
def f(x,y) :
return (2*x^2 + 3*x*y+4*y^2)/(3*x^2 + 5*y^2)

def c(x,y):
return f(x,y)
S=plot3d(f,(x,-2,2),(y,-2,2),color = (c,cm), opacity=1, mesh=1)
show(S, aspect_ratio = [1,1,3])
C=contour_plot(f, (x,-2, 2), (y,-2, 2), cmap='Blues',linestyles='solid', colorbar=True)
show(C,figsize=4)

($\displaystyle x$, $\displaystyle y$)
3D rendering not yet implemented
%md
## Exerice n. 42, section 3.2


## Exerice n. 42, section 3.2

var('x,y')
cm = colormaps.Blues
def f(x,y) :
return sin(x^2 + y^2)/(x^2 + y^2)

def c(x,y):
return 0.4+0.8*f(x,y)
S=plot3d(f,(x,-pi, pi), (y,-pi, pi),color = (c,cm), opacity=1, mesh=1)
show(S, aspect_ratio=[1,1,2])
C=contour_plot(f, (x,-3*pi, 3*pi), (y,-3*pi, 3*pi), cmap='Blues',linestyles='solid', colorbar=True)
show(C,figsize=4)

($\displaystyle x$, $\displaystyle y$)
3D rendering not yet implemented