Re: [sympy] Pretty Printing in Docstrings

2016-08-15 Thread Aaron Meurer
The simplest way is to just call pprint manually.

Aaron Meurer

On Monday, August 15, 2016, SAMPAD SAHA  wrote:

> How to enable pretty printing in the docstrings?
>
> Regards
> Sampad Kumar Saha
> Mathematics and Computing
> I.I.T. Kharagpur
>
>
>
> --
> 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/CANzav4Gv4xQcf-8c3gZ7u7FEkJ2WBHziVmkfqxaxwUog
> kmshaQ%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/CAKgW%3D6%2BeXsMf5bDTBo-8mzUA%2B2eAa6sc6XB--t_wKuQy1XAjFQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[sympy] Pretty Printing in Docstrings

2016-08-15 Thread SAMPAD SAHA
How to enable pretty printing in the docstrings?

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

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


[sympy] StackOverflow Documentation

2016-08-15 Thread Aaron Meurer
The SymPy tag is open for documentation on the StackOverflow
Documentation beta https://stackoverflow.com/documentation/sympy

Might be worth checking out. StackOverflow Documentation looks like it
could be an interesting platform for helping people with SymPy.

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 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/CAKgW%3D6%2Bnd2uaZjumf1aqqHSfZpDG%3D2Ww5Lqzt1j29ipRzDiafQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [sympy] Planet SymPy updates refactoring

2016-08-15 Thread Ondřej Čertík
On Mon, Aug 15, 2016 at 2:30 PM, Aaron Meurer  wrote:
> Would it be difficult to make it so that the upload script also posts
> to Twitter when there is a new post? Right now
> https://twitter.com/planetsympy is using twitterfeed.com, but it's not
> the greatest. There is an update delay, and the post title doesn't
> have the author of the post (see
> https://github.com/sympy/planet-sympy/issues/36).

Here is where the current state (that's online at planet sympy) is checked out:

https://github.com/sympy/planet-sympy/blob/36d2a8ef40b182889998561e5a68865604b3320e/update.sh#L27

and you can see that we remove what's in there, and put there the new
data. So instead, one can save the list of posts in some kind of a
json, or some other format, and then erase everything except this
file, which would be renamed. Then the new planet sympy is generated,
and then you just have to compare these two files (the old json and
the new json) and see what new posts are there.

Then you post to twitter. You just pass in the TWITTER_TOKEN as a
docker variable,
https://gitlab.com/certik/planet-sympy-updater/blob/b63ac0305e252e20676458777f88d0fc8ac73de4/.gitlab-ci.yml#L9,
and define it as a private variable on gitlab (which I have to do
myself).

I don't have time to implement this myself, but that's how it would be
done. Anyone can just send a pull request.

Ondrej

>
> Aaron Meurer
>
> On Mon, Aug 15, 2016 at 3:58 PM, Ondřej Čertík  
> wrote:
>> Hi,
>>
>> I have refactored how planet.sympy.org is updated using these PR and
>> repositories:
>>
>> https://github.com/sympy/planet-sympy/pull/46
>> https://github.com/sympy/planet-sympy/pull/47
>> https://gitlab.com/certik/planet-sympy-updater
>>
>> It's described in the README's how it works, but roughly, the
>> https://github.com/sympy/planet-sympy repo creates a docker image on
>> docker hub, and the https://gitlab.com/certik/planet-sympy-updater
>> then uses GitLab-CI to pull this docker image and run it. This CI job
>> is then triggered every 20 minutes by a cron job installed at
>> https://www.easycron.com. Everything is public, e.g. you can watch all
>> the updates here:
>>
>> https://gitlab.com/certik/planet-sympy-updater/pipelines
>>
>> You can click on it, see the log, and so on. If something breaks, you
>> can see it there, and you can submit PRs to fix it. The only thing
>> that is currently not visible online is the actual cron job, but that
>> is just a very simple webhook of the form:
>>
>> curl -X POST \
>>  -F token=TOKEN \
>>  -F ref=REF_NAME \
>>  https://gitlab.com/api/v3/projects/1525395/trigger/builds
>>
>> that is executed every 20 minutes by the https://www.easycron.com
>> website. If that fails, you will notice that the CI jobs are not being
>> triggered every 20 minutes at:
>> https://gitlab.com/certik/planet-sympy-updater/pipelines, so that's
>> easy to spot/maintain.
>>
>> Ondrej
>>
>> --
>> 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/CADDwiVAH_nwOE-Ye%2BUGxHgJ42oSQp1WWC6J7LZbga6QegAAFgQ%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/CAKgW%3D6JeKeLmuoz17Ws7Pt3OY4wwrytWSvFL9VEsedXks3HtQA%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/CADDwiVBqoeDKsFjOFeWqQ-AwCd1PU3Ok9Jc4urD9r6DfR%3Dwj4A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [sympy] Planet SymPy updates refactoring

2016-08-15 Thread Aaron Meurer
Would it be difficult to make it so that the upload script also posts
to Twitter when there is a new post? Right now
https://twitter.com/planetsympy is using twitterfeed.com, but it's not
the greatest. There is an update delay, and the post title doesn't
have the author of the post (see
https://github.com/sympy/planet-sympy/issues/36).

Aaron Meurer

On Mon, Aug 15, 2016 at 3:58 PM, Ondřej Čertík  wrote:
> Hi,
>
> I have refactored how planet.sympy.org is updated using these PR and
> repositories:
>
> https://github.com/sympy/planet-sympy/pull/46
> https://github.com/sympy/planet-sympy/pull/47
> https://gitlab.com/certik/planet-sympy-updater
>
> It's described in the README's how it works, but roughly, the
> https://github.com/sympy/planet-sympy repo creates a docker image on
> docker hub, and the https://gitlab.com/certik/planet-sympy-updater
> then uses GitLab-CI to pull this docker image and run it. This CI job
> is then triggered every 20 minutes by a cron job installed at
> https://www.easycron.com. Everything is public, e.g. you can watch all
> the updates here:
>
> https://gitlab.com/certik/planet-sympy-updater/pipelines
>
> You can click on it, see the log, and so on. If something breaks, you
> can see it there, and you can submit PRs to fix it. The only thing
> that is currently not visible online is the actual cron job, but that
> is just a very simple webhook of the form:
>
> curl -X POST \
>  -F token=TOKEN \
>  -F ref=REF_NAME \
>  https://gitlab.com/api/v3/projects/1525395/trigger/builds
>
> that is executed every 20 minutes by the https://www.easycron.com
> website. If that fails, you will notice that the CI jobs are not being
> triggered every 20 minutes at:
> https://gitlab.com/certik/planet-sympy-updater/pipelines, so that's
> easy to spot/maintain.
>
> Ondrej
>
> --
> 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/CADDwiVAH_nwOE-Ye%2BUGxHgJ42oSQp1WWC6J7LZbga6QegAAFgQ%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/CAKgW%3D6JeKeLmuoz17Ws7Pt3OY4wwrytWSvFL9VEsedXks3HtQA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[sympy] Planet SymPy updates refactoring

2016-08-15 Thread Ondřej Čertík
Hi,

I have refactored how planet.sympy.org is updated using these PR and
repositories:

https://github.com/sympy/planet-sympy/pull/46
https://github.com/sympy/planet-sympy/pull/47
https://gitlab.com/certik/planet-sympy-updater

It's described in the README's how it works, but roughly, the
https://github.com/sympy/planet-sympy repo creates a docker image on
docker hub, and the https://gitlab.com/certik/planet-sympy-updater
then uses GitLab-CI to pull this docker image and run it. This CI job
is then triggered every 20 minutes by a cron job installed at
https://www.easycron.com. Everything is public, e.g. you can watch all
the updates here:

https://gitlab.com/certik/planet-sympy-updater/pipelines

You can click on it, see the log, and so on. If something breaks, you
can see it there, and you can submit PRs to fix it. The only thing
that is currently not visible online is the actual cron job, but that
is just a very simple webhook of the form:

curl -X POST \
 -F token=TOKEN \
 -F ref=REF_NAME \
 https://gitlab.com/api/v3/projects/1525395/trigger/builds

that is executed every 20 minutes by the https://www.easycron.com
website. If that fails, you will notice that the CI jobs are not being
triggered every 20 minutes at:
https://gitlab.com/certik/planet-sympy-updater/pipelines, so that's
easy to spot/maintain.

Ondrej

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


Re: [sympy] Re: Left hand limits and Right hand limits

2016-08-15 Thread Aaron Meurer
There is a special toolkit, sympy.physics.mechanics (and for beam bending
specifically, the new sympy.physics.continuum_mechanics).

This trick seems mostly harmless, since SymPy treats DiracDelta outside of
integration symbolically (i.e., DiracDelta(x) = 0 if x != 0 and oo if x =
0). As I noted before, by that symbolic definition (a function that is 0
except at a single point), the limit is 0, so things work out. The problem
with treating something like DiracDelta like a normal expression is that
you can't just put it anywhere in an expression and expect it to make sense
(what is sin(DiracDelta(x))?). But for a specialised mechanics toolkit, it
is only going to create expressions that make physical sense (and hence,
mathematical sense with the "shaky" definitions).

Aaron Meurer

On Sun, Aug 14, 2016 at 9:58 AM, Richard Fateman  wrote:

> I am not familiar with this trick, but just because engineers
> in some area hack together some method that is mathematically
> dubious, doesn't mean it should be introduced as a default in sympy.
> (Maybe it should, maybe it is harmless?)   An example that
> also involves context that sympy would not know about is
> how to deal with certain expressions involving infinity.  E.g.
> is 0*oo  equal to 0  or "indeterminate" ?  what about oo  = oo ?
>
> One way of looking at this may be to build some "mechanics"
> toolkit with such tricks.
>
> RJF
>
>
> On Sunday, August 14, 2016 at 3:12:29 AM UTC-7, SAMPAD SAHA wrote:
>>
>>
>> In Mechanics, while solving beam bending problems, we need to find out
>> the reaction force at first. There is a trick I have learned from Jason.
>> Suppose there is beam of length l, then we at first find the load
>> distribution using variables multiplied by dirac deltas in place of
>> reaction forces. After finding shear force curve and bending moment curve
>> in terms of those variables, we equates them to 0 for x = l+
>>
>> Now for tthis case we have to use the limit.
>>
>> Regards
>> Sampad Kumar Saha
>> Mathematics and Computing
>> I.I.T. Kharagpur
>>
>> On Sun, Aug 14, 2016 at 12:27 PM, Aaron Meurer  wrote:
>>
>>> I agree that DiracDelta doesn't make sense except under an integral
>>> sign. But as a function that is 0 everywhere except for one point, in a
>>> limit, it can be replaced with 0, which is what SymPy's limit() appears to
>>> be doing.  I am curious how you are ending up with an expression with a
>>> DiracDelta that you need to take a limit of, though.
>>>
>>> Aaron Meurer
>>>
>>> On Sat, Aug 13, 2016 at 8:34 PM, Richard Fateman 
>>> wrote:
>>>
 Since DiracDelta is a distribution, not a function, and presumably the
 limit program is oriented toward finding limits of analytic functions,
 it would be fairly reasonable for the limit program to not work on
 this kind of expression.  The mathematical context in which DiracDelta
 is
 understood and useful is under an integral sign.

 I have not tried sympy on this example, but it seems to me
 that expecting sympy to answer a poorly formulated question
 "correctly"  is not going to reveal a bug in the program.  It
 is "user error".

 RJF


 On Saturday, August 13, 2016 at 5:25:22 AM UTC-7, SAMPAD SAHA wrote:
>
> Suppose I want to find the value of f(x) for
> f(x) = DiracDelta(x - 30) + Heaviside(x) at x = 30+ in sympy. How can
> we do this?
>
> Regards
> Sampad Kumar Saha
> Mathematics and Computing
> I.I.T. Kharagpur
>
>
>
>
>>> --
>>> 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 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/ms
>>> gid/sympy/CAKgW%3D6JAO7i1f-X6uw-WiiztsV%3DXh2Tt74crv3ULhFKr1
>>> oz2Bg%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/1ca3f3e9-4f9b-4cea-bdcb-5d62f3e8ee44%40googlegroups.com
> 
> .
>
> For more options, visit 

Re: [sympy] Re: 3D pendulum and equations of motion of multi-body systems (KanesMethod)

2016-08-15 Thread Jason Moore
Nuno,

You can only select one set of independent generalized coordinates for
things to work out. You seem to be setting two sets, both the cartesian and
the angular coordinates. You may need to refer to a dynamics text to see
how to go about selecting generalized coordinates.




Jason
moorepants.info
+01 530-601-9791

On Thu, Aug 11, 2016 at 4:30 AM, Nuno  wrote:

> Right now I'm trying to get the equations of motion of a 3D pendulum
> system (spherical pendulum) and I want to describe the system using the
> (x,y,z) coordinates of the mass as well as its attitude (phi, theta, psi),
>
>
>
> 
>
>
> In the jupyter notebook (https://nbviewer.jupyter.org/
> github/ndevelop/sympy_3D_pendulum/blob/master/3D%20pendulum.ipynb) I have
> added 3 reference frames (Inertial, one for the anchor point and other to
> the mass).
>
> The anchor frame is not really necessary since its the same as the
> inertial frame for this problem, however futher down the line I want to
> test the system with a mobile anchor point (imagine it as a balloon with a
> lift force applied in the anchor center of mass).
>
>
> The mass frame is centered on the "Mass" center of mass (this nomenclature
> is not the best) and it's orientation in relation to the inertial frame is
> composed by 3 euler angles.
>
>
> Now the twist in the problem is that the mass is "actuated". Besides the
> gravity force acting on its center of mass (along the inertial frame
> z-axis), there is also a force F applied on the positive direction of
> x-axis of the mass reference frame and a torque T about the z-axis of the
> mass reference frame.
>
>
> Furthermore, I want to "model" the cable connecting the mass to the anchor
> point, by using a distance constraint:  (r_anchor - r_mass) - cable_length
> = 0
>
>
> The goal is to obtain the equations of motion for this system.
>
> I have set everything as described in this jupyter notebook
> ,
> however I'm not sure if the way I'm doing things is correct, since the
> resulting equations of motion seem to be really large for such a simple
> problem. Then again, I'm not experienced with this kind of problems.
>
>
> Thanks in advance for all the help,
>
> Nuno
>
>
>
>
>
> --
> 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/41580794-f61d-4106-9425-d2552d71424a%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/CAP7f1Ag8qXp5Z16nkh68MzeTFdEZVB9R7A9pX5d1LE8y%2BwBnwA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[sympy] Trying to solve simple equation results in - TypeError: 'Complement' object is not iterable

2016-08-15 Thread Vassili Leonov
I'm getting this error with 
>>> sympy.release.__version__
'1.0'

>>> import sympy
>>> v,b = sympy.symbols('v b')
>>>* sympy.solveset(v/sympy.sqrt(-v**2 + 1) - b, v)*
Traceback (most recent call last):
  File "", line 1, in 
  File 
"/base/data/home/apps/s~sympy-live-hrd/46.393464279709602171/sympy/sympy/solvers/solveset.py",
 
line 791, in solveset
return _solveset(f, symbol, domain, _check=True)
  File 
"/base/data/home/apps/s~sympy-live-hrd/46.393464279709602171/sympy/sympy/solvers/solveset.py",
 
line 612, in _solveset
solver)
  File 
"/base/data/home/apps/s~sympy-live-hrd/46.393464279709602171/sympy/sympy/solvers/solveset.py",
 
line 507, in _solve_radical
return FiniteSet(*[s for s in result if checksol(f, symbol, s) is True])
TypeError: 'Complement' object is not iterable

Same on my two different installations, same on http://live.sympy.org/

*But it solves it fine after trivial transformation*:

>>>* sympy.solveset(v**2/(-v**2 + 1) - b**2, v)*
{-b*sqrt(1/(b**2 + 1)), b*sqrt(1/(b**2 + 1))} \ {-1, 1}

*Is this the expected behaviour?*
What does the error  "'Complement' object is not iterable" means? Google 
not saying anything at all on this particular error message.

Thank you for your time and consideration.

-- 
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/be896804-ed5d-41dc-99ea-6695a07b912d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.