Advertisement
Pouknouki

Scripts Python Random

Mar 2nd, 2017
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.67 KB | None | 0 0
  1. # -*- coding: utf-8 -*-
  2. """
  3. Created on Sun Nov 20 13:33:56 2016
  4.  
  5. @author: thoma
  6. """
  7.  
  8. R = 1 * 10 ** 6
  9. C = 10 * 10 ** -9
  10. L = 0.1
  11.  
  12. import numpy as np
  13.  
  14. w0 = 1/np.sqrt(L * C)
  15. Q = R * np.sqrt(C / L)
  16.  
  17. print(-1 * w0 / 2 / Q + (w0 + w0 / 4 / (Q*Q)))
  18. print(w0 / 2 / Q + (w0 + w0 / 4 / (Q*Q)))
  19. print(w0)
  20. print(31672*7.3/31622)
  21. # 7,3 -> 31622
  22. # x   -> 31672
  23.  
  24. listemodules=["E","F","Q","C","M"]
  25. listescore=["+","=","-"]
  26. def f(liste):
  27.     compte=0
  28.     if len(liste)==0:
  29.         for i,lettre in enumerate(listemodules):
  30.             for j,signe in enumerate(listescore):
  31.                 resultat=listemodules[i] + listescore[j]
  32.                 liste.append(resultat)
  33.     elif ((len(liste)!=0) and (compte<=len(listemodules))):
  34.         for zz,el in enumerate(liste):
  35.             for i,lettre in enumerate(listemodules):
  36.                 for j,signe in enumerate(listescore):
  37.                     resultat=liste[zz] + listemodules[i] + listescore[j]
  38.                     liste.append(resultat)
  39.     compte+=1
  40.     return f(liste)
  41.  
  42. print(f([1,2,3,4,5]))
  43.  
  44.  
  45.  
  46.  
  47.  
  48. largeur, hauteur = 4, 3
  49. matrice = [[0 for j in range(hauteur)] for i in range(largeur)]
  50. print(matrice)
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58. # -*- coding: utf-8 -*-
  59. """
  60. Created on Sun Nov 20 14:49:28 2016
  61.  
  62. @author: thoma
  63. """
  64.  
  65. import sys
  66. sys.setrecursionlimit(1000000)
  67.  
  68. import numpy as np
  69.  
  70. def u(n):
  71.     return np.sqrt(2) * np.log(n) / n ** (3/2)
  72.    
  73. def S(n):
  74.     if n > 2:
  75.         retour = S(n - 1)
  76.         retour.append(retour[len(retour) - 1] + u(n))
  77.         return retour
  78.     else:
  79.         return [u(2)]
  80.    
  81. import matplotlib.pyplot as plt
  82.  
  83. maxi = 2500
  84.  
  85. x = [n for n in range(2, maxi + 1)]
  86. y = S(maxi)
  87. y2 = [np.log(n) for n in x]
  88. y3 = [y2[i] / y[i] for i in range(len(x))]
  89. plt.plot(x, y)
  90. plt.plot(x, y2)
  91. plt.plot(x, y3)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement