python 3.x - Sympy Subs Unexpected Behaviour -


sympy .subs driving me crazy. here have.

import sympy sympy import init_session sympy.plotting import plot import mpmath init_session()  i_d, i_0, v_d, v_t, v_d = symbols('i_d i_0 v_d v_t v_d')  eq1 = eq(i_d, i_0 *(exp(v_d/v_t)-1))  eq3 =eq(100, eq1.rhs.subs([(i_0,8 * 10**(-14)), (v_t,0.026 )])) 

equation 3

now first problem reason .subs won't swap out values in eq1 newly defined values. whenever call eq3, variables , none of constants have input.

then, unsurprisingly, nsolve won't work either. know answer 0.569.

nsolve(eq3, v_d, .5, verify = false) 

and here error.

valueerror:  expected one-dimensional , numerical function 

does have advice on how .subs work?


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -