Skip to content

Instantly share code, notes, and snippets.

@rahul8590
Created December 4, 2013 09:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rahul8590/7784727 to your computer and use it in GitHub Desktop.
Save rahul8590/7784727 to your computer and use it in GitHub Desktop.
Small Snippet used to calculate and plot the data set
xl = {0:0.329,4:0.632,6:0.795,8:0.917,10:0.981}
sum = []
for n in range(1,21):
a1 = xl[4]**n - xl[0]**n
a2 = xl[6]**n - xl[4]**n
a3 = xl[8]**n - xl[6]**n
a4 = xl[10]**n - xl[8]**n
a5 = 1 - xl[10]**n
print "the intermediate values are " ,a1,a2,a3,a4,a5
sum.append(a1*0 + a2*1 + a3*2 + a4*5.5 + a5*11)
print " for range " , n , "sum ==>", sum
x = range(1,21)
plt.plot(x,sum)
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment