The Python Code
Directions:
Modify the Python code “my_contour_3d_demo3.py” to reproduce images similar to the figures shown on the right.
For each question, please submit both
a) the figure produced by the python code and
b) the altered code.
Note: It is important that you only include the code that you alter! Otherwise your submission will be much too large and will not be graded. I have included the answer to the first question to show you what I am expecting.
1.) z=(cos x cos y) e-(√(x^2+y^2))/4
a)
b)
Lines 10-14
Set XY Plotting Grid
a1=-6.1;b1=6.1;
a2=-6.1;b2=6.1;
n=501;
Lines 24-29
Define function to be plotted f(x,y)
def r(x,y):
return np.sqrt(x2+y2)
def f(x,y):
return (np.cos(x)np.cos(y))np.exp(-r(x,y)/4)
2.) z=(xy2)/(x2+y2)
3.) z=1/(4×2+y2)
4.) z=e(-y ) cos x
5.) z=(xy(x2-y2))/(x2+y2)
6.) z=y2-y4-x2
7.) z=1+cos(x2+y2)
8.) z=-4/(1+x2+2y2)
9.) z=-x/√(x2+y2)
10.) z=x4/(x4+y2)
11.) z=(2x2y)/(x4+y2)
12.) z=(2xy)/(x^2+y^2)

Leave a Reply
You must be logged in to post a comment.