def transmutagen_cram_error(degree, t0, prec=200):
from ..partialfrac import (thetas_alphas, thetas_alphas_to_expr_complex,
customre, t)
from ..cram import get_CRAM_from_cache
from sympy import re, exp, nsolve, diff
expr = get_CRAM_from_cache(degree, prec)
thetas, alphas, alpha0 = thetas_alphas(expr, prec)
part_frac = thetas_alphas_to_expr_complex(thetas, alphas, alpha0)
part_frac = part_frac.replace(customre, re)
E = part_frac - exp(-t)
E = E.evalf(20)
return E.subs(t, nsolve(diff(E, t), t0, prec=prec))
评论列表
文章目录