Skip to main content
13-Aquamarine
April 27, 2015
Question

Anybody Try Mupad?

  • April 27, 2015
  • 14 replies
  • 6131 views

Hi Folks,

I just had a visit from a Senior Technical Evangelist (that's really his title) from Mathworks. He suggested that I try Mupad, a symbolic math program that sits on top of the Matlab Symbolics Toolbox. Has anyone else tried it?

It's still a command line kind of interface, but friendlier than the '>>' familiar to Matlab users. I have used Matlab since the early 90s and mostly like it - very handy for big number crunching tasks.

To run it, all I had to do was type in 'mupad' from the command line. I think it requires the Symbolics Toolbox, though.

14 replies

19-Tanzanite
April 27, 2015

Mathcad uses MuPad as the symbolic engine.

It doesn't really sit on top of the symbolic toolbox. It IS the symbolic toolbox.

23-Emerald V
April 28, 2015

As Richard says, the Symbolic Toolbox is effectively MuPad. I've only used it a couple of times, and I can't say that I find it any "friendlier" than the normal Matlab interface when used with its toolbox interface (ie, as an App) ... just different, although I do like the "standard" math notation for the results.

You don't need to type mupad in to use it, though ... or, at least, not in my version ... you can simply use the sym commands, eg:

>> A=hilb(3)

A =

1.0000 0.5000 0.3333

0.5000 0.3333 0.2500

0.3333 0.2500 0.2000

>> sym(A)

ans =

[ 1, 1/2, 1/3]

[ 1/2, 1/3, 1/4]

[ 1/3, 1/4, 1/5]

>> phi=sym('(1+sqrt(5))/2');

>> simplify(phi)

ans =

5^(1/2)/2 + 1/2

>> eval(phi)

ans =

1.6180

>> phi2=(1+sqrt(5))/2

phi2 =

1.6180

>> sym(phi2)

ans =

910872158600853/562949953421312

There are, however, some MuPad features that will only run in the Notebook interface (eg, contfrac).

Overall, I still prefer the look and feel of a Mathcad worksheet, although I think the integration of the symbolic commands could be improved ... I've often wanted to construct a procedure that contains the symbolic commands as an integral part of its construction, rather than have them be only available through the separate symbolic evaluation operator; eg, I'd like to write:

f(x):=| sexpr<-asin(x) series,x,10

| fexpr<-sexpr confrac,10

| fexpr

or

f(x):=| sexpr<-series(asin(x). x,10)

| fexpr<-confrac(sexpr,10)

| fexpr

and then symbolically evaluate the function to allow its use by the numerical processor.

Stuart

PS. Mathcad's symbolic processor is a cut-down version of MuPad.

23-Emerald IV
April 29, 2015

What's wrong with:

confrac.png

other than that the definition needs to be on a single line?

Luc

23-Emerald V
April 29, 2015

LucMeekes wrote:

What's wrong with:

...

other than that the definition needs to be on a single line?

It's that "other" bit that's in part what's wrong with it, Luc. I only gave a short example (because I'm lazy) but if I want to put several more symbolic operations in the sequence, then the resulting expression simply gets too long to see on a single page and/or becomes difficult to read.

In addition (and this is the other main part of what's wrong with it), I might want to do a symbolic operation then a standard operation then another symbolic operation and so on (as I can in Maple). In the above example, I might want to write a local function f that takes n as the argument for series and another one g that takes m as the argument for the confrac, and then run a loop that determines what value of m in g(m) equals f(n). Or I might want to sum a symbolically derived vector, etc.

Stuart