Question: 3Dplotting and contour plotting of a function f(x,y) over the domain of quarter ellipse in maple 2015

Hello everyone,
I hope this message finds you well. I am trying to plot a function f(x, y) and overlay its contour on a quarter ellipse using Maple 2015. However, I’ve encountered some difficulties and have not been successful so far. I would greatly appreciate any assistance in resolving this issue. Thank you!

Plotting in 2D

restart:with(plots):  aa := 4: bb := 2:  
f := -((x^(2))/(aa^(2))+(y^(2))/(bb^(2))-1)*((aa^(2)*bb^(2))/(aa^(2)+bb^(2))):  
plot3d(f,x = 0 .. aa/(2),y = 0 .. bb/(2),region = (x, y) -> ((2 x)/(aa))^(2) + ((2 y)/(bb))^(2)<= 1,axes = boxed,style = patchcontour, grid = [50, 50],orientation = [-120, 45],shading = zhue,title = "f(x,y) over quarter ellipse domain");

Contour plotting
xrange := 0 .. aa/(2): yrange := 0 .. bb/(2):  
nx := 100:   ny := 100:  
dx := (rhs(xrange) - lhs(xrange))/(nx-1):dy := (rhs(yrange) - lhs(yrange))/(ny-1):  
Z := Matrix(nx, ny, (i, j) -> local x, y, inside;x := lhs(xrange) + (i-1)*dx;y := lhs(yrange) + (j-1)*dy;inside := (((2 x)/aa)^2 + ((2 y)/bb)^2 <= 1);if inside then f(x, y) else NULL end if):  
contourplot(Z, xrange, yrange,contours = 15, filled = true, coloring = [blue, green, yellow, red], axes = boxed, title = "Contour plot over quarter ellipse", grid = [nx, ny]);  

Please Wait...