Difference between revisions of "Maple"

From PrattWiki
Jump to navigation Jump to search
(33 intermediate revisions by the same user not shown)
Line 2: Line 2:
 
name=Maple|
 
name=Maple|
 
byline="Harnessing the Power of Mathematics"|  
 
byline="Harnessing the Power of Mathematics"|  
image=|
+
image=[[File:Maplesoft Maple-11 x2-plus-y2 3D plot.png|200 px]]|
 
caption=|  
 
caption=|  
version=12|
+
version=2016<br>17 on Unix|
dlocation=[http://www.oit.duke.edu/site/software/maple.html OIT]|  
+
dlocation=[https://software.duke.edu/node/122 Faculty]<br>https://software.duke.edu/node/122 Student License]|  
cost = $5 for CD<br>$30 for student license|
+
cost = Free on Unix<br>$5 for CD (faculty)<br>$35 student license|
 
manufacturer=Maplesoft|
 
manufacturer=Maplesoft|
 
webpage=[http://www.maplesoft.com/products/maple/index.aspx <nowiki>maplesoft.com</nowiki>]|
 
webpage=[http://www.maplesoft.com/products/maple/index.aspx <nowiki>maplesoft.com</nowiki>]|
 
label_color=|
 
label_color=|
 
value_color=|
 
value_color=|
update=1/14/2008
+
update=8/21/2016
 
}}
 
}}
 +
 +
== Starting Maple ==
 +
To start the graphical version of Maple from the Duke Linux stations, type
 +
<source lang="text">
 +
xmaple &
 +
</source>
 +
or
 +
<source lang="text">
 +
xmaple &
 +
</source>
 +
where the "x" in front indicates the graphical version of Maple.  If this does not work, try typing <code>xmaple</code> followed by hitting that TAB key -- UNIX will try to auto-complete the correct command for you.
  
 
== Introduction ==
 
== Introduction ==
Maple is a symbolic math package produced by Waterloo.  It is available for free on the UNIX systems and can be started by typing xmaple at the command line.  Maple is available to faculty and staff for $5 - the cost of the CD - while it is available for students at a cost of $30 for a perpetual license.
+
Maple is a symbolic math package produced by Waterloo.  It is available for free on the UNIX systems.  Maple is available to faculty and staff for free; a student license costs $35.
  
 
=== Maple Modes ===
 
=== Maple Modes ===
Line 35: Line 46:
 
# [http://www.math.duke.edu/education/ccp/materials/diffcalc/javamaptutor/index.html Maple Tutor (Maple 10 and higher) for Differential Calculus], Joshua Holden, David Smith, and Lawrence Moore
 
# [http://www.math.duke.edu/education/ccp/materials/diffcalc/javamaptutor/index.html Maple Tutor (Maple 10 and higher) for Differential Calculus], Joshua Holden, David Smith, and Lawrence Moore
 
# [http://www.math.duke.edu/education/ccp/materials/mvcalc/javamaptutor/index.html Maple Tutor (Maple 10 and higher) for Multivariable Calculus], Joshua Holden, Lang Moore, David Smith, and Jim Tomberg
 
# [http://www.math.duke.edu/education/ccp/materials/mvcalc/javamaptutor/index.html Maple Tutor (Maple 10 and higher) for Multivariable Calculus], Joshua Holden, Lang Moore, David Smith, and Jim Tomberg
 +
 +
===Other Pundit Pages===
 +
*[[Maple/Initialization and Documentation]]
 +
* [[Maple/Plotting]]
 +
* [[Maple/Simultaneous_Equations]]
 +
* [[Maple/Differential_Equations]]
 +
* [[Maple/Laplace_Transforms]]
 +
* Examples:
 +
** [[Maple/Examples/Circuits]]
 +
** [[Maple/Differential_Equations/RC_Example]]
  
 
=== Additional Information ===
 
=== Additional Information ===
Line 49: Line 70:
 
If you need to calculate an equivalent impedance involving parallel constructions, you may want to define a function to simplify those parallel parts:
 
If you need to calculate an equivalent impedance involving parallel constructions, you may want to define a function to simplify those parallel parts:
 
<source lang="text">
 
<source lang="text">
PAR := (Ra, Rb) -> simplify(Ra*Rb/(Ra+Rb))
+
PAR := (Za, Zb) -> simplify(Za*Zb/(Za+Zb))
 
</source>
 
</source>
 +
 
=== Simplifying Fractions of Polynomials (SCS) ===
 
=== Simplifying Fractions of Polynomials (SCS) ===
 
If you end up making calculations that involve fractions of polynomials, it can be useful to simplify the expression, collect the variable of interest, and then sort the results.  For example, with Laplace transforms, <code>s</code> is the variable of interest so:
 
If you end up making calculations that involve fractions of polynomials, it can be useful to simplify the expression, collect the variable of interest, and then sort the results.  For example, with Laplace transforms, <code>s</code> is the variable of interest so:
 
<source lang="text">
 
<source lang="text">
SCS := X -> sort(collect(simplify(X), s), s)
+
SCS := X -> sort(collect(simplify(expand(numer(X))/expand(denom(X))), s), s);
 
</source>
 
</source>
 +
 
=== Example using PAR and SCS ===
 
=== Example using PAR and SCS ===
  PAR := (Ra, Rb) -> simplify(Ra*Rb/(Ra+Rb))
+
  PAR := (Za, Zb) -> simplify(Za*Zb/(Za+Zb))
 
<center>
 
<center>
 
<math>
 
<math>
PAR := (Ra, Rb) \rightarrow {\it simplify}\left(\frac{Ra~Rb}{Ra+Rb}\right)
+
PAR := (Za, Zb) \rightarrow {\it simplify}\left(\frac{Za~Zb}{Za+Zb}\right)
 
</math>
 
</math>
 
</center>
 
</center>
  SCS := X -> sort(collect(simplify(X), s), s)
+
  SCS := X -> sort(collect(simplify(expand(numer(X))/expand(denom(X))), s), s);
 
<center>
 
<center>
 
<math>
 
<math>
SCS := X \rightarrow {\it sort(collect(simplify(X), s), s)}\,\!
+
SCS := X \rightarrow {\it sort(collect(simplify(expand(numer(X))/expand(denom(X))), s), s);}\,\!
 
</math>
 
</math>
 
</center>
 
</center>
Line 86: Line 109:
 
</center>
 
</center>
  
=== Inverse Laplace Transforms ===
+
=== Laplace Transforms ===
For inverse Laplace transforms, a little bit of processing can go a long way.  Specifically, consider the following:
+
For handy functions with Laplace and Inverse Laplace Transforms, see the [[Maple/Laplace Transforms]] page
with(inttrans)
 
x := exp(-t)+cos(80*t)
 
X1 := laplace(x, t, s)
 
X2 := simplify(X1)
 
At this point, X1 and X2 represent the laplace transform of the same function; they are just presented differently since X2 is the simplified version of X1.  However, when taking the inverse:
 
x1 := invlaplace(X1, s, t)
 
x2 := invlaplace(X2, s, t)
 
a disaster happens - x1 returns the original x while x2 returns...a mess.  One way around this is to have Maple split the Laplace transform into partial fractions, then take the inverse of those parts; writing
 
x2a := invlaplace(convert(X2, parfrac), s, t)
 
will yield the original x.
 
One caveat - this only works if the Laplace transform is a ratio of polynomials; if there are any time shifts, represented by exponentials of s in the transform, the conversion to a partial fraction will fail.  For this reason, you may want to construct two different versions of the inverse Laplace transform simplifier:
 
IL  := (X, s, t) -> simplify(convert(invlaplace(convert(X, parfrac), s, t), expsincos))
 
for taking the inverse of Laplace transforms that are ratios of polynomials and
 
ILTS := (X, s, t) -> simplify(convert(invlaplace(X, s, t), expsincos))
 
for those with time shifts.  In both cases, the conversion to expsincos eliminates any complex exponentials (when possible).
 
  
 
== Troubleshooting ==
 
== Troubleshooting ==
 +
=== No Maple Window Comes Up ===
 +
If you are connected to a Unix station and you sure that graphics are being forwarded / you did ssh correctly on a MAC / graphics are all good (and you can check by typing:
 +
xterm &
 +
and an xterminal should come up), VERY CAREFULLY type the following:
 +
 +
rm -ir ~/.maple*
 +
 +
and then delete anything that is in the .maple or .maplesoft directories.  Be VERY careful with the spacing and such in this command!  Once those directories are gone, type
 +
xmaple &
 +
and xmaple should come back up.
 +
 
=== Infinite startup time with X-Win 32 ===
 
=== Infinite startup time with X-Win 32 ===
 
If you are trying to run Maple over X-Win 32 and the splash screen progress bar halts for a significant period of time, the following steps seem to work to correct the problem:
 
If you are trying to run Maple over X-Win 32 and the splash screen progress bar halts for a significant period of time, the following steps seem to work to correct the problem:
Line 133: Line 152:
  
 
[[Category:Software]]
 
[[Category:Software]]
[[Category:BME 153]]
+
[[Category:ECE 110]]
[[Category:ECE 141]]
+
[[Category:ECE 280]]
[[Category:EGR 119]]
+
[[Category:ECE 382]]
 +
[[Category:EGR 224]]
 +
[[Category:ME 344]]
 +
 
 +
[[Category:Semester Update]]

Revision as of 18:46, 5 March 2017

Maple
"Harnessing the Power of Mathematics"
200 px
Version 2016
17 on Unix
Download Faculty
https://software.duke.edu/node/122 Student License]
Cost Free on Unix
$5 for CD (faculty)
$35 student license
Manufacturer Maplesoft
Web Page maplesoft.com
Pundit Updated 8/21/2016


Starting Maple

To start the graphical version of Maple from the Duke Linux stations, type

xmaple &

or

xmaple &

where the "x" in front indicates the graphical version of Maple. If this does not work, try typing xmaple followed by hitting that TAB key -- UNIX will try to auto-complete the correct command for you.

Introduction

Maple is a symbolic math package produced by Waterloo. It is available for free on the UNIX systems. Maple is available to faculty and staff for free; a student license costs $35.

Maple Modes

There are two different ways Maple creates documents - worksheet mode and document mode. The information and screenshots below are presented assuming worksheet mode.

Duke CCP Tutorials

The Math Department at Duke has provided several tutorials on the fundamentals of Maple (in addition to many other tutorials on using Maple for specific purposes). They are a part of the Connected Curriculum Project (CCP) and are linked below. Please note the Copyright Information provided with respect to documents in the Connected Curriculum Project.

  1. Maple Tutor for Precalculus, David Smith and Lawrence Moore
  2. Maple Tutor for Differential Calculus, David Smith and Lawrence Moore
  3. Maple Tutor for Integral Calculus, Lang Moore, Dick Schori, David Smith, and Jim Tomberg
  4. Maple Tutor for Multivariable Calculus, Lang Moore, David Smith, and Jim Tomberg
  5. Maple Tutor for Differential Equations, Lang Moore, David Smith, and Jim Tomberg
  6. Maple Tutor for Linear Algebra, Lang Moore, David Smith, and Jim Tomberg
  7. Maple Tutor for Engineering Mathematics, Lang Moore, David Smith, and Jim Tomberg


There are also two tutorials that assume document mode. These are:

  1. Maple Tutor (Maple 10 and higher) for Differential Calculus, Joshua Holden, David Smith, and Lawrence Moore
  2. Maple Tutor (Maple 10 and higher) for Multivariable Calculus, Joshua Holden, Lang Moore, David Smith, and Jim Tomberg

Other Pundit Pages

Additional Information

Below are some more example of specific tasks that may be done in Maple.

Symbolic Derivatives

There are at least three ways to take a symbolic derivative in Maple:

  1. Using the diff command
  2. Using the D operator
  3. Using the "prime" operator

Handy Functions

Parallel Impedances (PAR)

If you need to calculate an equivalent impedance involving parallel constructions, you may want to define a function to simplify those parallel parts:

PAR := (Za, Zb) -> simplify(Za*Zb/(Za+Zb))

Simplifying Fractions of Polynomials (SCS)

If you end up making calculations that involve fractions of polynomials, it can be useful to simplify the expression, collect the variable of interest, and then sort the results. For example, with Laplace transforms, s is the variable of interest so:

SCS := X -> sort(collect(simplify(expand(numer(X))/expand(denom(X))), s), s);

Example using PAR and SCS

PAR := (Za, Zb) -> simplify(Za*Zb/(Za+Zb))

\( PAR := (Za, Zb) \rightarrow {\it simplify}\left(\frac{Za~Zb}{Za+Zb}\right) \)

SCS := X -> sort(collect(simplify(expand(numer(X))/expand(denom(X))), s), s);

\( SCS := X \rightarrow {\it sort(collect(simplify(expand(numer(X))/expand(denom(X))), s), s);}\,\! \)

H:=PAR(1/s/C, R1+PAR(s*L, R2))

\( H:={\frac {{\it R1}\,sL+{\it R1}\,{\it R2}+s\,L\,{\it R2}}{s\,L+{\it R2}+{\it R1}\,{s}^{2}\,C\,L+{\it R1}\,s\,C\,{\it R2}+{s}^{2}\,L{\it R2}\,C}}\,\! \)

SCS(H)

\( {\frac { \left( {\it R1}\,L+L\,{\it R2} \right) s+{\it R1}\,{\it R2}}{ \left( {\it R1}\,CL+L\,{\it R2}\,C \right) {s}^{2}+ \left( L+{\it R1}\, C\,{\it R2} \right) s+{\it R2}}} \,\! \)

Laplace Transforms

For handy functions with Laplace and Inverse Laplace Transforms, see the Maple/Laplace Transforms page

Troubleshooting

No Maple Window Comes Up

If you are connected to a Unix station and you sure that graphics are being forwarded / you did ssh correctly on a MAC / graphics are all good (and you can check by typing:

xterm &

and an xterminal should come up), VERY CAREFULLY type the following:

rm -ir ~/.maple*

and then delete anything that is in the .maple or .maplesoft directories. Be VERY careful with the spacing and such in this command! Once those directories are gone, type

xmaple &

and xmaple should come back up.

Infinite startup time with X-Win 32

If you are trying to run Maple over X-Win 32 and the splash screen progress bar halts for a significant period of time, the following steps seem to work to correct the problem:

  1. Hit CTRL-alt-delete
  2. Choose the Task Manager
  3. In the Processes tab, click Image Name to get the images in reverse alphabetical order - usually this means clicking it twice
  4. Right-click the xwin32 image and select End Process Tree - do this for all instances of xwin32 that are running
  5. Close the task manager
  6. At the bottom right of your screen, point at the X-Win logos in the applications tray - they should disappear
  7. Restart XWin on your computer
  8. Type xterm in your PuTTY terminal to see if XWin is working - if it is, close the new xterm window
  9. Try starting Maple again

Occasionally, this process has to be repeated - so far, the most recorded times for repeating it is three, but Maple did load on the fourth try!

Alternate Method

The problem seems to be that Maple cannot always get the graphical user interface to launch. The following seems to fix it. Go through the steps above, but replace the last step with typing

xeyes &; xmaple &; xeyes &

all on one line... If Maple comes all the way up, you can delete the two instances of xeyes. For whatever reason, having something graphical before and after xmaple helps things along. Plus, xeyes is funny...

Questions

Post your questions by editing the discussion page of this article. Edit the page, then scroll to the bottom and add a question by putting in the characters *{{Q}}, followed by your question and finally your signature (with four tildes, i.e. ~~~~). Using the {{Q}} will automatically put the page in the category of pages with questions - other editors hoping to help out can then go to that category page to see where the questions are. See the page for Template:Q for details and examples.

External Links

  • Maple Tutor - Maple Tutor by Joshua Holden at Rose-Hulman Institute of Technology and Lang Moore, David Smith, and Jim Tomberg at Duke University. The stated purpose of this module is, "To learn the basics of Maple document mode (Maple 10 or higher) for use in a multivariable calculus course"

References