[sympy] Where can I find list of all functions able to parse? (sin, cos, tan, abs, log etc)

2021-06-19 Thread Michał Pawłowski
Hello. Where can I find *list* of all *functions*, which I can use is *sympy* *string*, with *sympify* function? I mean functions like: sin, cos, tan, cot, abs, log, pi, etc. ect. (ALL) like sympify("sin(pi/2)", evaluate=True) Thank you Mike -- You received this message because you are

[sympy] Where sympy processes not-evaluated powers?

2021-06-14 Thread Michał Pawłowski
Hello. I'm trying to modify sympy to avoid of hanging, when numer which is gonna to be computed is tu large. I know how to *raise exception*, but In which file should i look for power computing without eval? In *core/numbers.py* there are mothods for evaluation of numbers. But where should I

[sympy] Re: Where can I find code, that evaluates add and multiplication operations?

2021-06-05 Thread Michał Pawłowski
Hey, thank you. But *flatten* is executed only then, when argument is symbol, like *2 * x * x* (i.e.). But where is code of numbers eval? sobota, 5 czerwca 2021 o 14:01:46 UTC+2 smi...@gmail.com napisał(a): > processing of args, I believe, is handled in Add.flatten and Mul.flatten > > /c > > On

[sympy] Where can I find code, that evaluates add and multiplication operations?

2021-06-05 Thread Michał Pawłowski
Hi. Where can I find code, that evaluates *Add* and *Mul* operations on real numbers? I've found the code in *Pow* file (sympy/core/power.py). I know that there are move files in that dir: (sympy/core/add.py) (sympy/core/mul.py) But I cannot find the line of evaluation. I.E. where is code

Re: [sympy] Limit max value of computed exception

2021-06-04 Thread Michał Pawłowski
Now we need to know, where in *mul.py* and *add.py* is code which evaluates number. We need to block such code as: 10 * 10 ** 1 piątek, 4 czerwca 2021 o 13:54:37 UTC+2 Michał Pawłowski napisał(a): > Ok, I've made one mistake. There it go: > > *if evaluate:* > if

Re: [sympy] Limit max value of computed exception

2021-06-04 Thread Michał Pawłowski
Ok, I've made one mistake. There it go: *if evaluate:* if b.is_number and e.is_number: if e * _log10(b) > 1: raise ValueError('too big value') without _pow. Now it works piątek, 4 czerwca 2021 o 13:44:03 UTC+2 Michał Pawłowski napisał(a): > Oh, dear I s

Re: [sympy] Limit max value of computed exception

2021-06-04 Thread Michał Pawłowski
Oh, dear I see now that is doesnt work everytime, I need to code more :/ piątek, 4 czerwca 2021 o 13:39:58 UTC+2 Michał Pawłowski napisał(a): > Hey, I've fixed it :) > > Just add to *sympy/core/power.py* condition, that checks how many decimal > digits has power expression. I've a

Re: [sympy] Limit max value of computed exception

2021-06-04 Thread Michał Pawłowski
C+2 asme...@gmail.com napisał(a): > This is somewhat of an open problem for SymPy. You can see some of the > ideas around it at https://github.com/sympy/sympy/issues/6835. > > Aaron Meurer > > On Thu, Jun 3, 2021 at 8:46 AM Michał Pawłowski > wrote: > > > >

[sympy] Limit max value of computed exception

2021-06-03 Thread Michał Pawłowski
Hi. I have problem. I'd like to secure of too high computed value to prevent of SymPy Hang. I. E.: latex(expand("2**10**10**10", evaluate=True)) When I execute it by python script it hangs (value is too big). How to prevent of it? Thank You! -- You received this message because you are

[sympy] Limit max value of computed expression

2021-06-03 Thread Michał Pawłowski
Hi. I have problem. I'd like to secure of too high computed value to prevent of SymPy Hang. I. E.: latex(expand("2**10*10**10", evaluate=True)) When I execute it by python script it hangs (value is too big). How to prevent of it? Thank You! -- You received this message because you are

Re: [sympy] Is it possible to get polynomial multiplyiers?

2021-02-22 Thread Michał Pawłowski
Thank you all of you. Thank you so much. Michał Pawłowski wtorek, 23 lutego 2021 o 00:24:08 UTC+1 javier.a...@gmail.com napisał(a): > Hi! > > I knew my code was bad, but not so bad. Hahaha! I just wish I could remove > my message from the archive... > > Sorry for the noise.

Re: [sympy] Is it possible to get polynomial multiplyiers?

2021-02-22 Thread Michał Pawłowski
gt; El 22 feb 2021, a las 12:44, Michał Pawłowski > escribió: > > Hi. > > > I'd like to get polynomial qualifiers returned as array, in example: > > getQualifiers("4*x**2+8*x+4") > [4, 8, 4] > > or > > getQualifiers("4*x**2+4") > [4

[sympy] Is it possible to get polynomial multiplyiers?

2021-02-22 Thread Michał Pawłowski
Hi. I'd like to get polynomial qualifiers returned as array, in example: getQualifiers("4*x**2+8*x+4") [4, 8, 4] or getQualifiers("4*x**2+4") [4, 0, 4] Is it possible? Thanks Mike -- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe

[sympy] HowTo Get LaTeX code of original formula (without expand/simplify)?

2021-02-11 Thread Michał Pawłowski
Hi. I'd like to get LaTeX code of formula, but without simplification or expanding. I.E: formula_1 = '2+x+x**2' print(latex(expand(formula_1))) <- this works but it sorts the formula print(latex(???)) -> 2+x+x^{2} #HOW TO GET THIS? Thanks Mike. -- You received this message because you are

[sympy] Re: Exceptions? Is it possible to catch SyntaxError event?

2021-02-11 Thread Michał Pawłowski
Ok, I've found the solution! I need to put the formula *inside* of *quotes*. And then pass it through *simplify* or *expand* functions. The error will have such code: *OtherError: * Thanks Mike czwartek, 11 lutego 2021 o 11:25:06 UTC+1 Michał Pawłowski napisał(a): > Hi. > >

[sympy] Exceptions? Is it possible to catch SyntaxError event?

2021-02-11 Thread Michał Pawłowski
Hi. I'd like to manage situation, when the formula, which I'd like to process has syntax error. I tryied to use *try except* blocks, but its doesn't work, how can I achieve it? #!/usr/bin/python3 from sympy import * x = Symbol('x') try: val_1 = x*sin(x)**2+x*cos(x)**2* except

Re: [sympy] Execute .py file -> not recognizing Symbol, when file isn't inside of sympy dir

2021-02-10 Thread Michał Pawłowski
Thank you so much, it works great now! :) I haven't installed it. I have newest version I used to used git pull .. Thank U Mike środa, 10 lutego 2021 o 22:14:07 UTC+1 Oscar napisał(a): > Do you particularly want to use the master version of sympy from git? > > It's usually better to use the

Re: [sympy] Execute .py file -> not recognizing Symbol, when file isn't inside of sympy dir

2021-02-10 Thread Michał Pawłowski
Thanks. I used git clone ... thats all środa, 10 lutego 2021 o 21:53:02 UTC+1 Oscar napisał(a): > On Wed, 10 Feb 2021 at 20:47, Michał Pawłowski > wrote: > > > > Hi. > > > > I have such problem. > > > > I've created py file: > > > >

Re: [sympy] Execute .py file -> not recognizing Symbol, when file isn't inside of sympy dir

2021-02-10 Thread Michał Pawłowski
Thank you for quick reply. I'm not sure. I've input git clone ... Thats all. śr., 10.02.2021, 21:53 użytkownik Oscar Benjamin napisał: > On Wed, 10 Feb 2021 at 20:47, Michał Pawłowski > wrote: > > > > Hi. > > > > I have such problem. > > > > I've c

[sympy] Execute .py file -> not recognizing Symbol, when file isn't inside of sympy dir

2021-02-10 Thread Michał Pawłowski
Hi. I have such problem. I've created py file: #!/usr/bin/python3 from sympy import * x = Symbol('x') print(expand(sin(x)*(x-1)*(x+1))) When it is inside of SymPy lib dir, it returns correct result in console. But, when I put it not inside the lib dir, it tells me, that: NameError: name

[sympy] Re: Simplify, how return code instead of TeX?

2021-02-10 Thread Michał Pawłowski
Thank you very much! :) środa, 10 lutego 2021 o 20:22:09 UTC+1 gu...@uwosh.edu napisał(a): > `print(expand((x**2+1)*(x-1)))` > > On Wednesday, February 10, 2021 at 1:20:38 PM UTC-6 > michal.bozyd...@gmail.com wrote: > >> Thank you. It works in this example. But if I'd like to do this: >> >>

[sympy] Re: Simplify, how return code instead of TeX?

2021-02-10 Thread Michał Pawłowski
Thank you. It works in this example. But if I'd like to do this: print((x**2+1)*(x-1)) It prints me string without compute it. I'd like to have : x**3-x**2+x-1 Is it possible? Thanks Mike środa, 10 lutego 2021 o 19:59:55 UTC+1 gu...@uwosh.edu napisał(a): > wrap your expression in a

[sympy] Simplify, how return code instead of TeX?

2021-02-10 Thread Michał Pawłowski
Hi. I'd like to generate code of simplified formula. I.E: When I pass: 1+x+x**2+x**3 I'd like to have: x**3+x**2+x+1 Is it possible to achieve it? Thanks Mike -- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe from this group and stop