title: How to 3D plot function of 2 variables in python?
body: <p>I am trying to 3D plot the magnification factor in vibrations for multiple types of damping. To simplify it for those who have no idea what it is, basically, you have 3 variables:</p>
  
  <ul>
  <li>beta, which varies between 0 and infinite, but I would like to visualize it from 0 to 3, in 0.2 intervals.</li>
  <li>damping ratio, d, which varies between 0 and infinite, but I would like to plot it from 0 to 1, in 0.1 intervals.</li>
  <li>finally, nu, which is a function that varies according to the two variables before.</li>
  </ul>
  
  <p><a href="https://i.stack.imgur.com/7r3Hl.jpg?s=256" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7r3Hl.jpg?s=256" alt="2D function, y is nu, x is beta"></a></p>
  
  <p>My intuition says that I should plot this with (X,Y,Z) = (beta, d, nu), but I am just starting to use this library and I am kind of new to python, I just use it when I need to visualize or calculate problems in class. I tried creating 2 arrays for beta and d, but I don't know I should create the array for nu, since it depends on both.</p>
  
  <p>This is the piece of code I have until now:</p>
  
  <pre><code>    import math
  import matplotlib.pyplot as plt
  import numpy as np
  from mpl_toolkits.mplot3d import Axes3D
  
  
  nu = []
  b = [0.1 + i / 100 for i in range(0, 510)]
  damp = [0.1 + i/10 for i in range(0,510)]
  
  for d in damp:
      nu_new = []
      nu.append(nu_new)
      for beta in b:
          nu_new.append( math.sqrt(1+(2*d*beta)**2)/ math.sqrt((1-beta**2)**2+(2*d*beta)**2))
  
  fig = plt.figure()
  ax = Axes3D(fig)
  ax.plot(b, d, nu)
  plt.show()
  </code></pre>
  
  <p>I am kind of stuck trying to plot this, so if you have any suggestion I would be glad.</p>