Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to view source code of functions in Mathematica?

659 views
Skip to first unread message

Budaoy

unread,
Jul 2, 2007, 7:19:14 AM7/2/07
to
How to view source code of functions in Mathematica? For example, I
want to view source code of DSolve command which is used to solve a
differential equation, how can I achieve this? Or all the command
Mathematica provides are build-in functions? In some other scientific
softwares I can do this easily.

Thanks for your reply.


Jean-Marc Gulliet

unread,
Jul 3, 2007, 5:43:17 AM7/3/07
to

The short answer is that you cannot. Every kernel functions (that is
functions for which you do not need to load a package before using them)
are written and compiled in a custom version of C and the source code is
not provided by Wolfram Research, Inc. (WRI is a commercial company
which owns the intellectual property of Mathematica, and thereof can
freely decide whatever license scheme it deems suitable for its business.)

On the other hand, functions that are written in the Mathematica
programming language are provided in the form of packages. Packages are
regular text files that, provided they are not encrypted, you can edit
with any text editor and see the whole Mathematica source code for
theses functions.If the package is encrypted, well, you cannot see the
source code in clear.

Now if you want to see what is inside of some package you could have a
look at, say,

C:\Program Files\Wolfram
Research\Mathematica\6.0\AddOns\Packages\FourierSeries\FourierSeries.m

(or whatever is suitable to your installation of Mathematica).

Regards,
Jean-Marc

Murray Eisenberg

unread,
Jul 3, 2007, 5:57:44 AM7/3/07
to
Step 1: Accumulate a VERY large amount of money.

Step 2: Convince Stephen Wolfram to sell Wolfram Research to you.

More seriously: even if you saw the source code for DSolve, it would
probably be so large as to be of marginal use.

Budaoy wrote:
> How to view source code of functions in Mathematica? For example, I
> want to view source code of DSolve command which is used to solve a
> differential equation, how can I achieve this? Or all the command
> Mathematica provides are build-in functions? In some other scientific
> softwares I can do this easily.

--
Murray Eisenberg mur...@math.umass.edu
Mathematics & Statistics Dept.
Lederle Graduate Research Tower phone 413 549-1020 (H)
University of Massachusetts 413 545-2859 (W)
710 North Pleasant Street fax 413 545-1801
Amherst, MA 01003-9305

0 new messages