Re: [sympy] Newbie says Hi! and seeks help with subs()

2022-11-24 Thread Jeremy Swift
Thanks for the quick advice, Aaron. I'm making progress again as a result.

Jeremy

On Thursday, November 24, 2022 at 5:02:19 AM UTC asme...@gmail.com wrote:

> The problem is that eq1 is a list. solve() returns a list because in
> general an equation can have more than one solution. To get the
> solution, use eq1[0]. This probably should have produced an error, but
> for some reason it didn't.
>
> Aaron Meurer
>
> On Wed, Nov 23, 2022 at 3:11 PM Jeremy Swift  wrote:
> >
> > Hi there,
> >
> > I have just discovered sympy and am making my first tentative 
> experiments.
> >
> > Over the years I've probably forgotten more maths than I remember so my 
> knowledge is somewhere between basic engineering maths and multiplication 
> tables. Having retired I'm trying to dredge some of it back from the depths.
> >
> > I'm comfortable with programming and have been writing some python 
> lately, primarily for use in Rhino3D.
> >
> > I have some simultaneous equations to solve for four variables, F1, F2, 
> F3 and F4. and a lot of given values V1x, V2x etc. Given the number of 
> parameters, making substitutions manually is error prone, so I figured I'd 
> get sympy to do the grunt work. However, subs() doesn't seem to be working 
> for me. Could somebody show me where I am going wrong?
> >
> > Here's a simplified interactive example:
> >
> > >>> import sympy as s
> > >>> s.init_printing()
> > >>> F1,F2,F3,F4=s.symbols('F1 F2 F3 F4')
> > >>> V1x,V2x,V3x,V4x=s.symbols('V1x V2x V3x V4x')
> > >>> V1y,V2y,V3y,V4y=s.symbols('V1y V2y V3y V4y')
> > >>>
> > >>> eqx=F1*V1x+F2*V2x+F3*V3x+F4*V4x
> > >>> eqy=F1*V1y+F2*V2y+F3*V3y+F4*V4y
> > >>> eqx
> > F₁⋅V1x + F₂⋅V2x + F₃⋅V3x + F₄⋅V4x
> > >>> eq1=s.solve(eqx, F1)
> > >>> eq1
> > ⎡-F₂⋅V2x - F₃⋅V3x - F₄⋅V4x⎤
> > ⎢─⎥
> > ⎣ V1x ⎦
> > >>> eq2=eqy.subs(F1, eq1)
> > >>> eq2
> > F₁⋅V1y + F₂⋅V2y + F₃⋅V3y + F₄⋅V4y
> > >>>
> >
> > I was expecting sympy to substitute the solution in eq1 into the formula 
> in eqy, but that hasn't happened. Why not?
> >
> > TIA
> > Jeremy
> >
> > --
> > 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/dc6d0e11-7407-435e-b6ca-ae434487dbecn%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/d884466e-8357-4bf8-bbdc-46838b35a2b9n%40googlegroups.com.


Re: [sympy] Newbie says Hi! and seeks help with subs()

2022-11-23 Thread Aaron Meurer
The problem is that eq1 is a list. solve() returns a list because in
general an equation can have more than one solution. To get the
solution, use eq1[0]. This probably should have produced an error, but
for some reason it didn't.

Aaron Meurer

On Wed, Nov 23, 2022 at 3:11 PM Jeremy Swift  wrote:
>
> Hi there,
>
> I have just discovered sympy and am making my first tentative experiments.
>
> Over the years I've probably forgotten more maths than I remember so my 
> knowledge is somewhere between basic engineering maths and multiplication 
> tables. Having retired I'm trying to dredge some of it back from the depths.
>
> I'm comfortable with programming and have been writing some python lately, 
> primarily for use in Rhino3D.
>
> I have some simultaneous equations to solve for four variables, F1, F2, F3 
> and F4. and a lot of given values V1x, V2x etc. Given the number of 
> parameters, making substitutions manually is error prone, so I figured I'd 
> get sympy to do the grunt work. However, subs() doesn't seem to be working 
> for me. Could somebody show me where I am going wrong?
>
> Here's a simplified interactive example:
>
> >>> import sympy as s
> >>> s.init_printing()
> >>> F1,F2,F3,F4=s.symbols('F1 F2 F3 F4')
> >>> V1x,V2x,V3x,V4x=s.symbols('V1x V2x V3x V4x')
> >>> V1y,V2y,V3y,V4y=s.symbols('V1y V2y V3y V4y')
> >>>
> >>> eqx=F1*V1x+F2*V2x+F3*V3x+F4*V4x
> >>> eqy=F1*V1y+F2*V2y+F3*V3y+F4*V4y
> >>> eqx
> F₁⋅V1x + F₂⋅V2x + F₃⋅V3x + F₄⋅V4x
> >>> eq1=s.solve(eqx, F1)
> >>> eq1
> ⎡-F₂⋅V2x - F₃⋅V3x - F₄⋅V4x⎤
> ⎢─⎥
> ⎣   V1x   ⎦
> >>> eq2=eqy.subs(F1, eq1)
> >>> eq2
> F₁⋅V1y + F₂⋅V2y + F₃⋅V3y + F₄⋅V4y
> >>>
>
> I was expecting sympy to substitute the solution in eq1 into the formula in 
> eqy, but that hasn't happened. Why not?
>
> TIA
> Jeremy
>
> --
> 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/dc6d0e11-7407-435e-b6ca-ae434487dbecn%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/CAKgW%3D6%2Bo28jTS-SwD6P%2BzhuNsW7imdiuKqwrA_Zg4Y5JtBaxyg%40mail.gmail.com.


[sympy] Newbie says Hi! and seeks help with subs()

2022-11-23 Thread Jeremy Swift
Hi there,

I have just discovered sympy and am making my first tentative experiments. 

Over the years I've probably forgotten more maths than I remember so my 
knowledge is somewhere between basic engineering maths and multiplication 
tables. Having retired I'm trying to dredge some of it back from the depths.

I'm comfortable with programming and have been writing some python lately, 
primarily for use in Rhino3D.

I have some simultaneous equations to solve for four variables, F1, F2, F3 
and F4. and a lot of given values V1x, V2x etc. Given the number of 
parameters, making substitutions manually is error prone, so I figured I'd 
get sympy to do the grunt work. However, subs() doesn't seem to be working 
for me. Could somebody show me where I am going wrong?

Here's a simplified interactive example:

>>> import sympy as s
>>> s.init_printing()
>>> F1,F2,F3,F4=s.symbols('F1 F2 F3 F4')
>>> V1x,V2x,V3x,V4x=s.symbols('V1x V2x V3x V4x')
>>> V1y,V2y,V3y,V4y=s.symbols('V1y V2y V3y V4y')
>>> 
>>> eqx=F1*V1x+F2*V2x+F3*V3x+F4*V4x
>>> eqy=F1*V1y+F2*V2y+F3*V3y+F4*V4y
>>> eqx
F₁⋅V1x + F₂⋅V2x + F₃⋅V3x + F₄⋅V4x
>>> eq1=s.solve(eqx, F1)
>>> eq1
⎡-F₂⋅V2x - F₃⋅V3x - F₄⋅V4x⎤
⎢─⎥
⎣   V1x   ⎦
>>> eq2=eqy.subs(F1, eq1)
>>> eq2
F₁⋅V1y + F₂⋅V2y + F₃⋅V3y + F₄⋅V4y
>>> 

I was expecting sympy to substitute the solution in eq1 into the formula in 
eqy, but that hasn't happened. Why not?

TIA
Jeremy

-- 
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/dc6d0e11-7407-435e-b6ca-ae434487dbecn%40googlegroups.com.


[sympy] Newbie :)

2019-11-11 Thread Ashlesha Kumar
Hi,

I am Ashlesha Kumar, undergraduate engineering student pursuing Computer 
Science and Economics at BITS Pilani. 

I have been working with Python for the past one year.I am new to open 
source and would like to contribute to SymPy.

Looking forward to suggestions and guidance for the same.

Thanks in Advance :) 

-- 
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/54704b2f-6c9a-492c-b7e3-d8160cf9ce8b%40googlegroups.com.


Re: [sympy] Newbie

2019-07-15 Thread Tanvi Singhal
Hey Oscar,
Thanks for sharing links.
I will give my best in improving sympy.


On Saturday, 13 July 2019 15:36:46 UTC+5:30, Oscar wrote:
>
> Hi Tanvi, 
>
> It's great that you want to contribute! 
>
> Take a look here (I guess you already did): 
> https://github.com/sympy/sympy/wiki/introduction-to-contributing 
>
> Every part of SymPy can be improved in some way. You mention matrices 
> - there is a lot of work going on for matrices and many issues: 
>
> https://github.com/sympy/sympy/issues?utf8=%E2%9C%93=is%3Aopen+is%3Aissue+label%3Amatrices
>  
>
> https://github.com/sympy/sympy/issues?utf8=%E2%9C%93=is%3Aopen+is%3Aissue+label%3Amatrices.expressions
>  
>
> Also for calculus, are you familiar with differential equations? There 
> are lots of issues for those: 
>
> https://github.com/sympy/sympy/issues?utf8=%E2%9C%93=is%3Aopen+is%3Aissue+label%3Asolvers.dsolve
>  
>
> I would suggest to familiarise yourself with the parts of SymPy you 
> might want to work on and then find the easiest possible issue to work 
> on. You can ask on the issue to check if anyone else is working on it 
> and to confirm that it is easy. Some are marked "easy to fix" or "good 
> first issue" but sometimes those labels can be misleading... 
>
> https://github.com/sympy/sympy/issues?utf8=%E2%9C%93=is%3Aopen+is%3Aissue+label%3A%22Easy+to+Fix%22+
>  
>
> https://github.com/sympy/sympy/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22
>  
>
> -- 
> Oscar 
>
> On Fri, 12 Jul 2019 at 10:06, Tanvi Singhal  > wrote: 
> > 
> > I am Tanvi Singhal, a 4th year undergraduate from IIT Roorkee, India. I 
> am pursuing an Int. Mtech degree in Geology. I know basics of Python and I 
> have read Sympy Tutorial. I am familiar with calculus, trigonometry, 
> Matrices and I want to contribute. I found sympy perfect for Maths lovers. 
> I would be glad if you can guide me on how to proceed. 
> > 
> > -- 
> > 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 sy...@googlegroups.com . 
> > To post to this group, send email to sy...@googlegroups.com 
> . 
> > 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/52b74ef0-3156-4c57-9ac6-fd51f3e85ea1%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 sympy+unsubscr...@googlegroups.com.
To post to this group, send email to sympy@googlegroups.com.
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/2e0fbb13-b53d-47ba-87da-acedf543c4fd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [sympy] Newbie

2019-07-14 Thread Lee Smith
Tanvi:  Good Luck

The central idea of these Jupyter Notebooks is that most math problems can
be solved by simply invoking the sympy solve method and displaying the
result with the sympy plot method.  You can easily extend the analysis, but
I prepared a notebook for college algebra, analytic geometry, deriivatives,
single and multiple variable calculus and others !


Virus-free.
www.avg.com

<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

On Sat, Jul 13, 2019 at 10:07 PM Tanvi Singhal 
wrote:

> Hey Lee I will check it out. Thanks
>
>
> On Sat, 13 Jul 2019 at 15:36, Oscar Benjamin 
> wrote:
>
>> Hi Tanvi,
>>
>> It's great that you want to contribute!
>>
>> Take a look here (I guess you already did):
>> https://github.com/sympy/sympy/wiki/introduction-to-contributing
>>
>> Every part of SymPy can be improved in some way. You mention matrices
>> - there is a lot of work going on for matrices and many issues:
>>
>> https://github.com/sympy/sympy/issues?utf8=%E2%9C%93=is%3Aopen+is%3Aissue+label%3Amatrices
>>
>> https://github.com/sympy/sympy/issues?utf8=%E2%9C%93=is%3Aopen+is%3Aissue+label%3Amatrices.expressions
>>
>> Also for calculus, are you familiar with differential equations? There
>> are lots of issues for those:
>>
>> https://github.com/sympy/sympy/issues?utf8=%E2%9C%93=is%3Aopen+is%3Aissue+label%3Asolvers.dsolve
>>
>> I would suggest to familiarise yourself with the parts of SymPy you
>> might want to work on and then find the easiest possible issue to work
>> on. You can ask on the issue to check if anyone else is working on it
>> and to confirm that it is easy. Some are marked "easy to fix" or "good
>> first issue" but sometimes those labels can be misleading...
>>
>> https://github.com/sympy/sympy/issues?utf8=%E2%9C%93=is%3Aopen+is%3Aissue+label%3A%22Easy+to+Fix%22+
>>
>> https://github.com/sympy/sympy/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22
>>
>> --
>> Oscar
>>
>> On Fri, 12 Jul 2019 at 10:06, Tanvi Singhal 
>> wrote:
>> >
>> > I am Tanvi Singhal, a 4th year undergraduate from IIT Roorkee, India. I
>> am pursuing an Int. Mtech degree in Geology. I know basics of Python and I
>> have read Sympy Tutorial. I am familiar with calculus, trigonometry,
>> Matrices and I want to contribute. I found sympy perfect for Maths lovers.
>> I would be glad if you can guide me on how to proceed.
>> >
>> > --
>> > 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 post to this group, send email to sympy@googlegroups.com.
>> > 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/52b74ef0-3156-4c57-9ac6-fd51f3e85ea1%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 sympy+unsubscr...@googlegroups.com.
>> To post to this group, send email to sympy@googlegroups.com.
>> 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/CAHVvXxQ_ojzt5mp1nkmkUnL6W%3DgCJdopWRy2oE_tnyqjg%3DMVcA%40mail.gmail.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 sympy+unsubscr...@googlegroups.com.
> To post to this group, send email to sympy@googlegroups.com.
> 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/CAOgZ%3DFkupQZWCysyj5xn6%2Bnbu4iqNu975FYrXxnO1Q4-fqgQ_A%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>


Virus-free.
www.avg.com

<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

-- 
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 post to this group, send email to sympy@googlegroups.com.
Visit this group at 

Re: [sympy] Newbie: display product

2019-07-14 Thread Oscar Benjamin
On Sun, 14 Jul 2019 at 13:29, David Bailey  wrote:
>
> On 13/07/2019 22:36, Oscar Benjamin wrote:
>
>
> Generally it is a lot easier to understand SymPy if you are
> experienced with Python. A lot of our users are new to both Python and
> SymPy and I think that makes it hard to explain what's going on. Some
> things would be cleaner for users if SymPy was not embedded within
> Python and can be confusing unless you already know Python well and
> can see why things are the way they are.
>
> --
> Oscar
>
> I am also fairly new to Python and sympy, but I think I have pushed through 
> this pain barrier.
>
> As far as I can see, you really need to use symbols() or var() to set up 
> variables which are going to be used as symbols in bits of algebra or 
> calculus, but you do not need to make a variable symbolic if it is just going 
> to be used to hold expressions or for some other pythonic purpose, such as a 
> counter. However, no harm is done (someone correct me if I am wrong) if you 
> create a lot of symbols, which you can do with :
>
> from sympy.abc import *
>
> because if, say, you subsequently assign X=42 that will harmlessly destroy 
> the sympy symbol attached to x which will become pythonic again, but you 
> obviously want to use it as a constant so that is fine.
>
> I think a good strategy is to either save some letters for use as pythonic 
> variables, or only use variables with more than one character as pythonic 
> variables (they don't look nice in expressions, anyway)
>
> If you want to use x in expressions, then it is probably best not to assign 
> it to 42 (as above) but to leave it symbolic, and use subs to replace it in 
> an expression by 42.

Everything you say here is correct. You need to have a clean
separation in your mind between the Python variable names and the
sympy Symbol objects. When you fully understand all of these things
the results below will not be surprising:
```
>>> z = Symbol('x')
>>> z
x
>>> x = z**2
>>> x
x**2
```
(I don't generally recommend writing code like that though)

--
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 post to this group, send email to sympy@googlegroups.com.
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/CAHVvXxTJmhrApFgxjN6pfHEvM70gWD0AfabEATXhQisGm0qctQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [sympy] Newbie: display product

2019-07-14 Thread David Bailey

On 13/07/2019 22:36, Oscar Benjamin wrote:


Generally it is a lot easier to understand SymPy if you are
experienced with Python. A lot of our users are new to both Python and
SymPy and I think that makes it hard to explain what's going on. Some
things would be cleaner for users if SymPy was not embedded within
Python and can be confusing unless you already know Python well and
can see why things are the way they are.

--
Oscar


I am also fairly new to Python and sympy, but I think I have pushed 
through this pain barrier.


As far as I can see, you really need to use symbols() or var() to set up 
variables which are going to be used as symbols in bits of algebra or 
calculus, but you do not need to make a variable symbolic if it is just 
going to be used to hold expressions or for some other pythonic purpose, 
such as a counter. However, no harm is done (someone correct me if I am 
wrong) if you create a lot of symbols, which you can do with :


from sympy.abc import *

because if, say, you subsequently assign X=42 that will harmlessly 
destroy the sympy symbol attached to x which will become pythonic again, 
but you obviously want to use it as a constant so that is fine.


I think a good strategy is to either save some letters for use as 
pythonic variables, or only use variables with more than one character 
as pythonic variables (they don't look nice in expressions, anyway)


If you want to use x in expressions, then it is probably best not to 
assign it to 42 (as above) but to leave it symbolic, and use subs to 
replace it in an expression by 42.


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 post to this group, send email to sympy@googlegroups.com.
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/499a73c5-9595-3836-a694-d81791a52414%40dbailey.co.uk.
For more options, visit https://groups.google.com/d/optout.


Re: [sympy] Newbie

2019-07-13 Thread Tanvi Singhal
Hey Lee I will check it out. Thanks


On Sat, 13 Jul 2019 at 15:36, Oscar Benjamin 
wrote:

> Hi Tanvi,
>
> It's great that you want to contribute!
>
> Take a look here (I guess you already did):
> https://github.com/sympy/sympy/wiki/introduction-to-contributing
>
> Every part of SymPy can be improved in some way. You mention matrices
> - there is a lot of work going on for matrices and many issues:
>
> https://github.com/sympy/sympy/issues?utf8=%E2%9C%93=is%3Aopen+is%3Aissue+label%3Amatrices
>
> https://github.com/sympy/sympy/issues?utf8=%E2%9C%93=is%3Aopen+is%3Aissue+label%3Amatrices.expressions
>
> Also for calculus, are you familiar with differential equations? There
> are lots of issues for those:
>
> https://github.com/sympy/sympy/issues?utf8=%E2%9C%93=is%3Aopen+is%3Aissue+label%3Asolvers.dsolve
>
> I would suggest to familiarise yourself with the parts of SymPy you
> might want to work on and then find the easiest possible issue to work
> on. You can ask on the issue to check if anyone else is working on it
> and to confirm that it is easy. Some are marked "easy to fix" or "good
> first issue" but sometimes those labels can be misleading...
>
> https://github.com/sympy/sympy/issues?utf8=%E2%9C%93=is%3Aopen+is%3Aissue+label%3A%22Easy+to+Fix%22+
>
> https://github.com/sympy/sympy/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22
>
> --
> Oscar
>
> On Fri, 12 Jul 2019 at 10:06, Tanvi Singhal 
> wrote:
> >
> > I am Tanvi Singhal, a 4th year undergraduate from IIT Roorkee, India. I
> am pursuing an Int. Mtech degree in Geology. I know basics of Python and I
> have read Sympy Tutorial. I am familiar with calculus, trigonometry,
> Matrices and I want to contribute. I found sympy perfect for Maths lovers.
> I would be glad if you can guide me on how to proceed.
> >
> > --
> > 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 post to this group, send email to sympy@googlegroups.com.
> > 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/52b74ef0-3156-4c57-9ac6-fd51f3e85ea1%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 sympy+unsubscr...@googlegroups.com.
> To post to this group, send email to sympy@googlegroups.com.
> 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/CAHVvXxQ_ojzt5mp1nkmkUnL6W%3DgCJdopWRy2oE_tnyqjg%3DMVcA%40mail.gmail.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 sympy+unsubscr...@googlegroups.com.
To post to this group, send email to sympy@googlegroups.com.
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/CAOgZ%3DFkupQZWCysyj5xn6%2Bnbu4iqNu975FYrXxnO1Q4-fqgQ_A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [sympy] Newbie: display product

2019-07-13 Thread Oscar Benjamin
On Sat, 13 Jul 2019 at 21:40, Gary Pajer  wrote:
>
> Oscar,
>
> That does seem to do what I want ... I think.
> What's the difference between this and Chris Smith's answer?

I think that both Chris and Gagandeep thought that you were trying to
do something more complicated than you actually were.

> I think I made a symbolic equation between symbols.  Didn't you make a 
> *pythonic*  assignment?   Then python did the right thing when using the 
> multiplication operation '*' (by overloading?)

So what happens if I break it down is this:

In [1]: x, y = symbols('x, y')

In [2]: x
Out[2]: x

In [3]: y
Out[3]: y

In [4]: a = x + y

In [5]: a
Out[5]: x + y

In [6]: b = x * y

In [7]: b
Out[7]: x⋅y

In [8]: a*b
Out[8]: x⋅y⋅(x + y)

Note that I haven't created any symbols called a and b because I don't
need to. They are Python variables. The line a = x + y creates an
expression object and assigns it to a (as a normal Python assignment).
Likewise for the line b = x * y. SymPy doesn't know that I have called
these objects a and b and it doesn't need to.

Since a (as a Python variable) refers to the expression x + y and b
refers to x*y when I multiply these two I get a new expression x*y*(x
+ y). This new expression is created by operator overloading.
Specifically SymPy's Expr class has a __mul__ method that does this
but that's more detail than you need.

I can also create equation (Eq) objects as in:

In [9]: z = Eq(x, 2*y)

In [10]: z
Out[10]: x = 2⋅

This creates a new equation object. You can pass that object to some
SymPy functions that will know how to interpret it for example if you
ask the solve function to to solve the equation for y:

In [11]: solve(z, y)
Out[11]:
⎡x⎤
⎢─⎥
⎣2⎦

However creating the equation object does not in itself cause SymPy to
understand *in general* that there is a relationship between x and y.
SymPy only looks at the equation object you have created if you pass
that object (e.g. z) to some SymPy function.

> I took things a little farther:
>
> q,r,s = symbols('q r s')

Here you create two symbols q and r which you assign to the Python
variables q and r. That's reasonable except that...

> q = x+y
> r = x*y

now you've reassigned the Python variables q and r to be different
expression objects. There was no need to create the symbols q and r
earlier if this was the intention.

> print(q*r)
> q*r
> s = q*r + 1
> s
> s.subs(x,3)
>
> Everything worked.

Great!

> Is it the case that I made things overly complicated from the beginning?

I think so.

> I'm confused. I don't know how Sympy works, and would appreciate a better 
> description than the tutorial.

Can you point to a particular part of the tutorial that is confusing?
That would help to improve it.

Generally it is a lot easier to understand SymPy if you are
experienced with Python. A lot of our users are new to both Python and
SymPy and I think that makes it hard to explain what's going on. Some
things would be cleaner for users if SymPy was not embedded within
Python and can be confusing unless you already know Python well and
can see why things are the way they are.

--
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 post to this group, send email to sympy@googlegroups.com.
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/CAHVvXxTMGzhk3FBwtUo8seu-jGCc91m5u21Hwi-ektTUidQc_w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [sympy] Newbie: display product

2019-07-13 Thread Gary Pajer
Oscar,

That does seem to do what I want ... I think.
What's the difference between this and Chris Smith's answer?   I think I 
made a symbolic equation between symbols.  Didn't you make a *pythonic*  
assignment?   Then python did the right thing when using the multiplication 
operation '*' (by overloading?)   

I took things a little farther:

q,r,s = symbols('q r s')
q = x+y
r = x*y
print(q*r)
q*r
s = q*r + 1
s
s.subs(x,3)

Everything worked. Is it the case that I made things overly complicated 
from the beginning?  I'm confused.  I don't know how Sympy works, and would 
appreciate a better description than the tutorial.

Thanks.

On Saturday, July 13, 2019 at 7:00:32 AM UTC-4, Oscar wrote:
>
> Hi Gary, 
>
> I wonder if we are overcomplicating things here. Does this do what you 
> want? 
>
> x, y = symbols('x, y') 
> a = x + y 
> b = x * y 
> print(a * b) 
>
> -- 
> Oscar 
>
> On Tue, 9 Jul 2019 at 03:11, Gary Pajer > 
> wrote: 
> > 
> > I'm sure I'm not the first person having trouble getting started.  If 
> there is a good tutorial, more detailed than the sympy docs tutorial, 
> please point me to it! 
> > 
> > I want to display the product of two expressions.  Suppose I have 
> > 
> > a, b, x, y = symbols('a b x y') 
> > ex1 = Eq(a, x + y) 
> > ex2 = Eq(b, x * y) 
> > 
> > How do I display a * b in terms of x and y? 
> > 
> > Thainks. 
> > 
> > -- 
> > 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 sy...@googlegroups.com . 
> > To post to this group, send email to sy...@googlegroups.com 
> . 
> > 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/2a6226b4-0928-4753-a691-a659a9035072%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 sympy+unsubscr...@googlegroups.com.
To post to this group, send email to sympy@googlegroups.com.
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/8de86548-0ff4-4848-bd8b-7de3bb5ba5ed%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [sympy] Newbie: display product

2019-07-13 Thread Oscar Benjamin
Hi Gary,

I wonder if we are overcomplicating things here. Does this do what you want?

x, y = symbols('x, y')
a = x + y
b = x * y
print(a * b)

--
Oscar

On Tue, 9 Jul 2019 at 03:11, Gary Pajer  wrote:
>
> I'm sure I'm not the first person having trouble getting started.  If there 
> is a good tutorial, more detailed than the sympy docs tutorial, please point 
> me to it!
>
> I want to display the product of two expressions.  Suppose I have
>
> a, b, x, y = symbols('a b x y')
> ex1 = Eq(a, x + y)
> ex2 = Eq(b, x * y)
>
> How do I display a * b in terms of x and y?
>
> Thainks.
>
> --
> 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 post to this group, send email to sympy@googlegroups.com.
> 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/2a6226b4-0928-4753-a691-a659a9035072%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 sympy+unsubscr...@googlegroups.com.
To post to this group, send email to sympy@googlegroups.com.
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/CAHVvXxSVN5f_-BNXgBda%3DWrRhbEiF9nc%2B32oCjDOT_6HGoQvwQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [sympy] Newbie

2019-07-13 Thread Oscar Benjamin
Hi Tanvi,

It's great that you want to contribute!

Take a look here (I guess you already did):
https://github.com/sympy/sympy/wiki/introduction-to-contributing

Every part of SymPy can be improved in some way. You mention matrices
- there is a lot of work going on for matrices and many issues:
https://github.com/sympy/sympy/issues?utf8=%E2%9C%93=is%3Aopen+is%3Aissue+label%3Amatrices
https://github.com/sympy/sympy/issues?utf8=%E2%9C%93=is%3Aopen+is%3Aissue+label%3Amatrices.expressions

Also for calculus, are you familiar with differential equations? There
are lots of issues for those:
https://github.com/sympy/sympy/issues?utf8=%E2%9C%93=is%3Aopen+is%3Aissue+label%3Asolvers.dsolve

I would suggest to familiarise yourself with the parts of SymPy you
might want to work on and then find the easiest possible issue to work
on. You can ask on the issue to check if anyone else is working on it
and to confirm that it is easy. Some are marked "easy to fix" or "good
first issue" but sometimes those labels can be misleading...
https://github.com/sympy/sympy/issues?utf8=%E2%9C%93=is%3Aopen+is%3Aissue+label%3A%22Easy+to+Fix%22+
https://github.com/sympy/sympy/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22

--
Oscar

On Fri, 12 Jul 2019 at 10:06, Tanvi Singhal  wrote:
>
> I am Tanvi Singhal, a 4th year undergraduate from IIT Roorkee, India. I am 
> pursuing an Int. Mtech degree in Geology. I know basics of Python and I have 
> read Sympy Tutorial. I am familiar with calculus, trigonometry, Matrices and 
> I want to contribute. I found sympy perfect for Maths lovers. I would be glad 
> if you can guide me on how to proceed.
>
> --
> 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 post to this group, send email to sympy@googlegroups.com.
> 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/52b74ef0-3156-4c57-9ac6-fd51f3e85ea1%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 sympy+unsubscr...@googlegroups.com.
To post to this group, send email to sympy@googlegroups.com.
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/CAHVvXxQ_ojzt5mp1nkmkUnL6W%3DgCJdopWRy2oE_tnyqjg%3DMVcA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [sympy] Newbie

2019-07-12 Thread Lee Smith
Hello Tanvi:

Have a look at  https://github.com/LeeSmithSBCC/Jupyter-Math-For-NerdsThere
is a short Notebook for many undergraduate math classes.  You should
install Anaconda on your computer.  You can see each of my noteooks by
clicking on them in my site, because github will render them in a read ony
mode.  To use them download the folder onto your computer and have fun!

Let me know if you have any questions.

Lee Smith


Virus-free.
www.avg.com

<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

On Fri, Jul 12, 2019 at 2:06 AM Tanvi Singhal 
wrote:

> I am Tanvi Singhal, a 4th year undergraduate from IIT Roorkee, India. I am
> pursuing an Int. Mtech degree in Geology. I know basics of Python and I
> have read Sympy Tutorial. I am familiar with calculus, trigonometry,
> Matrices and I want to contribute. I found sympy perfect for Maths lovers.
> I would be glad if you can guide me on how to proceed.
>
> --
> 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 post to this group, send email to sympy@googlegroups.com.
> 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/52b74ef0-3156-4c57-9ac6-fd51f3e85ea1%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 sympy+unsubscr...@googlegroups.com.
To post to this group, send email to sympy@googlegroups.com.
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/CAJTRwDouK1svFbhyxoCcwZR4_LQw6ZrdVpNp6VFzrrHpN%3D%2Bfvg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[sympy] Newbie

2019-07-12 Thread Tanvi Singhal
I am Tanvi Singhal, a 4th year undergraduate from IIT Roorkee, India. I am 
pursuing an Int. Mtech degree in Geology. I know basics of Python and I 
have read Sympy Tutorial. I am familiar with calculus, trigonometry, 
Matrices and I want to contribute. I found sympy perfect for Maths lovers. 
I would be glad if you can guide me on how to proceed. 

-- 
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 post to this group, send email to sympy@googlegroups.com.
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/52b74ef0-3156-4c57-9ac6-fd51f3e85ea1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[sympy] Newbie: display product

2019-07-08 Thread Gagandeep Singh (B17CS021)
So you want to multiply the two equations? 

-- 
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 post to this group, send email to sympy@googlegroups.com.
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/ab8682c1-1897-44dd-a8d7-cb19e7fd5b19%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[sympy] Newbie: display product

2019-07-08 Thread Gary Pajer
I'm sure I'm not the first person having trouble getting started.  If there 
is a good tutorial, more detailed than the sympy docs tutorial, please 
point me to it!

I want to display the product of two expressions.  Suppose I have

a, b, x, y = symbols('a b x y')
ex1 = Eq(a, x + y)
ex2 = Eq(b, x * y)

How do I display a * b in terms of x and y?

Thainks.

-- 
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 post to this group, send email to sympy@googlegroups.com.
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/2a6226b4-0928-4753-a691-a659a9035072%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[sympy] Newbie to open source

2018-08-30 Thread OpenSourcerer
Hi I am a student at IIIT Gwalior and I am new to open source. I have a 
good amount of coding experience and I wish to contribute to Sympy as I 
love python. Please help me by guiding me through things. I just know very 
basic git so I also will be needing help with that. Look forward to working 
with sympy :) .

-- 
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 post to this group, send email to sympy@googlegroups.com.
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/95827d6e-7558-4739-ac2e-51ed1d1a1108%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[sympy] Newbie to SymPy

2018-08-20 Thread Akshit Srivastava
Hi, I am a BTech student at Indian Institute of Technology, Bombay. I am 
enthusiastic about Python, CPP and FLINT. Can someone guide me to some 
basic bugs to get started with?
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 sympy+unsubscr...@googlegroups.com.
To post to this group, send email to sympy@googlegroups.com.
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/92320b00-3828-4930-ad03-529cadb30411%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[sympy] Newbie!

2017-02-11 Thread Vedarth Sharma
Hello everyone! I am an undergrad and I am really interested in algorithms 
and mathematics. Now I want to get into development. Naturally SymPy caught 
my eye :). Since this is my first time contributing to an organization, I 
will try to solve easy to fix issues first. Please tell me if there are any 
specific contributions that a beginner like me can make. Also, I am 
interested in participating in gsoc 2017 so let me know if there are any 
projects that i can join. I have a lot of time in my hands and I am 
interested in learning new stuff, so I'll appreciate any kind of guidance 
that I can get.. for now I will be trying to solve issue #12114 
.
I hope that I can make some useful contributions.
Vedarth Sharma
LNMIIT

-- 
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 post to this group, send email to sympy@googlegroups.com.
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/9e4c347d-85b0-4b28-b71e-81720fb9de46%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[sympy] Newbie here working on issue 11727

2016-10-19 Thread Kang Han
Hi I'm looking at the issue https://github.com/sympy/sympy/issues/11727. 
Basically numpy raised an zero division warning, but we want to raise an 
runtime error instead. I'm not sure yet but I'm thinking just catch the 
specific numpy warning and raise the zero division error instead. Does that 
make sense?  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 sympy+unsubscr...@googlegroups.com.
To post to this group, send email to sympy@googlegroups.com.
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/3ef3c6e0-0d4d-4b62-91fb-a8e33ab6b76f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [sympy] Newbie

2013-10-28 Thread RISHI MISHRA
Thanks Saurabh


On Mon, Oct 28, 2013 at 9:39 AM, Saurabh Jha saurabh.j...@gmail.com wrote:

 Hi,

 Welcome. For newbie bugs please see [1]. You need to setup your
 environment. Please see [2] for instructions.

 Best
 Saurabh

 [1] http://code.google.com/p/sympy/issues/list?q=label:EasyToFix
 [2] https://github.com/sympy/sympy/wiki/Development-workflow

 --
 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 post to this group, send email to sympy@googlegroups.com.
 Visit this group at http://groups.google.com/group/sympy.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
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 post to this group, send email to sympy@googlegroups.com.
Visit this group at http://groups.google.com/group/sympy.
For more options, visit https://groups.google.com/groups/opt_out.


[sympy] Newbie

2013-10-27 Thread rishimishra
Hi everyone,

I don't know if this is the right place to post such a question so forgive 
me if I am in the wrong.

I am fairly new to open source but have some experience in python 
programming. I was looking around the sympy code and found it interesting.

I would like to contribute to it if possible.

So could someone kindly direct me to some newbie bugs?

-- 
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 post to this group, send email to sympy@googlegroups.com.
Visit this group at http://groups.google.com/group/sympy.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [sympy] Newbie

2013-10-27 Thread Saurabh Jha
Hi,

Welcome. For newbie bugs please see [1]. You need to setup your
environment. Please see [2] for instructions.

Best
Saurabh

[1] http://code.google.com/p/sympy/issues/list?q=label:EasyToFix
[2] https://github.com/sympy/sympy/wiki/Development-workflow

-- 
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 post to this group, send email to sympy@googlegroups.com.
Visit this group at http://groups.google.com/group/sympy.
For more options, visit https://groups.google.com/groups/opt_out.


[sympy] newbie question : exporting sympy plots to svg

2013-06-19 Thread a . jaury
Hello everybody, bonjour tout le monde,
I wonder if there's a way to export sympy plots to svg, as savefig with 
matplotlib ? 
Actually my aim is to convert this svg file to tkz from inkscape...

thank you,
merci d'avance,

alex

-- 
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 post to this group, send email to sympy@googlegroups.com.
Visit this group at http://groups.google.com/group/sympy.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [sympy] newbie question : exporting sympy plots to svg

2013-06-19 Thread Stefan Krastanov
The plot object has a `save` method. Calling it with a filename ending
on `.svg` should be enough if you use the matplotlib backend. The
capabilities of the plotting module depend a lot on the backend that
you are using.

 a=plot(...)
 a.save(*.svg)

On 19 June 2013 09:32,  a.ja...@gmail.com wrote:
 Hello everybody, bonjour tout le monde,
 I wonder if there's a way to export sympy plots to svg, as savefig with
 matplotlib ?
 Actually my aim is to convert this svg file to tkz from inkscape...

 thank you,
 merci d'avance,

 alex

 --
 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 post to this group, send email to sympy@googlegroups.com.
 Visit this group at http://groups.google.com/group/sympy.
 For more options, visit https://groups.google.com/groups/opt_out.



-- 
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 post to this group, send email to sympy@googlegroups.com.
Visit this group at http://groups.google.com/group/sympy.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [sympy] newbie question : exporting sympy plots to svg

2013-06-19 Thread a . jaury
Thank you, it works.
I only tried savefig...

Sorry for the noise.

Le mercredi 19 juin 2013 11:18:07 UTC+2, Stefan Krastanov a écrit :

 The plot object has a `save` method. Calling it with a filename ending 
 on `.svg` should be enough if you use the matplotlib backend. The 
 capabilities of the plotting module depend a lot on the backend that 
 you are using. 

  a=plot(...) 
  a.save(*.svg) 

 On 19 June 2013 09:32,  a.j...@gmail.com javascript: wrote: 
  Hello everybody, bonjour tout le monde, 
  I wonder if there's a way to export sympy plots to svg, as savefig with 
  matplotlib ? 
  Actually my aim is to convert this svg file to tkz from inkscape... 
  
  thank you, 
  merci d'avance, 
  
  alex 
  
  -- 
  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 javascript:. 
  To post to this group, send email to sy...@googlegroups.comjavascript:. 

  Visit this group at http://groups.google.com/group/sympy. 
  For more options, visit https://groups.google.com/groups/opt_out. 
  
  


-- 
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 post to this group, send email to sympy@googlegroups.com.
Visit this group at http://groups.google.com/group/sympy.
For more options, visit https://groups.google.com/groups/opt_out.




[sympy] newbie

2012-09-24 Thread Shalin Shah
hello all,
   i am new to this and dont know from where to start can anyone help me ?
thanks,
Shalin

-- 
You received this message because you are subscribed to the Google Groups 
sympy group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/sympy/-/Vz0eNG1NvXEJ.
To post to this group, send email to sympy@googlegroups.com.
To unsubscribe from this group, send email to 
sympy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sympy?hl=en.



Re: [sympy] newbie

2012-09-24 Thread Aaron Meurer
A good place to start is the tutorial: http://docs.sympy.org/dev/tutorial.html

I'm pointing you to the dev docs because it has a little interactive
shell on the bottom right (you need a fairly modern browser), where
you can test out the commands. Just click on one of the green Run
code block in SymPy Live buttons.

Aaron Meurer

On Sat, Sep 22, 2012 at 11:50 PM, Shalin Shah shalinshah1...@gmail.com wrote:
 hello all,
i am new to this and dont know from where to start can anyone help me ?
 thanks,
 Shalin

 --
 You received this message because you are subscribed to the Google Groups
 sympy group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/sympy/-/Vz0eNG1NvXEJ.
 To post to this group, send email to sympy@googlegroups.com.
 To unsubscribe from this group, send email to
 sympy+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/sympy?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
sympy group.
To post to this group, send email to sympy@googlegroups.com.
To unsubscribe from this group, send email to 
sympy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sympy?hl=en.



Re: [sympy] newbie

2012-09-24 Thread Matthew Rocklin
There is some good information on the wiki
https://github.com/sympy/sympy/wiki

In particular I recommend the Development section.

The 2011 Google Code In article is also particularly well written
https://github.com/sympy/sympy/wiki/GCI-2011-Landing

On Sun, Sep 23, 2012 at 12:50 AM, Shalin Shah shalinshah1...@gmail.comwrote:

 hello all,
i am new to this and dont know from where to start can anyone help me ?
 thanks,
 Shalin

 --
 You received this message because you are subscribed to the Google Groups
 sympy group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/sympy/-/Vz0eNG1NvXEJ.
 To post to this group, send email to sympy@googlegroups.com.
 To unsubscribe from this group, send email to
 sympy+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/sympy?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
sympy group.
To post to this group, send email to sympy@googlegroups.com.
To unsubscribe from this group, send email to 
sympy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sympy?hl=en.



Re: [sympy] newbie

2012-09-24 Thread Matthew Rocklin
Ah, I assumed you were asking about contributing code but this might not be
correct.
Aaron's answer is probably better.

On Mon, Sep 24, 2012 at 10:00 PM, Matthew Rocklin mrock...@gmail.comwrote:

 There is some good information on the wiki
 https://github.com/sympy/sympy/wiki

 In particular I recommend the Development section.

 The 2011 Google Code In article is also particularly well written
 https://github.com/sympy/sympy/wiki/GCI-2011-Landing


 On Sun, Sep 23, 2012 at 12:50 AM, Shalin Shah shalinshah1...@gmail.comwrote:

 hello all,
i am new to this and dont know from where to start can anyone help me ?
 thanks,
 Shalin

 --
 You received this message because you are subscribed to the Google Groups
 sympy group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/sympy/-/Vz0eNG1NvXEJ.
 To post to this group, send email to sympy@googlegroups.com.
 To unsubscribe from this group, send email to
 sympy+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/sympy?hl=en.




-- 
You received this message because you are subscribed to the Google Groups 
sympy group.
To post to this group, send email to sympy@googlegroups.com.
To unsubscribe from this group, send email to 
sympy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sympy?hl=en.



[sympy] Newbie question

2012-03-13 Thread Southern.Cross
Hello,

I'm new to sympy so please excuse me if this question is obvious to
the experienced.

In multibody kinematics there is a classic relationship between a
rotating body's angular velocity and the rotation matrices
representing the configuration at a given point in time. Basically, if
I am using a roll/pitch/yaw representation of the rotation then I have
three rotation matrices that comprise the full instantaneous rotation,

R =  rotx(gamma) * roty(beta) * rotz(alpha)

Meaning, if I rotate the body by 'alpha' about a body fixed 'Z' axis,
followed by a rotation 'beta' about the once rotated body fixed 'Y'
axis, followed by a rotation 'gamma' about the twice rotated body
fixed 'X' axis... I now have a complete instantaneous rotation matrix
R.

The relationship of the angular velocity of the body is,

skew(w) = Rdot * R.transpose

so, a new skew symmetric matrix is created from the matrix product
between the time derivative of R and the transpose of R. (Since alpha,
beta, and gamma are all functions of time then R is a function of
time.)

Completing the above described equations in Mathematica does in fact
give me a skew-symmetric matrix. However, my first attempt in SYMPY
did not produce a skew-symmetric matrix. So, I'm including the code
below and asking the group if there is a simple newbie user error I
may have performed causing the problem. Or, is this simply a
limitation of SYMPY?  By the way, TRIGSIMP() did not help...

snip
from sympy import *

t = Symbol('t')
a = Symbol('a')
b = Symbol('b')
g = Symbol('g')

rotX = Matrix([ [1,  0, 0],
[0,  cos(g(t)), sin(g(t))],
[0, -sin(g(t)), cos(g(t))] ])
rotY = Matrix([ [cos(b(t)),  0, -sin(b(t))],
[0,  1,  0],
[sin(b(t)), 0,   cos(b(t))] ])
rotZ = Matrix([ [cos(a(t)),  sin(a(t)),  0],
[-sin(a(t)),  cos(a(t)),  0],
[0,  0,  1] ])

R = rotX * rotY * rotZ
Rdot = R.diff(t)
skew = Rdot * R.T

print ''
print 'skew = '
print skew

# 'skew' should result in a skew-symmetic matrix.
# or, of the form,
#  [[ 0,   -w_z,   w_y ],
#   [ w_z,  0,-w_x],
#   [-w_y,  w_x,   0] ]
#
# where w = [w_x, w_y, w_z]^T
#
# looks like SYMPY fails to produce this results, yet, this same code
in
# Mathematica works as expected...
#
# is this a result of a newbie mistake? Or, a limitation of sympy?

print ''
print 'trigsimp(skew[0,0]) = '
print trigsimp(skew[0,0])
/snip

Thanks in advance!

-- 
You received this message because you are subscribed to the Google Groups 
sympy group.
To post to this group, send email to sympy@googlegroups.com.
To unsubscribe from this group, send email to 
sympy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sympy?hl=en.



Re: [sympy] Newbie question

2012-03-13 Thread Aaron Meurer
Unfortunately, this is a limitation in SymPy right now, which is that
our trigonometric simplification is not very good.

For now, you can use a work-around suggested in another thread:

def mytrigsimp(expr):
expr = expr.rewrite(exp)
expr = expr.expand()
expr = expr.rewrite(cos)
expr = expr.expand()
return expr

and do skew.applyfunc(mytrigsimp).  This works by rewriting the trig
functions in terms of complex exponentials, expanding, rewriting them
back as trig functions, and expanding again.  In your case, it
simplifies nicely:

In [32]: def mytrigsimp(expr):
   : expr = expr.rewrite(exp)
   : expr = expr.expand()
   : expr = expr.rewrite(cos)
   : expr = expr.expand()
   : return expr
   :

In [33]: print skew.applyfunc(mytrigsimp)
[
0, -sin(g(t))*Derivative(b(t), t) +
cos(b(t))*cos(g(t))*Derivative(a(t), t),
-sin(g(t))*cos(b(t))*Derivative(a(t), t) - cos(g(t))*Derivative(b(t),
t)]
[sin(g(t))*Derivative(b(t), t) - cos(b(t))*cos(g(t))*Derivative(a(t),
t),
0, -sin(b(t))*Derivative(a(t), t) +
Derivative(g(t), t)]
[sin(g(t))*cos(b(t))*Derivative(a(t), t) + cos(g(t))*Derivative(b(t),
t),  sin(b(t))*Derivative(a(t), t) -
Derivative(g(t), t),
 0]

Aaron Meurer

On Tue, Mar 13, 2012 at 8:13 PM, Southern.Cross hays@gmail.com wrote:
 Hello,

 I'm new to sympy so please excuse me if this question is obvious to
 the experienced.

 In multibody kinematics there is a classic relationship between a
 rotating body's angular velocity and the rotation matrices
 representing the configuration at a given point in time. Basically, if
 I am using a roll/pitch/yaw representation of the rotation then I have
 three rotation matrices that comprise the full instantaneous rotation,

 R =  rotx(gamma) * roty(beta) * rotz(alpha)

 Meaning, if I rotate the body by 'alpha' about a body fixed 'Z' axis,
 followed by a rotation 'beta' about the once rotated body fixed 'Y'
 axis, followed by a rotation 'gamma' about the twice rotated body
 fixed 'X' axis... I now have a complete instantaneous rotation matrix
 R.

 The relationship of the angular velocity of the body is,

 skew(w) = Rdot * R.transpose

 so, a new skew symmetric matrix is created from the matrix product
 between the time derivative of R and the transpose of R. (Since alpha,
 beta, and gamma are all functions of time then R is a function of
 time.)

 Completing the above described equations in Mathematica does in fact
 give me a skew-symmetric matrix. However, my first attempt in SYMPY
 did not produce a skew-symmetric matrix. So, I'm including the code
 below and asking the group if there is a simple newbie user error I
 may have performed causing the problem. Or, is this simply a
 limitation of SYMPY?  By the way, TRIGSIMP() did not help...

 snip
 from sympy import *

 t = Symbol('t')
 a = Symbol('a')
 b = Symbol('b')
 g = Symbol('g')

 rotX = Matrix([ [1,  0,         0],
                [0,  cos(g(t)), sin(g(t))],
                [0, -sin(g(t)), cos(g(t))] ])
 rotY = Matrix([ [cos(b(t)),  0,         -sin(b(t))],
                [0,          1,          0],
                [sin(b(t)), 0,           cos(b(t))] ])
 rotZ = Matrix([ [cos(a(t)),  sin(a(t)),  0],
                [-sin(a(t)),  cos(a(t)),  0],
                [0,          0,          1] ])

 R = rotX * rotY * rotZ
 Rdot = R.diff(t)
 skew = Rdot * R.T

 print ''
 print 'skew = '
 print skew

 # 'skew' should result in a skew-symmetic matrix.
 # or, of the form,
 #  [[ 0,   -w_z,   w_y ],
 #   [ w_z,  0,    -w_x],
 #   [-w_y,  w_x,   0] ]
 #
 # where w = [w_x, w_y, w_z]^T
 #
 # looks like SYMPY fails to produce this results, yet, this same code
 in
 # Mathematica works as expected...
 #
 # is this a result of a newbie mistake? Or, a limitation of sympy?

 print ''
 print 'trigsimp(skew[0,0]) = '
 print trigsimp(skew[0,0])
 /snip

 Thanks in advance!

 --
 You received this message because you are subscribed to the Google Groups 
 sympy group.
 To post to this group, send email to sympy@googlegroups.com.
 To unsubscribe from this group, send email to 
 sympy+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/sympy?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
sympy group.
To post to this group, send email to sympy@googlegroups.com.
To unsubscribe from this group, send email to 
sympy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sympy?hl=en.