Re: [sympy] [SymPy] Is this a bug or a feature?

2021-02-10 Thread gu...@uwosh.edu
I'm swamped with grading and class preparation, but wanted to comment 
briefly on the items below:

On Wednesday, February 10, 2021 at 3:58:21 PM UTC-6 asme...@gmail.com wrote:

> On Wed, Feb 10, 2021 at 1:44 PM Oscar Benjamin  
> wrote:
>
> Yes, DivideSides would make sense for unevaluated division of inequalities 
>> etc.
>>
>> That is not inconsistent with using + though: We can use eq1+eq2 as a
>> shorthand for the evaluated form of AddSides(eq1, eq2). For equations
>> that would always be able to evaluate. In Mathematica this is all
>> organised around making Boolean expressions that can evaluate after
>> substitution.
>>
>
> We can generalize this to applying any function to equations or 
> inequalities. For equations, it matters where the function either isn't 
> defined (like y=0 for f(x, y) = x/y), or isn't well-defined (for example, 
> square roots are multivalued). For inequalities it matters on what parts of 
> the domain the function is (strictly) monotonic. Except I don't know if 
> SymPy can really answer either of these questions right now. So this might 
> have to remain only a theoretical idea for the time being.
>
> Aaron Meurer
>  
>
>>
>> Oscar
>
> I don't see a problem with returning multivalued/multiple equation 
results. If I understand what you are talking about for expressions where 
you have an equal sign this is working reasonably in the present 
implementation. For example a simplified example of a quantum problem my 
students just did:
[image: Screenshot from 2021-02-10 19-58-41.png]
The right hand size is of type `Piecewise`.
Jonathan

-- 
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 sympy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/a9cd201d-91b2-4bc1-b2fc-4cb0da3801b2n%40googlegroups.com.


Re: [sympy] [SymPy] Is this a bug or a feature?

2021-02-10 Thread Aaron Meurer
On Wed, Feb 10, 2021 at 1:44 PM Oscar Benjamin 
wrote:

> On Wed, 10 Feb 2021 at 20:24, Aaron Meurer  wrote:
> >
> > On Wed, Feb 10, 2021 at 6:47 AM David Bailey  wrote:
> >>
> >> On 10/02/2021 00:53, Oscar Benjamin wrote:
> >>
> >> On Tue, 9 Feb 2021 at 23:58, S.Y. Lee  wrote:
> >>
> >>
> >> And we would also arrive in questions like: If equation brings its own
> algebra system, there should be an equation of equations? How should we
> solve them?
> >>
> >> It's not an "algebra system": it's just a few convenience operations.
> >> It should not be confused with allowing Equation to be used in places
> >> where Expr is expected.
> >>
> >> Might it be an idea to introduce functions such as AddSides,
> SubtractSides, etc that Mathematica has? Not only would these avoid any
> confusion with the normal arithmetic operations,  but I think using these
> functions would clarify what is going on. After all, when people do such
> operations by hand, they don't write (a=b)*k,or whatever, they typically
> write "Multiplying equation 4 by k we get..."
> >
> >
> > Is there a need to have an unevaluated version of AddSides? + already
> works for an evaluated version.
> >
> > It might be worth thinking about inequalities in the design here. We've
> been ignoring them because it's simpler to do equalities first, but
> inequalities have some restrictions that might clarify what design we want.
> For a > b, things like function application or even multiplication aren't
> straightforward. What should x*(a > b) do if x is only known to be real?
> One option is a Piecewise, but then things get hairy if you start doing
> other operations. Maybe a MultiplySides does actually make sense for this.
>
> See also these two links:
> https://github.com/sympy/sympy/pull/20723#issuecomment-763975854
> https://github.com/sympy/sympy/pull/17097


>
> Yes, DivideSides would make sense for unevaluated division of inequalities
> etc.
>
> That is not inconsistent with using + though: We can use eq1+eq2 as a
> shorthand for the evaluated form of AddSides(eq1, eq2). For equations
> that would always be able to evaluate. In Mathematica this is all
> organised around making Boolean expressions that can evaluate after
> substitution.
>

We can generalize this to applying any function to equations or
inequalities. For equations, it matters where the function either isn't
defined (like y=0 for f(x, y) = x/y), or isn't well-defined (for example,
square roots are multivalued). For inequalities it matters on what parts of
the domain the function is (strictly) monotonic. Except I don't know if
SymPy can really answer either of these questions right now. So this might
have to remain only a theoretical idea for the time being.

Aaron Meurer


>
>
> Oscar
>
> --
> 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 sympy+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sympy/CAHVvXxTAAA%3DHDaNA4-HU%2BqFV34nF7GfA7GbHn_HzVWgu0Epr6w%40mail.gmail.com
> .
>

-- 
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 sympy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CAKgW%3D6%2BKckP1oKFc3PhSoMN96FFU%2B_jxybGgD9DPpENdPNEE3A%40mail.gmail.com.


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 latest release (currently 1.7.1) unless 
> you are planning to work on making changes to sympy itself. 
>
> You can install the latest release by running e.g "pip install sympy" 
> (or "conda install sympy" if you are using Anaconda). 
>
> If you do want to install the master version of sympy then you need to 
> run "python setup.py install" (after "git clone"). 
>
> Oscar 
>
> >> > 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 'Symbol' is not defined 
> >> > 
> >> > How can I fix it, to be able to execute this file from anywhere in my 
> directory tree? 
> >> 
> >> That should work fine. Have you actually installed sympy or have you 
> >> just downloaded the code? 
> >> 
> >> By any chance have you created a file somewhere called "sympy.py" 
> >> because that would be picked up by "import sympy". 
> >> 
> >> -- 
> >> Oscar
>

-- 
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 sympy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/b07c94c2-6848-4bcb-8f95-6e33e065e570n%40googlegroups.com.


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

2021-02-10 Thread Oscar Benjamin
Do you particularly want to use the master version of sympy from git?

It's usually better to use the latest release (currently 1.7.1) unless
you are planning to work on making changes to sympy itself.

You can install the latest release by running e.g "pip install sympy"
(or "conda install sympy" if you are using Anaconda).

If you do want to install the master version of sympy then you need to
run "python setup.py install" (after "git clone").

Oscar

On Wed, 10 Feb 2021 at 21:03, Michał Pawłowski
 wrote:
>
> 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:
>> >
>> > #!/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 'Symbol' is not defined
>> >
>> > How can I fix it, to be able to execute this file from anywhere in my 
>> > directory tree?
>>
>> That should work fine. Have you actually installed sympy or have you
>> just downloaded the code?
>>
>> By any chance have you created a file somewhere called "sympy.py"
>> because that would be picked up by "import sympy".
>>
>> --
>> Oscar
>
> --
> 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 sympy+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sympy/96786754-3025-4b31-886d-4ee4a54e38d5n%40googlegroups.com.

-- 
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 sympy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CAHVvXxQ%3DmS6tq_X3ey7ACWvDw%2B5k6nPttLyOaibSA4P%3DD8UdvA%40mail.gmail.com.


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:
> >
> > #!/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 'Symbol' is not defined
> >
> > How can I fix it, to be able to execute this file from anywhere in my 
> directory tree?
>
> That should work fine. Have you actually installed sympy or have you
> just downloaded the code?
>
> By any chance have you created a file somewhere called "sympy.py"
> because that would be picked up by "import sympy".
>
> --
> Oscar
>

-- 
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 sympy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/96786754-3025-4b31-886d-4ee4a54e38d5n%40googlegroups.com.


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 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 'Symbol' is not defined
> >
> > How can I fix it, to be able to execute this file from anywhere in my
> directory tree?
>
> That should work fine. Have you actually installed sympy or have you
> just downloaded the code?
>
> By any chance have you created a file somewhere called "sympy.py"
> because that would be picked up by "import sympy".
>
> --
> Oscar
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "sympy" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/sympy/bPMu9bCGDPQ/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> sympy+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sympy/CAHVvXxTt9-sVnR4RYtDVuRzLgwOFYbv3Jr--uaqvgyO1dVNxNQ%40mail.gmail.com
> .
>

-- 
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 sympy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CACGD5t%3D8gwR%3D17NbsTPT_TTmuiRDgAHPj95CK1CkXUGzgJ0Tdw%40mail.gmail.com.


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

2021-02-10 Thread Oscar Benjamin
On Wed, 10 Feb 2021 at 20:47, Michał Pawłowski
 wrote:
>
> 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 'Symbol' is not defined
>
> How can I fix it, to be able to execute this file from anywhere in my 
> directory tree?

That should work fine. Have you actually installed sympy or have you
just downloaded the code?

By any chance have you created a file somewhere called "sympy.py"
because that would be picked up by "import sympy".

--
Oscar

-- 
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 sympy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CAHVvXxTt9-sVnR4RYtDVuRzLgwOFYbv3Jr--uaqvgyO1dVNxNQ%40mail.gmail.com.


[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 'Symbol' is not defined

How can I fix it, to be able to execute this file from anywhere in my 
directory tree?

Thanks
Mike

-- 
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 sympy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/0366675e-dacb-4954-a267-9fcf55cd89efn%40googlegroups.com.


Re: [sympy] [SymPy] Is this a bug or a feature?

2021-02-10 Thread Oscar Benjamin
On Wed, 10 Feb 2021 at 20:24, Aaron Meurer  wrote:
>
> On Wed, Feb 10, 2021 at 6:47 AM David Bailey  wrote:
>>
>> On 10/02/2021 00:53, Oscar Benjamin wrote:
>>
>> On Tue, 9 Feb 2021 at 23:58, S.Y. Lee  wrote:
>>
>>
>> And we would also arrive in questions like: If equation brings its own 
>> algebra system, there should be an equation of equations? How should we 
>> solve them?
>>
>> It's not an "algebra system": it's just a few convenience operations.
>> It should not be confused with allowing Equation to be used in places
>> where Expr is expected.
>>
>> Might it be an idea to introduce functions such as AddSides, SubtractSides, 
>> etc that Mathematica has? Not only would these avoid any confusion with the 
>> normal arithmetic operations,  but I think using these functions would 
>> clarify what is going on. After all, when people do such operations by hand, 
>> they don't write (a=b)*k,or whatever, they typically write "Multiplying 
>> equation 4 by k we get..."
>
>
> Is there a need to have an unevaluated version of AddSides? + already works 
> for an evaluated version.
>
> It might be worth thinking about inequalities in the design here. We've been 
> ignoring them because it's simpler to do equalities first, but inequalities 
> have some restrictions that might clarify what design we want. For a > b, 
> things like function application or even multiplication aren't 
> straightforward. What should x*(a > b) do if x is only known to be real? One 
> option is a Piecewise, but then things get hairy if you start doing other 
> operations. Maybe a MultiplySides does actually make sense for this.

See also these two links:
https://github.com/sympy/sympy/pull/20723#issuecomment-763975854
https://github.com/sympy/sympy/pull/17097

Yes, DivideSides would make sense for unevaluated division of inequalities etc.

That is not inconsistent with using + though: We can use eq1+eq2 as a
shorthand for the evaluated form of AddSides(eq1, eq2). For equations
that would always be able to evaluate. In Mathematica this is all
organised around making Boolean expressions that can evaluate after
substitution.


Oscar

-- 
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 sympy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CAHVvXxTAAA%3DHDaNA4-HU%2BqFV34nF7GfA7GbHn_HzVWgu0Epr6w%40mail.gmail.com.


Re: [sympy] [SymPy] Is this a bug or a feature?

2021-02-10 Thread Aaron Meurer
On Wed, Feb 10, 2021 at 6:47 AM David Bailey  wrote:

> On 10/02/2021 00:53, Oscar Benjamin wrote:
>
> On Tue, 9 Feb 2021 at 23:58, S.Y. Lee  
>  wrote:
>
>
> And we would also arrive in questions like: If equation brings its own 
> algebra system, there should be an equation of equations? How should we solve 
> them?
>
> It's not an "algebra system": it's just a few convenience operations.
> It should not be confused with allowing Equation to be used in places
> where Expr is expected.
>
> Might it be an idea to introduce functions such as AddSides,
> SubtractSides, etc that Mathematica has? Not only would these avoid any
> confusion with the normal arithmetic operations,  but I think using these
> functions would clarify what is going on. After all, when people do such
> operations by hand, they don't write (a=b)*k,or whatever, they typically
> write "Multiplying equation 4 by k we get..."
>

Is there a need to have an unevaluated version of AddSides? + already works
for an evaluated version.

It might be worth thinking about inequalities in the design here. We've
been ignoring them because it's simpler to do equalities first, but
inequalities have some restrictions that might clarify what design we want.
For a > b, things like function application or even multiplication aren't
straightforward. What should x*(a > b) do if x is only known to be real?
One option is a Piecewise, but then things get hairy if you start doing
other operations. Maybe a MultiplySides does actually make sense for this.

Aaron Meurer

David
>
> --
> 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 sympy+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sympy/8ae678d4-86cf-82eb-1037-1356e18b88f6%40dbailey.co.uk
> 
> .
>

-- 
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 sympy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CAKgW%3D6%2Bg6XZGyA%3D7dZ8wx%2Btk0t8dyN5TMw3kvsu_%3D07R1EX9cA%40mail.gmail.com.


[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:
>>
>> 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 `print()` statement: `print(1+x+x**2+x**3)`.
>>> On Wednesday, February 10, 2021 at 9:43:44 AM UTC-6 
>>> michal.bozyd...@gmail.com wrote:
>>>
 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 receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/fc4ec4c6-097e-40d1-9c2c-6ee0132ffb42n%40googlegroups.com.


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

2021-02-10 Thread gu...@uwosh.edu
`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:
>
> 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 `print()` statement: `print(1+x+x**2+x**3)`.
>> On Wednesday, February 10, 2021 at 9:43:44 AM UTC-6 
>> michal.bozyd...@gmail.com wrote:
>>
>>> 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 receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/cdc742dd-6c6e-49b2-87e4-d9307ad9497cn%40googlegroups.com.


[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 `print()` statement: `print(1+x+x**2+x**3)`.
> On Wednesday, February 10, 2021 at 9:43:44 AM UTC-6 
> michal.bozyd...@gmail.com wrote:
>
>> 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 receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/bdbf74bf-0e4a-481c-8c2c-649e3cc3ad39n%40googlegroups.com.


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

2021-02-10 Thread gu...@uwosh.edu
wrap your expression in a `print()` statement: `print(1+x+x**2+x**3)`.
On Wednesday, February 10, 2021 at 9:43:44 AM UTC-6 
michal.bozyd...@gmail.com wrote:

> 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 receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/554ae78d-056b-4292-b51d-cf896455d95cn%40googlegroups.com.


Re: [sympy] Google Season of Docs 2021

2021-02-10 Thread Soumi7
Hi Tejasvi,

This issue (https://github.com/sympy/sympy/issues/19591)  has links to all 
modules that have been updated. You can start by updating other modules to 
follow the documentation style guide mentioned here : 
https://docs.sympy.org/latest/documentation-style-guide.html.

Thanks,
Soumi.

On Wednesday, February 10, 2021 at 10:22:40 PM UTC+5:30 tejas...@gmail.com 
wrote:

> Hi Aaron and Oscar,
>
> I am Tejasvi Chebrolu, a computer science sophomore at International 
> Institute of Information Technology, Hyderabad. I have recently been trying 
> to improve my technical writing skills and would like to work with SymPy as 
> a part of GSoD-2021. After going through the ideas on 
> https://github.com/sympy/sympy/wiki/GSoD-2020-Ideas and on this thread I 
> agree that the most important task that we should pursue is the 
> "Organization of Documentation". However, I would like to work on improving 
> consistency across docstrings(as mentioned by Aaron). To start 
> contributing(to improving docstrings) I was planning on working through the 
> issues here https://github.com/sympy/sympy/milestone/54. I wanted to know 
> what you guys think about pursuing consistent docstrings over an overall 
> organization of the documentation. I also wanted to know what else could be 
> a good starting point for working on the improvement of the docstrings. 
>
> Also, if you feel that an overall Organization is more important, it would 
> be great if you could link me to some issues that I could start working on.
>
> Thanks!
>
> Regards,
> Tejasvi Chebrolu
>
> On Wed, Feb 10, 2021 at 3:07 AM Aaron Meurer  wrote:
>
>>
>>
>> On Tue, Feb 9, 2021 at 12:51 PM Oscar Benjamin  
>> wrote:
>>
>>> Hi Aaron,
>>>
>>> I would go with "Organization of Documentation" as the most important.
>>> We need to get it organised so that there is a clear distinction
>>> between user functions vs internals and so that there are good
>>> cross-references to explanatory guides etc. We definitely need
>>> high-level docs but at the moment there's nowhere to put them.
>>>
>>
>> I'm inclined to agree with this. Either this or continued work on 
>> improving the style of docstrings. 
>>
>> In general, I think GSoD and technical writer work in general is better 
>> spent improving the style and organization of existing documentation rather 
>> than writing new documentation. New documentation requires domain knowledge 
>> of SymPy itself, which most technical writers won't have. It's better for 
>> existing developers to write those. A technical writer could then improve 
>> that documentation, but the content itself for new documentation has to 
>> come from someone who has expert knowledge on the thing being documented.
>>
>> Aaron Meurer
>>  
>>
>>>
>>> Oscar
>>>
>>> On Tue, 9 Feb 2021 at 19:32, Aaron Meurer  wrote:
>>> >
>>> > Google has announced Google Season of Docs (GSoD) again for 2021. GSoD 
>>> is a program that pairs technical writers with open source projects. We 
>>> have participated in the past two years.
>>> >
>>> > The GSoD program has changed quite a bit this year. In the past, it 
>>> was run like Google Summer of Code, where technical writers applied to work 
>>> with organizations. This year, instead organizations submit a proposal to 
>>> Google and if accepted, Google gives them a grant to hire a technical 
>>> writer.
>>> >
>>> > What this means is that we need to pick a project ourselves and apply 
>>> for it. Technical writers will then apply to work on that one project. If 
>>> you are a technical writer or know of one who may be interested in 
>>> applying, see 
>>> https://developers.google.com/season-of-docs/docs/tech-writer-guide.
>>> >
>>> > Here is the list of ideas that we used last year 
>>> https://github.com/sympy/sympy/wiki/GSoD-2020-Ideas. Which idea do 
>>> people think is the most important one? If you are a technical writer who 
>>> is interested in working with us, we would like to hear your feedback too.
>>> >
>>> > The rules for organizations are at 
>>> https://developers.google.com/season-of-docs/docs/admin-guide.
>>> >
>>> > Aaron Meurer
>>> >
>>> > --
>>> > 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 sympy+un...@googlegroups.com.
>>> > To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/sympy/CAKgW%3D6%2Bxx0htU2w5cYmoSxtpy82LthcmnskfGxNwUXA5YL5HSQ%40mail.gmail.com
>>> .
>>>
>>> -- 
>>> 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 sympy+un...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/sympy/CAHVvXxSzR8vjsioO7XhsJx2CtZuqgiBzeAi%2BVE-wBAPm3P_RuA%40mail.gmail.com
>>> .
>>>
>> -- 
>> You received this message because you are subscribed to 

Re: [sympy] Google Season of Docs 2021

2021-02-10 Thread C.S.R. Tejasvi
Hi Aaron and Oscar,

I am Tejasvi Chebrolu, a computer science sophomore at International
Institute of Information Technology, Hyderabad. I have recently been trying
to improve my technical writing skills and would like to work with SymPy as
a part of GSoD-2021. After going through the ideas on
https://github.com/sympy/sympy/wiki/GSoD-2020-Ideas and on this thread I
agree that the most important task that we should pursue is the
"Organization of Documentation". However, I would like to work on improving
consistency across docstrings(as mentioned by Aaron). To start
contributing(to improving docstrings) I was planning on working through the
issues here https://github.com/sympy/sympy/milestone/54. I wanted to know
what you guys think about pursuing consistent docstrings over an overall
organization of the documentation. I also wanted to know what else could be
a good starting point for working on the improvement of the docstrings.

Also, if you feel that an overall Organization is more important, it would
be great if you could link me to some issues that I could start working on.

Thanks!

Regards,
Tejasvi Chebrolu

On Wed, Feb 10, 2021 at 3:07 AM Aaron Meurer  wrote:

>
>
> On Tue, Feb 9, 2021 at 12:51 PM Oscar Benjamin 
> wrote:
>
>> Hi Aaron,
>>
>> I would go with "Organization of Documentation" as the most important.
>> We need to get it organised so that there is a clear distinction
>> between user functions vs internals and so that there are good
>> cross-references to explanatory guides etc. We definitely need
>> high-level docs but at the moment there's nowhere to put them.
>>
>
> I'm inclined to agree with this. Either this or continued work on
> improving the style of docstrings.
>
> In general, I think GSoD and technical writer work in general is better
> spent improving the style and organization of existing documentation rather
> than writing new documentation. New documentation requires domain knowledge
> of SymPy itself, which most technical writers won't have. It's better for
> existing developers to write those. A technical writer could then improve
> that documentation, but the content itself for new documentation has to
> come from someone who has expert knowledge on the thing being documented.
>
> Aaron Meurer
>
>
>>
>> Oscar
>>
>> On Tue, 9 Feb 2021 at 19:32, Aaron Meurer  wrote:
>> >
>> > Google has announced Google Season of Docs (GSoD) again for 2021. GSoD
>> is a program that pairs technical writers with open source projects. We
>> have participated in the past two years.
>> >
>> > The GSoD program has changed quite a bit this year. In the past, it was
>> run like Google Summer of Code, where technical writers applied to work
>> with organizations. This year, instead organizations submit a proposal to
>> Google and if accepted, Google gives them a grant to hire a technical
>> writer.
>> >
>> > What this means is that we need to pick a project ourselves and apply
>> for it. Technical writers will then apply to work on that one project. If
>> you are a technical writer or know of one who may be interested in
>> applying, see
>> https://developers.google.com/season-of-docs/docs/tech-writer-guide.
>> >
>> > Here is the list of ideas that we used last year
>> https://github.com/sympy/sympy/wiki/GSoD-2020-Ideas. Which idea do
>> people think is the most important one? If you are a technical writer who
>> is interested in working with us, we would like to hear your feedback too.
>> >
>> > The rules for organizations are at
>> https://developers.google.com/season-of-docs/docs/admin-guide.
>> >
>> > Aaron Meurer
>> >
>> > --
>> > 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 sympy+unsubscr...@googlegroups.com.
>> > To view this discussion on the web visit
>> https://groups.google.com/d/msgid/sympy/CAKgW%3D6%2Bxx0htU2w5cYmoSxtpy82LthcmnskfGxNwUXA5YL5HSQ%40mail.gmail.com
>> .
>>
>> --
>> 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 sympy+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/sympy/CAHVvXxSzR8vjsioO7XhsJx2CtZuqgiBzeAi%2BVE-wBAPm3P_RuA%40mail.gmail.com
>> .
>>
> --
> 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 sympy+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sympy/CAKgW%3D6JRNnwxnWS3Fr8bKrvQijeFa3o_g%2B54SeqDjBtB31E_CA%40mail.gmail.com
> 
> .
>


-- 
Regards,
Tejasvi Chebrolu

-- 
You received this message because you 

Re: [sympy] GSoC Idea discussion

2021-02-10 Thread Sudeep Sidhu
Jason,

Thanks for clarifying things for me , I actually got confused because your
name wasn't in potential mentors list so I thought about that "good to go".

Other than looking in other dynamics packages I wanted to learn a bit
theory about Joints and JointsMethod , searching google is showing Truss,
so please recommend me a book or website to gain that knowledge.

Sudeep Sidhu



On Wed, 10 Feb 2021, 20:42 Jason Moore,  wrote:

> Sudeep,
>
> We don't tell you what is "good to go". Every applicant can propose
> whatever they want. The applications are judged on the scope, the
> likelihood of success, the writer's communication, alignment with sympy's
> roadmap, and their applicant's interaction with the community.
>
> Jason
> moorepants.info
> +01 530-601-9791
>
>
> On Wed, Feb 10, 2021 at 4:07 PM Sudeep Sidhu 
> wrote:
>
>> Jason,
>>
>> I'll surely look into it.
>>
>> So is JointsMethod good to go as GSoC project?
>>
>> On Wed, 10 Feb 2021, 19:15 Jason Moore,  wrote:
>>
>>> Sudeep,
>>>
>>> The only thing I can think of to look it is how people do this in other
>>> dynamics software. Many of them let the user define a system based on
>>> descriptions of rigid bodies and different joint types. That description is
>>> the used to define the mathematics of the kinematics. The software Simbody
>>> does it, for example: https://github.com/simbody/simbody You can see
>>> that the concept of a "mobilizer" is used.
>>>
>>> Jason
>>> moorepants.info
>>> +01 530-601-979
>>>
>> --
>> 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 sympy+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/sympy/CAJUjCNmYppkxNO91SpEuMBXhbbHx26bnWF8-ioxA5NiECuWtFg%40mail.gmail.com
>> 
>> .
>>
> --
> 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 sympy+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sympy/CAP7f1AhSTDWC2n-z5h-jCLugdrvqPNMMWa96ck27E2Y-ttbJjQ%40mail.gmail.com
> 
> .
>

-- 
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 sympy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CAJUjCN%3D0uFuMMabBiHPGRbq6dt9xNDtTFfsnxQryqroxF%3DQcTg%40mail.gmail.com.


[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 receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/12848f64-33de-4cf1-9cc0-9805d59c71b5n%40googlegroups.com.


Re: [sympy] GSoC Idea discussion

2021-02-10 Thread Jason Moore
Sudeep,

We don't tell you what is "good to go". Every applicant can propose
whatever they want. The applications are judged on the scope, the
likelihood of success, the writer's communication, alignment with sympy's
roadmap, and their applicant's interaction with the community.

Jason
moorepants.info
+01 530-601-9791


On Wed, Feb 10, 2021 at 4:07 PM Sudeep Sidhu 
wrote:

> Jason,
>
> I'll surely look into it.
>
> So is JointsMethod good to go as GSoC project?
>
> On Wed, 10 Feb 2021, 19:15 Jason Moore,  wrote:
>
>> Sudeep,
>>
>> The only thing I can think of to look it is how people do this in other
>> dynamics software. Many of them let the user define a system based on
>> descriptions of rigid bodies and different joint types. That description is
>> the used to define the mathematics of the kinematics. The software Simbody
>> does it, for example: https://github.com/simbody/simbody You can see
>> that the concept of a "mobilizer" is used.
>>
>> Jason
>> moorepants.info
>> +01 530-601-979
>>
> --
> 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 sympy+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sympy/CAJUjCNmYppkxNO91SpEuMBXhbbHx26bnWF8-ioxA5NiECuWtFg%40mail.gmail.com
> 
> .
>

-- 
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 sympy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CAP7f1AhSTDWC2n-z5h-jCLugdrvqPNMMWa96ck27E2Y-ttbJjQ%40mail.gmail.com.


Re: [sympy] GSoC Idea discussion

2021-02-10 Thread Sudeep Sidhu
Jason,

I'll surely look into it.

So is JointsMethod good to go as GSoC project?

On Wed, 10 Feb 2021, 19:15 Jason Moore,  wrote:

> Sudeep,
>
> The only thing I can think of to look it is how people do this in other
> dynamics software. Many of them let the user define a system based on
> descriptions of rigid bodies and different joint types. That description is
> the used to define the mathematics of the kinematics. The software Simbody
> does it, for example: https://github.com/simbody/simbody You can see that
> the concept of a "mobilizer" is used.
>
> Jason
> moorepants.info
> +01 530-601-979
>

-- 
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 sympy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CAJUjCNmYppkxNO91SpEuMBXhbbHx26bnWF8-ioxA5NiECuWtFg%40mail.gmail.com.


Re: [sympy] [SymPy] Is this a bug or a feature?

2021-02-10 Thread David Bailey

On 10/02/2021 00:53, Oscar Benjamin wrote:

On Tue, 9 Feb 2021 at 23:58, S.Y. Lee  wrote:


And we would also arrive in questions like: If equation brings its own algebra 
system, there should be an equation of equations? How should we solve them?

It's not an "algebra system": it's just a few convenience operations.
It should not be confused with allowing Equation to be used in places
where Expr is expected.


Might it be an idea to introduce functions such as AddSides, 
SubtractSides, etc that Mathematica has? Not only would these avoid any 
confusion with the normal arithmetic operations,  but I think using 
these functions would clarify what is going on. After all, when people 
do such operations by hand, they don't write (a=b)*k,or whatever, they 
typically write "Multiplying equation 4 by k we get..."


David

--
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 sympy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/8ae678d4-86cf-82eb-1037-1356e18b88f6%40dbailey.co.uk.


Re: [sympy] GSoC Idea discussion

2021-02-10 Thread Jason Moore
Sudeep,

The only thing I can think of to look it is how people do this in other
dynamics software. Many of them let the user define a system based on
descriptions of rigid bodies and different joint types. That description is
the used to define the mathematics of the kinematics. The software Simbody
does it, for example: https://github.com/simbody/simbody You can see that
the concept of a "mobilizer" is used.

Jason
moorepants.info
+01 530-601-9791


On Wed, Feb 10, 2021 at 1:51 PM Sudeep Sidhu 
wrote:

> Jason,
>
> I went through the previous JointsMethod work, I think it would be wise to
> complete the previous 2 PRs of Joint Methods because it contains some good
> work and completing them would take less time rather than starting from
> scratch.
> Please refer a source to read more about Joints and JointsMethod.
>
> Sudeep Sidhu
>
>
>
>
> On Tue, 9 Feb 2021, 18:19 Sudeep Sidhu, 
> wrote:
>
>> Jason,
>>
>> I'm comfortable in implementing JointsMethod and it has some previous
>> work done too (unmerged GSoC work). All I would need is some guidance with
>> concepts if I get stuck somewhere and a good source to read about
>> JointsMethod. I have some knowledge of dynamics too so I think I can
>> implement it.
>>
>> Sudeep Sidhu
>>
>> On Tue, 9 Feb 2021, 15:28 Jason Moore,  wrote:
>>
>>> I personally think completing the JointsMethod is of higher priority
>>> than the FeatherStone method. The JointsMethod would open up the use of the
>>> library to a much wider set of users because they will be able to construct
>>> models with less knowledge of the underlying mathematics. For example, a
>>> double compound pendulum could be created like this:
>>>
>>> ground = RigidBody(...)
>>> upper_link = RigidBody(...)
>>> lower_link = RigidBody(...)
>>>
>>> base_joint = PinJoin(ground, lower_link, ...)
>>> intermediate_joint = PinJoint(lower_link, upper_link, ...)
>>>
>>> joint_method = JointMethod((base_joint, intermediate_joint), ...)
>>>
>>> equations_of_motion = joint_method.generate_eoms(...)
>>>
>>> Jason
>>> moorepants.info
>>> +01 530-601-9791
>>>
>> --
> 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 sympy+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sympy/CAJUjCNnYjAqYz6z_sSum_-WLAGwP0FNotfSQvwxotNKcqqqs_A%40mail.gmail.com
> 
> .
>

-- 
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 sympy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CAP7f1Aj2h_Q0%2BbP2HvpON3VaqctVjiuAXdO2YZJs_bWd%3D6iHDw%40mail.gmail.com.


Re: [sympy] GSoC Idea discussion

2021-02-10 Thread Sudeep Sidhu
Jason,

I went through the previous JointsMethod work, I think it would be wise to
complete the previous 2 PRs of Joint Methods because it contains some good
work and completing them would take less time rather than starting from
scratch.
Please refer a source to read more about Joints and JointsMethod.

Sudeep Sidhu




On Tue, 9 Feb 2021, 18:19 Sudeep Sidhu,  wrote:

> Jason,
>
> I'm comfortable in implementing JointsMethod and it has some previous work
> done too (unmerged GSoC work). All I would need is some guidance with
> concepts if I get stuck somewhere and a good source to read about
> JointsMethod. I have some knowledge of dynamics too so I think I can
> implement it.
>
> Sudeep Sidhu
>
> On Tue, 9 Feb 2021, 15:28 Jason Moore,  wrote:
>
>> I personally think completing the JointsMethod is of higher priority than
>> the FeatherStone method. The JointsMethod would open up the use of the
>> library to a much wider set of users because they will be able to construct
>> models with less knowledge of the underlying mathematics. For example, a
>> double compound pendulum could be created like this:
>>
>> ground = RigidBody(...)
>> upper_link = RigidBody(...)
>> lower_link = RigidBody(...)
>>
>> base_joint = PinJoin(ground, lower_link, ...)
>> intermediate_joint = PinJoint(lower_link, upper_link, ...)
>>
>> joint_method = JointMethod((base_joint, intermediate_joint), ...)
>>
>> equations_of_motion = joint_method.generate_eoms(...)
>>
>> Jason
>> moorepants.info
>> +01 530-601-9791
>>
>

-- 
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 sympy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CAJUjCNnYjAqYz6z_sSum_-WLAGwP0FNotfSQvwxotNKcqqqs_A%40mail.gmail.com.