2014-10-16 62 views
0

你好,我是很新的蟒蛇,我試圖解決一個方程組有未知的變數解方程,方程是在下面Sympy問題與規定條件

from __future__ import division 
import sympy as sy 
import math 
#Global Variables indepenedant of calculations 
Tc = 9.25 
Ic = 340*10-6 
Tb = 6.2 
I = 2 *Ic 
alpha = 2*10**-2 
thickness = 100*10**-10 
L0 = 2.44*10**-8 
electrical_resist = 0.5*10**-2 
sigma = 1/electrical_resist 
k = sigma*L0*Tc 
A = 1 
B = 1 
#set of problems to solve 
r0 = sy.symbols('r0') 
LHS=(I/(alpha*thickness))**2 * electrical_resist 
RHS = -k*((r0**2)*((A*math.e**Tc)+(B*math.e**0)))+(alpha/thickness) * (r0**2) * (Tc - Tb) 
print sy.nsolve(LHS==RHS, 0.002) 

的代碼,但我不斷收到錯誤

2444   if isinstance(f, Equality): 
    2445    f = f.lhs - f.rhs 
-> 2446   f = f.evalf() 
    2447   syms = f.free_symbols 
    2448   if fargs is None: 

AttributeError: 'bool' object has no attribute 'evalf' 

任何幫助,非常感謝。

回答