equations = [
Eq(N_bRd, X_c * f_y * A * gamma_M1),
Eq(L_c, L * beta),
Eq(N_cr, (pi) ** 2 * E_E * i / (beta * L) ** 2),
Eq(lamda, sqrt(N_bRd / N_cr)),
]
results = solve(equations)
# results = solve(equations, [m_A,m_D,theta_c,theta_b,delta])
results
我在同情时遇到以下错误 NotAlgebraic:
pi似乎不是代数元素
当我将pi改为3.14时,它的工作正常。
答案 0 :(得分:2)
公共mathematical constants在mpmath
模块中定义(sympy
依赖项):
>>> from mpmath import mp
>>> mp.pi
<pi: 3.14159~>
>>> mp.pi**2
mpf('9.869604401089358')
来自sympy
docs:
这些常量实现为可以评估任何精度的惰性对象。只要对象在算术运算中用作函数参数或操作数,它们就会自动计算当前的工作精度。