[sympy] Re: Request for help GSOC Sympy

2018-02-22 Thread SAMPAD SAHA
Hi Suprotik,

I am glad that you are interested in working on Beam Solving System. You
can look into this Singularity Function

and
Beam

classes to start with. I think when I was working on this project I have
missed the implementation that solves cantilever beam problems. You can
start by adding that feature. You can also read my blog
 to understand the work that I have done
for this project.

I am adding Jason Moore in this thread who was my mentor. He is very
friendly and kind person. He can help you with the further ideas needed for
this project.

Happy Coding!!!



‌

Regards
Sampad Kumar Saha
Mathematics and Computing
Department of Mathematics
I.I.T. Kharagpur

On Thu, Feb 22, 2018 at 9:05 PM, Suprotik Dey  wrote:

> Hi Sampad,
>
> I am a 3rd year undergraduate from IIEST, Shibpur, and I am willing to
> participate in GSOC 2018 with SymPy as my organization.
>
> I am thinking about continuing your GSOC 2016 project on Continuum
> Mechanics: Create a Rich 2D Beam Solving System
> https://github.com/sympy/sympy/wiki/GSoC-2018-Ideas#
> continuum-mechanics-create-a-rich-2d-beam-solving-system
>
> I request your help in understanding the codebase and proceed further.
>
> --
> *Thanking you,*
> *Yours sincerely,*
>
> *Suprotik Dey*
> *Ph.: +918334826685*
> *Enrollment ID: 510815050*
> *I.T. Third Year*
> *IIEST, Shibpur*
> ‌
>  Sent with Mailtrack
> 
>

-- 
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/CANzav4Fk1MDWtQoi0QrV89JAkSiYG2W56gtiJw1_JxKukkMnUg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[sympy] Introducing myself to the SymPy Community

2018-02-22 Thread Monish Kapadia
Hello everyone,

My name is Monish Kapadia. I have done by Bachelor of Engineering in 
Electronics from Mumbai University. 

During my engineering course I have done many projects like Autonomous 
Surveillance Bot, Inertial Sensor Based Pen, etc. For these projects I had 
used Python as the programming language alongwith modules like numpy, 
OpenCV, SciPy, Dropbox, etc. and few algorithms to achieve the result.

Languages I'm familiar with are Python, WebDevelopment(HTML, CSS, 
JavaScript, Node.js, jQuery, MongoDB, SQL), C, Java. I have recently 
developed a website http://www.hiddenwonderz.com (Github source: 
https://github.com/monishk10/hiddenwonderz)

If given a chance I will definitely prove to be an apt addition to the 
community.

Thanks,
Monish

-- 
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/3c194978-0142-48ae-a27a-b707597d457d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[sympy] Re: Introducing myself and my interests

2018-02-22 Thread Anshil Gandhi
ok, thank you.

Regards,
Anshil

On Wednesday, February 21, 2018 at 12:56:46 AM UTC-7, Anshil Gandhi wrote:
>
> Hi everyone,
>
> My name is Anshil Gandhi and I am a first year student at the University 
> of Alberta, enrolled in B. Sc. Honours in Computing Science. I am fairly 
> experienced with programming and algorithm design. I began writing programs 
> when I was in grade 3 in a language called BASIC. I have created several 
> GUI applications through Microsoft Visual Basic including text editing 
> softwares and desktop widgets. Gradually, I developed a passion for 
> designing algorithms, particularly algorithms involved in puzzles and 
> games. Besides programming and algorithm design, I have also been involved 
> in competitive chess. Mathematics is certainly the subject I am most 
> interested in. I have participated in several math contests over the course 
> of my career as a student. Currently, I am enrolled in Honours Linear 
> Algebra 2 and Honours Calculus 2 (Integral Calculus and Series) for the 
> purpose of studying proofs written for many identities and theorems we use 
> today. I also frequently participate in programming and problem solving 
> contests. C++ and Python 3 are the programming languages I am most 
> comfortable with as I use them in most of my projects today.
>
> After going through a list of various project ideas, the topic I am most 
> interested in is improving the methods used to compute or expand series. In 
> particular, I would like to improve algorithms for computing power series. 
> I have recently been going over the Sympy tutorials to ensure my 
> proficiency with the library.
>
> Please do contact me if you are seeking a candidate to mentor in a related 
> project. Thank you.
>
> Sincerely,
> Anshil Gandhi
>

-- 
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/9216899d-a8cf-4358-bbe4-a9d39de83a80%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[sympy] Re: Order of terms in polynomial with symbolic coefficients?

2018-02-22 Thread Leonid Kovalev
In SymPy, polynomials have extra structure that distinguishes them from 
generic expressions. a3 * t**3 + a2 * t**2 + a1 * t + a0 is an expression. 
If you create a polynomial in t, it will print with the order of terms 
being from highest to lowest. 

>>> p = sp.Poly([a3, a2, a1, a0], t)
>>> print(p)
Poly(a3*t**3 + a2*t**2 + a1*t + a0, t, domain='ZZ[a0,a1,a2,a3]')



Also, the order can be specified in the print command

>>> pprint(a3 * t**3 + a2 * t**2 + a1 * t + a0, order='grevlex')
3   2
a₃⋅t  + a₂⋅t  + a₁⋅t + a₀


or, staying with str format,


>>> sstrrepr(a3 * t**3 + a2 * t**2 + a1 * t + a0, order='grevlex')
'a3*t**3 + a2*t**2 + a1*t + a0'


The printing module  has 
a number of printers which support a number of settings.  





On Thursday, February 22, 2018 at 2:02:20 PM UTC-5, Matthias Geier wrote:
>
> Dear SymPy list. 
>
> I'm playing around with polynomials in the context of spline curves. 
>
> I want to use a cubic polynomial with yet unknown coefficients like this: 
>
> >>> import sympy as sp 
> >>> t, a0, a1, a2, a3 = sp.symbols('t, a:4', real=True) 
> >>> a3 * t**3 + a2 * t**2 + a1 * t + a0 
> a0 + a1*t + a2*t**2 + a3*t**3 
>
> The problem here is that the displayed order of terms is reversed, 
> normally the highest power of t should come first. 
> I guess this is because SymPy doesn't know that the coefficients a0 
> etc. are constants and shouldn't be treated like variables. 
> So in fact this polynomial isn't sorted by powers of t but instead by 
> the coefficients. 
>
> Is there a way to get around this? 
>
> At some later point, I have expressions like this (without t): 
>
> a1 + 2*a2 + 3*a3 
>
> It would make sense in my case to also display them reversed like this: 
>
> 3*a3 + 2*a2 + a1 
>
> Is it possible to create a new type of symbol with non-default ordering? 
> Is it possible to define that this order is "ascending": a3, a2, a1, a0? 
> It doesn't have to be a generic solution, I'm OK with having those 4 
> special symbols. 
>
> Or is there an entirely different and much better way to do this? 
>
> I know that I could just use a, b, c, d instead of a3, a2, a1, a0 and 
> it would work, but I would really like to see the connection between a 
> coefficient and its power of t. 
>
> For the record, I also quickly tried to use IndexedBase to get a3, a2, 
> a1 and a0, and it turns out that although the LaTeX display of the 
> symbols looks the same (in text mode it's different), they are sorted 
> differently. 
>
> >>> b = sp.IndexedBase('b') 
> >>> b[3] * t**3 + b[2] * t**2 + b[1] * t + b[0] 
> t**3*b[3] + t**2*b[2] + t*b[1] + b[0] 
>
> They are sorted after the powers of t, which isn't what I want, either. 
>
> cheers, 
> Matthias 
>

-- 
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/3ed2faac-f7cf-412b-9392-ddb157935681%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[sympy] Re: plot of Piecewise function not working

2018-02-22 Thread Leonid Kovalev
The code in the original message works as is in the current development 
version of SymPy (which can be obtained by cloning from GitHub.) The issue 
was fixed by https://github.com/sympy/sympy/pull/13826 



On Friday, March 17, 2017 at 4:20:07 PM UTC-4, bonc...@udel.edu wrote:
>
> Plotting a Piecewise function fails.  I've pasted the markdown from my 
> ipython notebook:
>
> ```python
> from sympy import *
> init_session()
> ```
>
> IPython console for SymPy 1.0 (Python 3.6.0-64-bit) (ground types: 
> python)
> 
> These commands were executed:
> >>> from __future__ import division
> >>> from sympy import *
> >>> x, y, z, t = symbols('x y z t')
> >>> k, m, n = symbols('k m n', integer=True)
> >>> f, g, h = symbols('f g h', cls=Function)
> >>> init_printing()
> 
> Documentation can be found at http://docs.sympy.org/1.0/
>
> ```python
> f = Piecewise((0,x<0), (1,x<1), (0,True))
> print(f.subs(x,-0.5), f.subs(x,0.5), f.subs(x,1.5))
> plot(f,(x,-1,2))
> ```
>
> 0 1 0
>
>
>
> 
> ---
>
> TypeError Traceback (most recent call 
> last)
>
> 
> /Users/boncelet/anaconda/lib/python3.6/site-packages/sympy/plotting/experimental_lambdify.py
>  
> in __call__(self, args)
> 193 #The result can be sympy.Float. Hence wrap it with 
> complex type.
> --> 194 result = complex(self.lambda_func(args))
> 195 if abs(result.imag) > 1e-7 * abs(result):
>
>
> 
> /Users/boncelet/anaconda/lib/python3.6/site-packages/sympy/plotting/experimental_lambdify.py
>  
> in __call__(self, *args, **kwargs)
> 310 def __call__(self, *args, **kwargs):
> --> 311 return self.lambda_func(*args, **kwargs)
> 312 
>
>
>  in (x0)
>
>
> TypeError: '<' not supported between instances of 'complex' and 'int'
>
> 
> During handling of the above exception, another exception occurred:
>
>
> TypeError Traceback (most recent call 
> last)
>
>  in ()
>   1 f = Piecewise((0,x<0), (1,x<1), (0,True))
>   2 print(f.subs(x,-0.5), f.subs(x,0.5), f.subs(x,1.5))
> > 3 plot(f,(x,-1,2))
> 
>
> 
> /Users/boncelet/anaconda/lib/python3.6/site-packages/sympy/plotting/plot.py 
> in plot(*args, **kwargs)
>1282 plots = Plot(*series, **kwargs)
>1283 if show:
> -> 1284 plots.show()
>1285 return plots
>1286 
>
>
> 
> /Users/boncelet/anaconda/lib/python3.6/site-packages/sympy/plotting/plot.py 
> in show(self)
> 183 self._backend.close()
> 184 self._backend = self.backend(self)
> --> 185 self._backend.show()
> 186 
> 187 def save(self, path):
>
>
> 
> /Users/boncelet/anaconda/lib/python3.6/site-packages/sympy/plotting/plot.py 
> in show(self)
>1016 
>1017 def show(self):
> -> 1018 self.process_series()
>1019 #TODO after fixing 
> https://github.com/ipython/ipython/issues/1255
>1020 # you can uncomment the next line and remove the 
> pyplot.show() call
>
>
> 
> /Users/boncelet/anaconda/lib/python3.6/site-packages/sympy/plotting/plot.py 
> in process_series(self)
> 895 # Create the collections
> 896 if s.is_2Dline:
> --> 897 collection = 
> self.LineCollection(s.get_segments())
> 898 self.ax.add_collection(collection)
> 899 elif s.is_contour:
>
>
> 
> /Users/boncelet/anaconda/lib/python3.6/site-packages/sympy/plotting/plot.py 
> in get_segments(self)
> 501 list_segments.append([p, q])
> 502 
> --> 503 f_start = f(self.start)
> 504 f_end = f(self.end)
> 505 sample([self.start, f_start], [self.end, f_end], 0)
>
>
> 
> /Users/boncelet/anaconda/lib/python3.6/site-packages/sympy/plotting/experimental_lambdify.py
>  
> in __call__(self, args)
> 227 
> use_evalf=True,
> 228 
> complex_wrap_evalf=True)
> --> 229 result = self.lambda_func(args)
> 230 warnings.warn('The evaluation of the 
> expression is'
> 231 ' problematic. We are trying a 
> failback method'
>
>
> 
> /Users/boncelet/anaconda/lib/python3.6/site-packages/sympy/plotting/experimental_lambdify.py
>  
> in __call__(self, *args, **kwargs)
> 309 
> 310 def __call__(self, *args, **kwargs):
> --> 311 return self.lambda_func(*args, **kwargs)
> 312 
> 313 
>
>
>  in (x0)
>
>
> TypeError: '<' not supported between instances of 'complex' and 'int'
>
>
>
> 

[sympy] Re: plot of Piecewise function not working

2018-02-22 Thread Jia Guo
plot(f,(x,-1,2),adaptive=False, num_of_points=200)
 
this should work

On Friday, March 17, 2017 at 1:20:07 PM UTC-7, bonc...@udel.edu wrote:
>
> Plotting a Piecewise function fails.  I've pasted the markdown from my 
> ipython notebook:
>
> ```python
> from sympy import *
> init_session()
> ```
>
> IPython console for SymPy 1.0 (Python 3.6.0-64-bit) (ground types: 
> python)
> 
> These commands were executed:
> >>> from __future__ import division
> >>> from sympy import *
> >>> x, y, z, t = symbols('x y z t')
> >>> k, m, n = symbols('k m n', integer=True)
> >>> f, g, h = symbols('f g h', cls=Function)
> >>> init_printing()
> 
> Documentation can be found at http://docs.sympy.org/1.0/
>
> ```python
> f = Piecewise((0,x<0), (1,x<1), (0,True))
> print(f.subs(x,-0.5), f.subs(x,0.5), f.subs(x,1.5))
> plot(f,(x,-1,2))
> ```
>
> 0 1 0
>
>
>
> 
> ---
>
> TypeError Traceback (most recent call 
> last)
>
> 
> /Users/boncelet/anaconda/lib/python3.6/site-packages/sympy/plotting/experimental_lambdify.py
>  
> in __call__(self, args)
> 193 #The result can be sympy.Float. Hence wrap it with 
> complex type.
> --> 194 result = complex(self.lambda_func(args))
> 195 if abs(result.imag) > 1e-7 * abs(result):
>
>
> 
> /Users/boncelet/anaconda/lib/python3.6/site-packages/sympy/plotting/experimental_lambdify.py
>  
> in __call__(self, *args, **kwargs)
> 310 def __call__(self, *args, **kwargs):
> --> 311 return self.lambda_func(*args, **kwargs)
> 312 
>
>
>  in (x0)
>
>
> TypeError: '<' not supported between instances of 'complex' and 'int'
>
> 
> During handling of the above exception, another exception occurred:
>
>
> TypeError Traceback (most recent call 
> last)
>
>  in ()
>   1 f = Piecewise((0,x<0), (1,x<1), (0,True))
>   2 print(f.subs(x,-0.5), f.subs(x,0.5), f.subs(x,1.5))
> > 3 plot(f,(x,-1,2))
> 
>
> 
> /Users/boncelet/anaconda/lib/python3.6/site-packages/sympy/plotting/plot.py 
> in plot(*args, **kwargs)
>1282 plots = Plot(*series, **kwargs)
>1283 if show:
> -> 1284 plots.show()
>1285 return plots
>1286 
>
>
> 
> /Users/boncelet/anaconda/lib/python3.6/site-packages/sympy/plotting/plot.py 
> in show(self)
> 183 self._backend.close()
> 184 self._backend = self.backend(self)
> --> 185 self._backend.show()
> 186 
> 187 def save(self, path):
>
>
> 
> /Users/boncelet/anaconda/lib/python3.6/site-packages/sympy/plotting/plot.py 
> in show(self)
>1016 
>1017 def show(self):
> -> 1018 self.process_series()
>1019 #TODO after fixing 
> https://github.com/ipython/ipython/issues/1255
>1020 # you can uncomment the next line and remove the 
> pyplot.show() call
>
>
> 
> /Users/boncelet/anaconda/lib/python3.6/site-packages/sympy/plotting/plot.py 
> in process_series(self)
> 895 # Create the collections
> 896 if s.is_2Dline:
> --> 897 collection = 
> self.LineCollection(s.get_segments())
> 898 self.ax.add_collection(collection)
> 899 elif s.is_contour:
>
>
> 
> /Users/boncelet/anaconda/lib/python3.6/site-packages/sympy/plotting/plot.py 
> in get_segments(self)
> 501 list_segments.append([p, q])
> 502 
> --> 503 f_start = f(self.start)
> 504 f_end = f(self.end)
> 505 sample([self.start, f_start], [self.end, f_end], 0)
>
>
> 
> /Users/boncelet/anaconda/lib/python3.6/site-packages/sympy/plotting/experimental_lambdify.py
>  
> in __call__(self, args)
> 227 
> use_evalf=True,
> 228 
> complex_wrap_evalf=True)
> --> 229 result = self.lambda_func(args)
> 230 warnings.warn('The evaluation of the 
> expression is'
> 231 ' problematic. We are trying a 
> failback method'
>
>
> 
> /Users/boncelet/anaconda/lib/python3.6/site-packages/sympy/plotting/experimental_lambdify.py
>  
> in __call__(self, *args, **kwargs)
> 309 
> 310 def __call__(self, *args, **kwargs):
> --> 311 return self.lambda_func(*args, **kwargs)
> 312 
> 313 
>
>
>  in (x0)
>
>
> TypeError: '<' not supported between instances of 'complex' and 'int'
>
>
>
> ```python
>
> ```
>

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this 

[sympy] Order of terms in polynomial with symbolic coefficients?

2018-02-22 Thread Matthias Geier
Dear SymPy list.

I'm playing around with polynomials in the context of spline curves.

I want to use a cubic polynomial with yet unknown coefficients like this:

>>> import sympy as sp
>>> t, a0, a1, a2, a3 = sp.symbols('t, a:4', real=True)
>>> a3 * t**3 + a2 * t**2 + a1 * t + a0
a0 + a1*t + a2*t**2 + a3*t**3

The problem here is that the displayed order of terms is reversed,
normally the highest power of t should come first.
I guess this is because SymPy doesn't know that the coefficients a0
etc. are constants and shouldn't be treated like variables.
So in fact this polynomial isn't sorted by powers of t but instead by
the coefficients.

Is there a way to get around this?

At some later point, I have expressions like this (without t):

a1 + 2*a2 + 3*a3

It would make sense in my case to also display them reversed like this:

3*a3 + 2*a2 + a1

Is it possible to create a new type of symbol with non-default ordering?
Is it possible to define that this order is "ascending": a3, a2, a1, a0?
It doesn't have to be a generic solution, I'm OK with having those 4
special symbols.

Or is there an entirely different and much better way to do this?

I know that I could just use a, b, c, d instead of a3, a2, a1, a0 and
it would work, but I would really like to see the connection between a
coefficient and its power of t.

For the record, I also quickly tried to use IndexedBase to get a3, a2,
a1 and a0, and it turns out that although the LaTeX display of the
symbols looks the same (in text mode it's different), they are sorted
differently.

>>> b = sp.IndexedBase('b')
>>> b[3] * t**3 + b[2] * t**2 + b[1] * t + b[0]
t**3*b[3] + t**2*b[2] + t*b[1] + b[0]

They are sorted after the powers of t, which isn't what I want, either.

cheers,
Matthias

-- 
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/CAFesC-fMMxYqirZD1wmAX32Wsxz-NOQHiryCWp%2ByDDiUN6agng%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [sympy] GSOC 2018: Introduction and Topic willingness

2018-02-22 Thread Jason Moore
Suprotik,

Start here: https://github.com/sympy/sympy/wiki/introduction-to-contributing

After than you can try to solve beam problems with the current code. As you
try to solve harder problems you will find many deficiencies that can be
used in a proposal for GSoC.

Jason

moorepants.info
+01 530-601-9791

On Thu, Feb 22, 2018 at 8:39 AM, Suprotik Dey  wrote:

> Hi,
>
> I am Suprotik Dey, a Third Year undergraduate from Indian Institute of
> Engineering Science and Technology, Shibpur (IIEST).  I am currently
> pursuing a B. Tech in Information Technology.
> I wish to participate in GSOC 2018.
>
> I propose to work on the Title:* "Continuum Mechanics: Create a Rich 2D
> Beam Solving System"*
>
> I am relatively new to open source, but have experience in Git and python.
>
> Can you please propose anything on what I should begin with?
>
> Here is my Github repo:
> *https://github.com/sprtkd *
>
> 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/0b2b3041-f0e3-4f94-a052-89f569350d5a%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/CAP7f1AizDc%2BaZJRWz6bim7y%3Drie8T8XeBzaSEidnvgU5RcxzUA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[sympy] GSOC 2018: Introduction and Topic willingness

2018-02-22 Thread Suprotik Dey
Hi,

I am Suprotik Dey, a Third Year undergraduate from Indian Institute of 
Engineering Science and Technology, Shibpur (IIEST).  I am currently 
pursuing a B. Tech in Information Technology.
I wish to participate in GSOC 2018.

I propose to work on the Title:* "Continuum Mechanics: Create a Rich 2D 
Beam Solving System"*

I am relatively new to open source, but have experience in Git and python.

Can you please propose anything on what I should begin with?

Here is my Github repo:
*https://github.com/sprtkd*

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/0b2b3041-f0e3-4f94-a052-89f569350d5a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.