summaryrefslogtreecommitdiffstats
path: root/plot.py
diff options
context:
space:
mode:
authorThibaut Horel <thibaut.horel@gmail.com>2013-07-09 18:54:44 +0200
committerThibaut Horel <thibaut.horel@gmail.com>2013-07-09 18:54:44 +0200
commit965b5c2121de6b37e236bd57481c90c39fc47fb3 (patch)
treea3fe0e64d03034749a31f7ec3e82dc0049918ed6 /plot.py
parent27f1304c8379dc23515cc6e8862b6153aad23375 (diff)
downloadrecommendation-965b5c2121de6b37e236bd57481c90c39fc47fb3.tar.gz
Add notes on non-homotropic (and python code)
Diffstat (limited to 'plot.py')
-rw-r--r--plot.py36
1 files changed, 7 insertions, 29 deletions
diff --git a/plot.py b/plot.py
index 611583c..9843bc1 100644
--- a/plot.py
+++ b/plot.py
@@ -1,32 +1,10 @@
-from mpl_toolkits.mplot3d import Axes3D
-import matplotlib.pyplot as plt
import numpy as np
+import matplotlib.pyplot as plt
+from math import e
-fig = plt.figure()
-#ax = Axes3D(fig)
-
-#X = np.arange(-20, 20, 0.5)
-#xlen = len(X)
-#Y = np.arange(-20, 20, 0.5)
-#ylen = len(Y)
-#X, Y = np.meshgrid(X, Y)
-
-#fig = plt.figure()
-#for i in [-0.3]:
-# j = i*i
-# Z = 2*X*Y*i*(4-j) + (X*X+Y*Y)*j*(6-2*j)
-# surf = ax.plot_surface(X, Y, Z, rstride=1, cstride=1,
-# linewidth=0, antialiased=True)
-
-#ax = fig.add_subplot(1,1,1)
-#x = np.arange(-1,5,0.1)
-#y = (((4*x -24)*x +36)*x-16)*x
-#z = 0*x
-#ax.plot(x,y,x,z,antialiased=True)
-
-ax = fig.add_subplot(1,1,1)
-x = np.arange(0,1,0.01)
-y = np.sqrt((x-1)*(x+2)/((x+1)*(x-2)))
-ax.plot(x,y)
-
+t = np.arange(0.001, 1, 0.001)
+u = np.sqrt((4*e**2 + 4*e +1)*t**2+ (24*e**2-4*e+4)*t+ 36*e**2-24*e+4)/(2*(e-1)*t)-(3*e-1)/((e-1)*t)
+print u[0]
+print t[0]
+plt.plot(t,u)
plt.show()