Difference between revisions of "Maple"

From PrattWiki
Jump to navigation Jump to search
m
(Installed on the Duke Linux System)
(32 intermediate revisions by the same user not shown)
Line 4: Line 4:
 
image=[[File:Maplesoft Maple-11 x2-plus-y2 3D plot.png|200 px]]|
 
image=[[File:Maplesoft Maple-11 x2-plus-y2 3D plot.png|200 px]]|
 
caption=|  
 
caption=|  
version=16<br>15 on Unix|
+
version=2021|
dlocation=[http://www.oit.duke.edu/comp-print/software/license/detail.php?id=2 OIT]|  
+
dlocation=[https://software.duke.edu/node/122 Faculty]<br>[https://software.duke.edu/node/122 Student License]|  
cost = Free on Unix<br>$5 for CD (faculty)<br>$35 student license|
+
cost = Free on Unix<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=8/30/2012
+
update=1/10/2022
 
}}
 
}}
  
== Starting Maple ==
+
== Using Maple ==
To start the graphical version of Maple from the Duke Linux stations, type
+
There are several different options when it comes to using Maple.  The items below will cover these as well as where your files will live in each case.
 +
 
 +
=== Duke Container ===
 +
'''''This will be the most common path for Duke students as it is free and includes the least overhead.'''''  These instructions were updated in October of 2023.
 +
 
 +
Duke has a suite of Containers for Virtual Software, and among them is a container for Maple.  The container is a Linux-based web-accessible application that includes a file system, web browser, and Maple.  The positives are that it is free for Duke students and very easy to access and use; the negative is that the file system doesn't really connect to any other file system at Duke.  Fortunately, the presence of a browser ameliorates that issue.
 +
 
 +
To get access to the Virtual Computing Manager, go to [https://vcm.duke.edu/ VCM] and log in with your Duke credentials. 
 +
* To access the Maple container, go to the "Reserve a Container" link below the "Virtual Software" section of the landing page. 
 +
* Once there, if you have previously reserved a Maple container, it will show up on the left; if you haven't reserved a Maple container before, scroll to the Maple container in the "Reservations available" section. 
 +
* Once reserved, you can go to the VCM site and it will already be there.  Click on the '''Maple''' link under '''CONTAINERS''' in '''My reservations'''
 +
* You will need to '''Login''' to the container using the blue button in the '''CONTAINER CONTROLS''' section, at which point you will see a Linux session in a web page.  It may say "No session for pid ##" - click OK there.  You should now see icons for Firefox web Browser and Maple 2023.
 +
* Go ahead and start Maple by double-clicking the icon.  If it asks you what to do with it, Execute it.  If it asks if you want to import previous preferences, Sure, why not?
 +
** If it asks you if you want to update, you do not
 +
** If it tells you "Invalid or missing license file" - that may mean that you were the first person to try to use Maple that day - congratulations!  To make things work:
 +
*** Click '''Exit Maple'''
 +
*** Close the browser with the container in it
 +
*** Go back to the [https://vcm.duke.edu/ VCM] page, then the '''Reserve a Container''' page, then click the Maple container link
 +
*** Click the '''Login''' button and then '''OK''' when "No session for pid ##" comes up
 +
*** Double-click the Maple icon
 +
*** Feel more confident after going through this process that computers are not quite ready to take over the world...
 +
 
 +
==== Files ====
 +
The files that you create in the Container will live in the Container's file system - this is separate from your computer or Box or any other storage and there's no great way to connect things.  If you need to move files back and forth from outside the VCM, I highly recommend using a Box drive.  In the VCM, you can open Firefox and go to box.duke.edu to access and download files in your Box folder.  You can also upload items from your VCM drive to Box for access outside of the container.
 +
 
 +
The files will stay on the container for as long as the reservation lasts (the semester) but you will definitely want to back them up on Box.  The files will be in a folder called <code>/home/ubuntu/</code>.  When you save Maple files, you will have the option of creating a new folder - there is an icon near the top right of the "Save" or "Save As" window that looks like a file folder - you can use that to create a folder to organize your materials.
 +
 
 +
We may explore using the Maple Cloud for file storage - but that will come up in a later lab.
 +
 
 +
=== Installed on  Your Computer ===
 +
You can install Maple on your own computer; as mentioned above, this is free for faculty and staff and $35 for students.  The advantage is that it will run on your computer and you will not need to be connected to the internet or worry about bandwidth issues.  The disadvantage for students is that it costs $35.  If you install Maple on your own computer, you can save your files wherever you like on your own computer (generally a Box Drive or something connected to Box Sync).
 +
 
 +
=== Installed on the Duke Linux System ===
 +
Update 10/2023: The Linux version is not working as the license files are incompatible. 
 +
 
 +
Maple is installed on the Duke linux system (currently 2019.1).
 +
To start the graphical version of Maple from the Duke Linux stations,
 +
log in using a terminal program with X11-forwarding enabled. See the [[How To Get Work Done]] page and specifically the "Connecting to Duke's Linux Machines" section relevant to your computer.
 +
Once logged in, change directories to the location on your CIFS drive where you want to save files.
 +
Next, type
 
<source lang="text">
 
<source lang="text">
xmaple15 &
+
xmaple &
 
</source>
 
</source>
 
or
 
or
 
<source lang="text">
 
<source lang="text">
xmaple15 &
+
xmaple &
 
</source>
 
</source>
where the "x" in front indicates the graphical version of Maple.
+
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.
 +
 
 +
The Duke linux system will not allow you to mount other storage options, so you will have to use the CIFS system.  You can mount your CIFS folder on your own computer, however.  See:
 +
* [https://oit.duke.edu/help/articles/kb0013655 CIFS: How to Connect from Windows]
 +
* [https://oit.duke.edu/help/articles/kb0013637 CIFS: How to connect from Mac OS]
 +
 
 +
=== Using a Virtual Machine ===
 +
Duke has created a suite of virtual machines, accessible via the [https://vcm.duke.edu/ Virtual Computing Manager] site.  New VMs can be made at their [https://vcm.duke.edu/reservations/new/vm New Virtual Machine Reservation] site.  One of these is the "EGR 103 / ECE 110 / EGR 224 / ECE 382 / ME 344 Windows 10 + Math apps for Gustafson EGR / ECE classes" machine.  You can create a virtual machine and access it from your own computer; it will be like running on a Windows machine in a window!  Among other things, Maple (and several other programs) is already installed, as is Box Drive.  Note that when you first make a machine, the status will show up as "Provisioning."  You can not turn the power on until you get an email from the VCM manager that says "Your requested VM has been successfully reserved."  At that point, go to the VCM page, turn the power on, and click Remote Desktop.
 +
 
 +
Note if you create a virtual machine that, when you are finished with it, you should shut it down (Windows menu, Power, Shut Down) - when the VM has shut down, the remote desktop will close.  Also, the power will be turned off daily at 6am.  You will need to power it back on at the VCM site by selecting your virtual machine and then clicking "Power on" in the VM Management Tools.  Once that is done, you can click the "Remote Desktop" link in the "General Information" section.
  
 
== Introduction ==
 
== Introduction ==
Line 48: Line 96:
  
 
===Other Pundit Pages===
 
===Other Pundit Pages===
 +
*[[Maple/Initialization and Documentation]]
 
* [[Maple/Plotting]]
 
* [[Maple/Plotting]]
 
* [[Maple/Simultaneous_Equations]]
 
* [[Maple/Simultaneous_Equations]]
 
* [[Maple/Differential_Equations]]
 
* [[Maple/Differential_Equations]]
 
* [[Maple/Laplace_Transforms]]
 
* [[Maple/Laplace_Transforms]]
 +
* Examples:
 +
** [[Maple/Examples/Circuits]]
 +
** [[Maple/Differential_Equations/RC_Example]]
  
 
=== Additional Information ===
 
=== Additional Information ===
Line 72: Line 124:
 
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, var) -> sort(collect(numer(simplify(X)), var), var)/sort(collect(denom(simplify(X)), var), var)
 
</source>
 
</source>
 +
can be called with <code>s</code> as the second argument.
 +
 
=== Example using PAR and SCS ===
 
=== Example using PAR and SCS ===
 
  PAR := (Za, Zb) -> simplify(Za*Zb/(Za+Zb))
 
  PAR := (Za, Zb) -> simplify(Za*Zb/(Za+Zb))
Line 81: Line 135:
 
</math>
 
</math>
 
</center>
 
</center>
  SCS := X -> sort(collect(simplify(X), s), s)
+
  SCS := (X, var) -> sort(collect(numer(simplify(X)), var), var)/sort(collect(denom(simplify(X)), var), var)
 
<center>
 
<center>
 
<math>
 
<math>
SCS := X \rightarrow {\it sort(collect(simplify(X), s), s)}\,\!
+
SCS := (X, var) \rightarrow {\it sort(collect(numer(simplify(X)), var), var)/sort(collect(denom(simplify(X)), var), var)}\,\!
 
</math>
 
</math>
 
</center>
 
</center>
Line 94: Line 148:
 
</math>
 
</math>
 
</center>
 
</center>
  SCS(H)
+
  SCS(H, s)
 
<center>
 
<center>
 
<math>
 
<math>
Line 107: Line 161:
 
For handy functions with Laplace and Inverse Laplace Transforms, see the [[Maple/Laplace Transforms]] page
 
For handy functions with Laplace and Inverse Laplace Transforms, see the [[Maple/Laplace Transforms]] page
  
== Troubleshooting ==
+
== Clarifications / Troubleshooting ==
 +
=== License Error with Container-Based Maple ===
 +
If you get an error about a missing license file when using the container-based Maple, it may be that you are the first person to use Maple that day and the license server wasn't fully awake.  In that case:
 +
* Close the container
 +
* Open the container
 +
* Start Maple
 +
=== Exporting from Container-Based Maple ===
 +
To export the PDF, in Maple, just go to File -> Export As... and then in the "Files of type" selector choose "PDF" and save the file.  It will live on the container's file system
 +
 
 +
There are a few ways to get the code to your own computer:
 +
* Use git.  If you know how to use git, use git.  If you don't, I am not quite up to the task of teaching git...
 +
* Open the Firefox browser, go to box.duke.edu, and upload the file to some place in your Box folder.  If you have Box Drive installed on your computer, it should automatically sync up.  NOTE - if you change the file on your own computer, that will not change the version on the container; you would need to go back to the container, open Firefox, go to Box, and re-download the file.  Unfortunately there is no Box Drive for Linux and the containers are Linux-based.
 +
* Open the Firefox browser, open a mail client, and mail it as an attachment; open a mail client on your computer and download the attachment.  This is decidedly the clunkiest.
 +
 
 +
 
 +
<!--
 +
=== 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 -- to do this, you will need to type "y" at each prompt as it asks you if you should descend into a directory or delete a folder.  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 125: Line 205:
 
  xeyes &; xmaple &; xeyes &
 
  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...
 
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 ==
 
==Questions ==
Line 136: Line 217:
  
 
[[Category:Software]]
 
[[Category:Software]]
[[Category:BME 153]]
+
[[Category:ECE 110]]
 
[[Category:ECE 280]]
 
[[Category:ECE 280]]
 
[[Category:ECE 382]]
 
[[Category:ECE 382]]
 
[[Category:EGR 224]]
 
[[Category:EGR 224]]
 
[[Category:ME 344]]
 
[[Category:ME 344]]
 +
 +
[[Category:Semester Update]]

Revision as of 00:35, 2 October 2023

Maple
"Harnessing the Power of Mathematics"
Maplesoft Maple-11 x2-plus-y2 3D plot.png
Version 2021
Download Faculty
Student License
Cost Free on Unix
$35 student license
Manufacturer Maplesoft
Web Page maplesoft.com
Pundit Updated 1/10/2022


Using Maple

There are several different options when it comes to using Maple. The items below will cover these as well as where your files will live in each case.

Duke Container

This will be the most common path for Duke students as it is free and includes the least overhead. These instructions were updated in October of 2023.

Duke has a suite of Containers for Virtual Software, and among them is a container for Maple. The container is a Linux-based web-accessible application that includes a file system, web browser, and Maple. The positives are that it is free for Duke students and very easy to access and use; the negative is that the file system doesn't really connect to any other file system at Duke. Fortunately, the presence of a browser ameliorates that issue.

To get access to the Virtual Computing Manager, go to VCM and log in with your Duke credentials.

  • To access the Maple container, go to the "Reserve a Container" link below the "Virtual Software" section of the landing page.
  • Once there, if you have previously reserved a Maple container, it will show up on the left; if you haven't reserved a Maple container before, scroll to the Maple container in the "Reservations available" section.
  • Once reserved, you can go to the VCM site and it will already be there. Click on the Maple link under CONTAINERS in My reservations
  • You will need to Login to the container using the blue button in the CONTAINER CONTROLS section, at which point you will see a Linux session in a web page. It may say "No session for pid ##" - click OK there. You should now see icons for Firefox web Browser and Maple 2023.
  • Go ahead and start Maple by double-clicking the icon. If it asks you what to do with it, Execute it. If it asks if you want to import previous preferences, Sure, why not?
    • If it asks you if you want to update, you do not
    • If it tells you "Invalid or missing license file" - that may mean that you were the first person to try to use Maple that day - congratulations! To make things work:
      • Click Exit Maple
      • Close the browser with the container in it
      • Go back to the VCM page, then the Reserve a Container page, then click the Maple container link
      • Click the Login button and then OK when "No session for pid ##" comes up
      • Double-click the Maple icon
      • Feel more confident after going through this process that computers are not quite ready to take over the world...

Files

The files that you create in the Container will live in the Container's file system - this is separate from your computer or Box or any other storage and there's no great way to connect things. If you need to move files back and forth from outside the VCM, I highly recommend using a Box drive. In the VCM, you can open Firefox and go to box.duke.edu to access and download files in your Box folder. You can also upload items from your VCM drive to Box for access outside of the container.

The files will stay on the container for as long as the reservation lasts (the semester) but you will definitely want to back them up on Box. The files will be in a folder called /home/ubuntu/. When you save Maple files, you will have the option of creating a new folder - there is an icon near the top right of the "Save" or "Save As" window that looks like a file folder - you can use that to create a folder to organize your materials.

We may explore using the Maple Cloud for file storage - but that will come up in a later lab.

Installed on Your Computer

You can install Maple on your own computer; as mentioned above, this is free for faculty and staff and $35 for students. The advantage is that it will run on your computer and you will not need to be connected to the internet or worry about bandwidth issues. The disadvantage for students is that it costs $35. If you install Maple on your own computer, you can save your files wherever you like on your own computer (generally a Box Drive or something connected to Box Sync).

Installed on the Duke Linux System

Update 10/2023: The Linux version is not working as the license files are incompatible.

Maple is installed on the Duke linux system (currently 2019.1). To start the graphical version of Maple from the Duke Linux stations, log in using a terminal program with X11-forwarding enabled. See the How To Get Work Done page and specifically the "Connecting to Duke's Linux Machines" section relevant to your computer. Once logged in, change directories to the location on your CIFS drive where you want to save files. Next, 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.

The Duke linux system will not allow you to mount other storage options, so you will have to use the CIFS system. You can mount your CIFS folder on your own computer, however. See:

Using a Virtual Machine

Duke has created a suite of virtual machines, accessible via the Virtual Computing Manager site. New VMs can be made at their New Virtual Machine Reservation site. One of these is the "EGR 103 / ECE 110 / EGR 224 / ECE 382 / ME 344 Windows 10 + Math apps for Gustafson EGR / ECE classes" machine. You can create a virtual machine and access it from your own computer; it will be like running on a Windows machine in a window! Among other things, Maple (and several other programs) is already installed, as is Box Drive. Note that when you first make a machine, the status will show up as "Provisioning." You can not turn the power on until you get an email from the VCM manager that says "Your requested VM has been successfully reserved." At that point, go to the VCM page, turn the power on, and click Remote Desktop.

Note if you create a virtual machine that, when you are finished with it, you should shut it down (Windows menu, Power, Shut Down) - when the VM has shut down, the remote desktop will close. Also, the power will be turned off daily at 6am. You will need to power it back on at the VCM site by selecting your virtual machine and then clicking "Power on" in the VM Management Tools. Once that is done, you can click the "Remote Desktop" link in the "General Information" section.

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, var) -> sort(collect(numer(simplify(X)), var), var)/sort(collect(denom(simplify(X)), var), var)

can be called with s as the second argument.

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, var) -> sort(collect(numer(simplify(X)), var), var)/sort(collect(denom(simplify(X)), var), var)

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

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, s)

\( {\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

Clarifications / Troubleshooting

License Error with Container-Based Maple

If you get an error about a missing license file when using the container-based Maple, it may be that you are the first person to use Maple that day and the license server wasn't fully awake. In that case:

  • Close the container
  • Open the container
  • Start Maple

Exporting from Container-Based Maple

To export the PDF, in Maple, just go to File -> Export As... and then in the "Files of type" selector choose "PDF" and save the file. It will live on the container's file system

There are a few ways to get the code to your own computer:

  • Use git. If you know how to use git, use git. If you don't, I am not quite up to the task of teaching git...
  • Open the Firefox browser, go to box.duke.edu, and upload the file to some place in your Box folder. If you have Box Drive installed on your computer, it should automatically sync up. NOTE - if you change the file on your own computer, that will not change the version on the container; you would need to go back to the container, open Firefox, go to Box, and re-download the file. Unfortunately there is no Box Drive for Linux and the containers are Linux-based.
  • Open the Firefox browser, open a mail client, and mail it as an attachment; open a mail client on your computer and download the attachment. This is decidedly the clunkiest.


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