The function $f(x,y)=\tanh(R-\sqrt{x^2+y^2})$ for a given $R>0$ draws a circle with radius R with maximum and minimum of +1 and -1. This I can see when I plot
f[x_, y_] := Tanh[5 - Sqrt[x^2 + y^2]];
ContourPlot[f[x, y], {x, -10, 10}, {y, -10, 10}]
If I want to do the same, but draw an ellipsoid with major and minor axis a and b, then how would I go about doing that?
You can change the definition of your function $f$ to
$\quad \quad f(x,y)=\tanh(\sqrt{(a\, b)^2}-\sqrt{(b\, x)^2 + (a\, y)^2}\,)$
To visualize the resulting elliptical contours of $f$ in Mathematica, you can use the following code: