Thanks, could you also run
from sympy.solvers import solve
from sympy import Symbol,exp,Eq
IS=7.443e-14; BF=1343.59; BR=62.79; VT=26.03e-3
IB=Symbol("IB")
VBE=Symbol("VTB")
E=100
RT=5
solve([Eq(IB, IS*(exp(VBE)/BF - 1/BF - 1/BR)), Eq(IB, (E - VBE*VT)/RT)],
[IB, VBE])
and
from sympy.solvers import solve
from sympy import Symbol,exp,Eq
IS=7.443e-14; BF=1343.59; BR=62.79; VT=26.03e-3
IB=Symbol("IB")
VBE=Symbol("VTB")
E=100
RT=5
solve([Eq(IB, IS*(exp(VBE/VT)/BF - 1/BF - 1/BR)), Eq(IB, (E - VBE)/RT)],
[IB, VBE])
? The last one no only takes a lot of time, but is also eating lots of RAM,
maybe it's something related to my computer or something that was already
patched in master branch (I'm using the latest version on pip3).
As for profiling, I don't know much about it, I tried cProfile.run and the
first finished with 966802 function calls (907997 primitive calls) in 2.835
seconds
The second one, I stop before finish (increasly eating RAM) with 318160249
function calls (318145924 primitive calls) in 112.793 seconds, what got my
attention was
8 82.562 10.320 112.439 14.055
densebasic.py:920(dup_from_dict)
10/6 0.000 0.000 112.439 18.740
densebasic.py:978(dmp_from_dict)
On Friday, October 21, 2016 at 5:06:55 PM UTC-2, Aaron Meurer wrote:
>
> The difference is only a few hundred milliseconds for me on SymPy
> master (it's a 4x difference, but time that small could end up
> corresponding to something trivial). You'd need to profile the
> functions to see the difference. LIkely one is taking a slightly
> different code path than the other.
>
> Aaron Meurer
>
> On Fri, Oct 21, 2016 at 1:02 PM, Marco Inacio <[email protected]
> <javascript:>> wrote:
> > Hi, out of curiosity I wanted to know why does this:
> >
> > from sympy.solvers import solve
> > from sympy import Symbol,exp
> > x=Symbol("x")
> > solve(x*10e-4+exp(x),x)
> >
> >
> > runs much faster than this:
> >
> > from sympy.solvers import solve
> > from sympy import Symbol,exp
> > x=Symbol("x")
> > solve(x+exp(x/10e-4),x)
> >
> >
> > (?) Thanks!
> >
> > --
> > You received this message because you are subscribed to the Google
> Groups
> > "sympy" group.
> > To unsubscribe from this group and stop receiving emails from it, send
> an
> > email to [email protected] <javascript:>.
> > To post to this group, send email to [email protected]
> <javascript:>.
> > Visit this group at https://groups.google.com/group/sympy.
> > To view this discussion on the web visit
> >
> https://groups.google.com/d/msgid/sympy/e9c9c294-066b-4149-8ae9-82c7b48ed3ac%40googlegroups.com.
>
>
> > For more options, visit https://groups.google.com/d/optout.
>
--
You received this message because you are subscribed to the Google Groups
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sympy.
To view this discussion on the web visit
https://groups.google.com/d/msgid/sympy/7e79ae29-85fb-4c0c-b850-d7c69c4290a3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.