Sunday, June 3, 2012

(06xx2012) Meniscus Simulation Attempt



This is a programming attempt to deal with the visual simulation of a meniscus using python xy

Below is the coding:





from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
import numpy as np

fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
"""
u = np.linspace(0, 2 * np.pi, 100)
v = np.linspace(0, np.pi, 100)
"""


x = arange(1,2,0.5)
y=2
z=3

ax.plot_surface(x, y, z,  rstride=10, cstride=10, color='b')

plt.show()


"""
x = 0 to r

y = 0 to r

z = sqrt x^2 + Y ^2



x = 10 * np.outer(np.cos(u), np.sin(v))
y = 10 * np.outer(np.sin(u), np.sin(v))
z = 10 * np.outer(np.ones(np.size(u)), np.cos(v))

"""


No comments:

Post a Comment