Subversion Repositories pentevo

Rev

Rev 1248 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. from sympy import *
  2. import math
  3.  
  4.  
  5. r1,r2,r3,r4,c1,c2,c3 = symbols('r1,r2,r3,r4,c1,c2,c3')
  6.  
  7. A,B,C,D,EE,F,G,H,K,L,M = symbols('A,B,C,D,EE,F,G,H,K,L,M')
  8.  
  9. eq1 = Eq( c1*EE+r4*F, D )
  10. eq2 = Eq( c1*H + c1*r4*K + c2*r4*L, G )
  11. eq3 = Eq( c1*c2*r4, M )
  12.  
  13. s=solve( [eq1,eq2,eq3], [r4,c1,c2], dict=True, manual=True, simplify=False )
  14.  
  15. print(s)
  16. print('')
  17.  
  18. print('num solutions: {}'.format(len(s)))
  19. print('')
  20.  
  21. for ss in s:
  22.     print('\n===')
  23.     print('r4={}\n'.format(ss[r4]))
  24.     print('c1={}\n'.format(ss[c1]))
  25.     print('c2={}\n'.format(ss[c2]))
  26.  
  27.  
  28.  
  29.