gringotopies

BOIKWD 3B

Oct 23rd, 2019
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.00 KB | None | 0 0
  1. import numpy as np
  2. import math
  3. import cmath
  4.  
  5.  
  6. A = np.array([
  7.     [1, 2/3, 2, 5/2, 5/3, 5],
  8.     [3/2, 1, 3, 10/3, 3, 9],
  9.     [1/2, 1/3, 1, 4/3, 7/8, 5/2],
  10.     [2/5, 3/10, 3/4, 1, 5/6, 12/5],
  11.     [3/5, 1/3, 8/7, 6/5, 1, 3],
  12.     [1/5, 1/9, 2/5, 5/12, 1/3, 1]
  13. ])
  14.  
  15. Aw = np.array([[3], [1]])
  16.  
  17. nA = 6
  18.  
  19. B = np.array([[1, 0.4, 3, 7/3, 0.5, 1],
  20.     [2.5, 1, 4/7, 5/8, 1/3, 3],
  21.     [1/3, 1.75, 1, 0.5, 2, 0.5],
  22.     [3/7, 1.6, 2, 1, 4, 2],
  23.     [2, 3, 0.5, 0.25, 1, 0.5],
  24.     [1, 1/3, 2, 0.5, 2, 1]])
  25.  
  26. Bw = np.array([[2], [1/2], [1]])
  27.  
  28. nB = 6
  29.  
  30. C = np.array([
  31.     [1, 4.25, 0.85, 1.6, 23/6, 8/3],
  32.     [4/17, 1, 0.2, 0.4, 0.9, 2/3],
  33.     [20/17, 5, 1, 2.1, 5.1, 10/3],
  34.     [5/8, 2.5, 10/21, 1, 2.5, 11/6],
  35.     [6/23, 10/9, 10/51, 0.4, 1, 19/30],
  36.     [3/8, 1.5, 0.3, 6/11, 30/19, 1]])
  37.  
  38. Cw = np.array([[2], [5]])
  39.  
  40. nC = 6
  41.  
  42. P=np.zeros((nC-2,nC-2))
  43. for i in range(nC-2):
  44.     for j in range (nC-2):
  45.         if(i!=j):
  46.             P[i][j]=-1
  47.         else:
  48.             P[i][j]=nC-1
  49. print(P)
Add Comment
Please, Sign In to add comment