MuPAD
The default order of a power series is 6. This can be changed either by changing the value of ORDER (analogous to DIGITS above), or by including the order in the series command. This last inclusion is optional.
>> tx:=series(tan(x),x,12);
3 5 7 9 11
x 2 x 17 x 62 x 1382 x 12
x + -- + ---- + ----- + ----- + -------- + O(x )
3 15 315 2835 155925
>> cx:=series(cos(x),x,12);
2 4 6 8 10
x x x x x 12
1 - -- + -- - --- + ----- - ------- + O(x )
2 24 720 40320 3628800
>> tx*cx;
3 5 7 9 11
x x x x x 12
x - -- + --- - ---- + ------ - -------- + O(x )
6 120 5040 362880 39916800
This certainly looks like the series for sin(x), but let's see if MuPAD recognizes it as such.
>> sx:=series(sin(x),x,12):
>> is(tx*cx=sx);
TRUE
>> type(tx*cx);
Puiseux
This means that the result of the series product is recognized by
MuPAD as an object of type “Puiseux”; that is, a series possibly
containing fractional powers.
MuPAD can also deal with polynomials.
>> p1:=x^8-3*x^5+11*x^4-x^2+17;
4 2 5 8
11 x - x - 3 x + x + 17
>> p2:=x^3-23*x^2-4*x+11;
3 2
x - 4 x - 23 x + 11
>> divide(p1,p2);
2 3 4 5
285641 x + 12337 x + 533 x + 23 x + x + 6613228,
2
23310861 x + 153111100 x - 72745491
The result of the last command consists of two terms: the quotient, and the remainder. MuPAD also has commands for extracting coefficients from polynomials, evaluating polynomials using Horner's algorithm, and lots more.
We shall first create a matrix domain:
>> M:=Dom::Matrix();
Dom::Matrix(Dom::ExpressionField(id, iszero))
The result returned here indicates that MuPAD expects that the elements of matrices will be members of a field for which no normalization is performed (the function id just returns elements as given), and for which 0 is recognized as the zero value.
Now we shall make all the commands in the library linalg available to us:
>> export(linalg);
Now we shall create a few matrices and play with them. First, a matrix with given elements.
>> A:=M([[1,2,3],[-1,3,-2],[4,-5,2]]);
+- -+
| 1, 2, 3 |
| |
| -1, 3, -2 |
| |
| 4, -5, 2 |
+- -+
We have entered the matrix elements as a list of lists (a list, in
MuPAD, is delimited by square brackets).
Next, a matrix with elements randomly chosen to be between -9 and 9. We do this by applying the function returned by random to each of the elements.
>> B:=M(3,3,func(random(-9..9)(),i,j));
+- -+
| -7, -5, 8 |
| |
| 3, -1, 7 |
| |
| 3, -5, 6 |
+- -+
Clearly this approach can be used to generate any matrix whose elements are functions of their row and column values. There is a randomMatrix command in the linalg library, but it requires the elements to be members of a coefficient ring. For our purposes, it is as easy to roll our own.
>> A*B;
+- -+
| 8, -22, 40 |
| |
| 10, 12, 1 |
| |
| -37, -25, 9 |
+- -+
>> det(A);
-37
>> 1/A;
+- -+
| 4/37, 19/37, 13/37 |
| |
| 6/37, 10/37, 1/37 |
| |
| 7/37, -13/37, -5/37 |
+- -+
As we have seen above, MuPAD supports operator overloading, which
means that since A is a matrix,
1/A is interpreted as the inverse of
A.
>> A^10;
+- -+
| 19897010, -20429930, 22281963 |
| |
| -42711893, 43857348, -47862790 |
| |
| 64993856, -66730117, 72852811 |
+- -+
>> b:=M(3,1,[7,9,-21]);
+- -+
| 7 |
| |
| 9 |
| |
| -21 |
+- -+
Here the first two (optional) values give the number of rows and
columns of the matrix, the matrix elements are then given in a
single list. If the list isn't long enough, the remaining values
will default to zero.
>> linearSolve(A,b);
+- -+
| -2 |
| |
| 3 |
| |
| 1 |
+- -+
>> AM:=A.b;
+- -+
| 1, 2, 3, 7 |
| |
| -1, 3, -2, 9 |
| |
| 4, -5, 2, -21 |
+- -+
The . operator is concatenation. Again, this is an overloaded
operator, as it will work for other data types as well.
>> gaussJordan(AM);
+- -+
| 1, 0, 0, -2 |
| |
| 0, 1, 0, 3 |
| |
| 0, 0, 1, 1 |
+- -+
The linalg library is very full-featured, and
contains plenty of commands for operating on matrices and vectors:
row and column operations; matrix factorization and decomposition;
commands for dealing with matrix polynomials and eigensystems; and
so on.
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Sponsored by AMD
Built-in forensics, incident response, and security with Red Hat Enterprise Linux 6
Every security policy provides guidance and requirements for ensuring adequate protection of information and data, as well as high-level technical and administrative security requirements for a system in a given environment. Traditionally, providing security for a system focuses on the confidentiality of the information on it. However, protecting the data integrity and system and data availability is just as important. For example, when processing United States intelligence information, there are three attributes that require protection: confidentiality, integrity, and availability.
Learn more about catching the bad guy in this free white paper.
Sponsored by DLT Solutions
| Designing Electronics with Linux | May 22, 2013 |
| Dynamic DNS—an Object Lesson in Problem Solving | May 21, 2013 |
| Using Salt Stack and Vagrant for Drupal Development | May 20, 2013 |
| Making Linux and Android Get Along (It's Not as Hard as It Sounds) | May 16, 2013 |
| Drupal Is a Framework: Why Everyone Needs to Understand This | May 15, 2013 |
| Home, My Backup Data Center | May 13, 2013 |
- New Products
- Linux Systems Administrator
- Senior Perl Developer
- Technical Support Rep
- UX Designer
- Web & UI Developer (JavaScript & j Query)
- Designing Electronics with Linux
- Dynamic DNS—an Object Lesson in Problem Solving
- Using Salt Stack and Vagrant for Drupal Development
- Making Linux and Android Get Along (It's Not as Hard as It Sounds)
- Reply to comment | Linux Journal
4 hours 49 min ago - Reply to comment | Linux Journal
5 hours 5 min ago - Favorite (and easily brute-forced) pw's
6 hours 57 min ago - Have you tried Boxen? It's a
12 hours 49 min ago - seo services in india
17 hours 20 min ago - For KDE install kio-mtp
17 hours 21 min ago - Evernote is much more...
19 hours 21 min ago - Reply to comment | Linux Journal
1 day 4 hours ago - Dynamic DNS
1 day 4 hours ago - Reply to comment | Linux Journal
1 day 5 hours ago
Enter to Win an Adafruit Pi Cobbler Breakout Kit for Raspberry Pi

It's Raspberry Pi month at Linux Journal. Each week in May, Adafruit will be giving away a Pi-related prize to a lucky, randomly drawn LJ reader. Winners will be announced weekly.
Fill out the fields below to enter to win this week's prize-- a Pi Cobbler Breakout Kit for Raspberry Pi.
Congratulations to our winners so far:
- 5-8-13, Pi Starter Pack: Jack Davis
- 5-15-13, Pi Model B 512MB RAM: Patrick Dunn
- 5-21-13, Prototyping Pi Plate Kit: Philip Kirby
- Next winner announced on 5-27-13!
Featured Jobs
| Linux Systems Administrator | Houston and Austin, Texas | Host Gator |
| Senior Perl Developer | Austin, Texas | Host Gator |
| Technical Support Rep | Houston and Austin, Texas | Host Gator |
| UX Designer | Austin, Texas | Host Gator |
| Web & UI Developer (JavaScript & j Query) | Austin, Texas | Host Gator |
Free Webinar: Hadoop
How to Build an Optimal Hadoop Cluster to Store and Maintain Unlimited Amounts of Data Using Microservers
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Some of key questions to be discussed are:
- What is the “typical” Hadoop cluster and what should be installed on the different machine types?
- Why should you consider the typical workload patterns when making your hardware decisions?
- Are all microservers created equal for Hadoop deployments?
- How do I plan for expansion if I require more compute, memory, storage or networking?




Comments
Sellout
Mupad has been bought out by mathworks and all code is now under matlab (junk) licence.
any and all open source work is now dead.
Thankyou for a well written a
Thankyou for a well written article. TeXmacs acts as an excellent interface to mupad. I assume that the TeXmacs screen display generated by TeX. The graphics is generated by javaview. The combination of TeXmacs and javaview greatly enhance the mupad experience.