Steps invoived in the calculation

64 views
Skip to first unread message

jiju

unread,
Apr 23, 2014, 3:30:27 PM4/23/14
to sy...@googlegroups.com
Hi,

Is there any way to obtain all the steps involved in the mathematical calculations from sympy?

Thanks,
Jiju

Amit Saha

unread,
Apr 23, 2014, 5:50:35 PM4/23/14
to sy...@googlegroups.com
On Thu, Apr 24, 2014 at 5:30 AM, jiju <jijutd...@gmail.com> wrote:
> Hi,
>
> Is there any way to obtain all the steps involved in the mathematical
> calculations from sympy?

I think what you mean is that you want to see what is happening behind
the scenes when you use a SymPy function or method? I would think if
you follow the standard procedure for any other Python
program/software/package, that would work here. Here is a rough
overview:

1. Find the source line for your function/method
2. Insert pdb.set_trace() there (after import pdb)
3. Run your "usual" program which makes use of that function/method
4. Your program will hit the pdb.set_trace() line, and you will get
the (pdb) prompt.
5. Now, you can choose to step through each line that Python is executing

You may find some of the pdb links here helpful:
http://stackoverflow.com/questions/4228637/getting-started-with-the-python-debugger-pdb

You may also find
http://docs.sympy.org/latest/modules/utilities/source.html useful.

Hope that helps.

Aaron Meurer

unread,
Apr 23, 2014, 8:00:51 PM4/23/14
to sy...@googlegroups.com
It depends on what calculation you are interested in. Some algorithms
in SymPy work quite differently than you would do things by hand.

For differentiation and integration, take a look at the step-by-step
stuff you get from SymPy Gamma http://gamma.sympy.org/.

Aaron Meurer
> --
> You received this message because you are subscribed to the Google Groups "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sympy+un...@googlegroups.com.
> To post to this group, send email to sy...@googlegroups.com.
> Visit this group at http://groups.google.com/group/sympy.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/CANODV3%3DxVpJWouYT2%3DGXpRGbFwESxbTf-5BcmYEoMuE6O-%2BbSQ%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.

jiju

unread,
Apr 26, 2014, 1:01:54 PM4/26/14
to sy...@googlegroups.com
Thanks Amit and Aaron for the help provided.

Amit Saha

unread,
Apr 26, 2014, 11:36:53 PM4/26/14
to sy...@googlegroups.com
On Sun, Apr 27, 2014 at 3:01 AM, jiju <jijutd...@gmail.com> wrote:
> Thanks Amit and Aaron for the help provided.

You may find this useful as well:
http://docs.sympy.org/latest/guide.html#ondrej-s-approach




--
http://echorand.me
Reply all
Reply to author
Forward
0 new messages