Advertisement
UF6

Problem 5 Final

UF6
May 8th, 2016
252
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.49 KB | None | 0 0
  1. import numpy as np
  2. from mpl_toolkits.mplot3d import Axes3D
  3. import matplotlib.pyplot as plt
  4. import random
  5. e = 2.718281828459
  6. def fun(x, y):
  7.   return ((x**2+ 3*y**2)*e**-x-y)
  8.  
  9. fig = plt.figure()
  10. ax = fig.add_subplot(111, projection='3d')
  11. x = np.arange(-1, 2, 50)
  12. y= np.arange(-2, 1, 50)
  13. X, Y = np.meshgrid(x, y)
  14.  
  15.  
  16. ax.plot_surface(X, Y)
  17.  
  18. ax.set_xlabel('X Label')
  19. ax.set_ylabel('Y Label')
  20.  
  21.  
  22. #I'm having a hard time getting f(x,y) right, and I don't have the time to go over this as I want.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement