40 from matplotlib
import cm
41 import matplotlib.pyplot
as plt
42 from mpl_toolkits.mplot3d
import Axes3D
46 return 1 + np.sin(x) * np.sin(y)
48 def potentialSurface():
49 X = np.arange(-8, 8, 0.25)
50 Y = np.arange(-8, 8, 0.25)
51 X, Y = np.meshgrid(X, Y)
56 ax = fig.gca(projection=
'3d', aspect=
'equal')
57 X, Y, Z = potentialSurface()
58 ax.plot_surface(X, Y, Z, rstride=1, cstride=1, cmap=cm.coolwarm, linewidth=0)
60 x = np.loadtxt(
"vfrrt-conservative.path")
61 ax.plot(x[:, 0], x[:, 1], potential(x[:, 0], x[:, 1]), color=
'b')
63 x = np.loadtxt(
"trrt-conservative.path")
64 ax.plot(x[:, 0], x[:, 1], potential(x[:, 0], x[:, 1]), color=
'r')
66 x = np.loadtxt(
"rrtstar-conservative.path")
67 ax.plot(x[:, 0], x[:, 1], potential(x[:, 0], x[:, 1]), color=
'g')