================================================================= HOW to USE REMOTE MAPLE from WINDOWS, LINUX or OS/X: UofU LIBRARY ================================================================= The documentation from the university library is located here: http://www.lib.utah.edu/services/labs/remote-software/ This document describes the method of obtaining a remote Maple session at home or on a mobile device, such as a tablet or laptop. Please read it before trying to understand the paragraphs below. The method works on slow internet connections, but it is better on good ones, such as the campus UCONNECT WiFi. It works on major operating systems, and it can also work on a smartphone, with the right APP. EXPECTATIONS. You may have to install a remote desktop client on your device. And you must obtain/install a free cloud storage, UBOX recommended. Under Linux, the client is RDESKTOP, which is only a few hundred kilobytes to install. OS/X should already be equipped with the client, called MICROSOFT REMOTE DESKTOP. Windows has already a suitable client, called REMOTE DESKTOP, under Accessories, found from the Start Button. If your system is missing the remote desktop client, then expect to download a remote desktop client from sources for your system, not from the library site. Remote desktop client install is just done once (a single install), and then you are set to go. LOGIN. The remote maple session starts with a launch of the remote desktop client, target equal to the library site. You may have to adjust the screen size of the local display, according to physical dimensions of the screen. Here are two command lines you might try in Linux from a terminal. Differences for launch from a Windows host appear below. rdesktop -g 1024x768 -u u0012345 TERMINAL.SCL.UTAH.EDU rdesktop -g 1024x700 -u u0012345 TERMINAL.SCL.UTAH.EDU The string "u0012345" should be replaced with your UNid at Utah. The launch screen should connect to the library site and ask for (1) Your UNid. It is a string of characters like u0012345 (2) Your password. The password is the one you use at the Registrar's site to add classes. The screen size 700 shrinks the display vertically, required on a laptop with a 13 or 14 inch screen size. Other devices must be subjected to an experiment to determine the right size. The size works if you can see the OS/X Dock at the bottom of the screen, after login. A WINDOWS HOST has a pop-up dialog to fill in details. Required is the user name [u0012345] and the target site [TERMINAL.SCL.UTAH.EDU]. The screen size is not determined by the windows application. Specify initially 1024x768 in a sub-dialog box. You will be given a dialog box option to save the configuration. Do it, so that you can start the remote desktop in the future, without re-entering the data. OPERATION. Let's suppose you successfully logged in to the library site. In a normal session, you will run Safari and open the UBOX web page to get your files. Download files to the local directory Downloads (see the OS/X Dock after login to the library site). Right-click on Downloads in the Dock, then highlight a maple worksheet. Right-click again to get an option to run maple on the file. Save the maple worksheet often, in case the connection crashes. Finally, UPLOAD the file to UBOX both for safety and for access at home or local storage on your laptop/tablet. EXIT. It is best to save the session, by clicking on the go-away box (X) in the upper right corner. Similar actions are successful in OS/X and Windows. This practise keeps the session, restored on next login. FINDING a SAVED SESSION. If you hit the go-away box to exit, then the saved session is logged back into by the appropriate command line. Suppose that you connected to TERMINAL-SERVER-5.LIB.UTAH.EDU, then the command line is rdesktop -g 1024x768 -u u0012345 TERMINAL-SERVER-5.SCL.UTAH.EDU PREFERENCES. Maple preferences are not saved automatically. There is an application in the same folder as Maple 18 which will save preferences. Use it to save the worksheet interface and display defaults. This is a work-around caused by Aqua Connect (not the fault of Maple 18). ==================================================== HOW to USE REMOTE X-Windows MAPLE from LINUX or OS/X ==================================================== These instructions apply to only the Math Department computers. The method works with many workstations around the campus or a linux or Apple laptop. If your laptop runs Microsoft Windows, then these instructions do not apply. The previous solution is the best method for MS-Windows remote access to maple. Launch a terminal. Enter the command line ssh -X -Y user@xserver.math.utah.edu where user is your user name [example: c-xyzf] on the math server. It will ask for a security certificate on first use (OK to that), and a password on every use. After that, running a command from the terminal will produce an X-window on your laptop. For example, xmaple & will launch xmaple 2017. Ampersand means run it in background. Older versions of maple are launched similarly, e.g., replace "xmaple" above by "xmaple2015" or "xmapleV11". The window will appear after a long time, depending on internet speed. Everything will be slow, but it will work. Printing will not work, because the printers are physically located in the Math Center on campus, or elsewhere, meaning that you cannot pick up your printout. Using your home printer is possible only if your printer has a URL and is set up for internet printing. When finished, type exit in the terminal window and exit all window applications launched from the math server. ======================= HOW to USE REMOTE MAPLE ======================= Do you work at home at night and the weekend with slow internet? Do you want to use the Math Department server, and not the Library remote desktop solution? The Library is the best solution for most people, but the solution described here is a fundamental one, known to work on more devices, e.g., a Raspberry PI board in a lab. Then maple graphics is possible, although it is less intuitive and a longer process. The process will be explained for MS-Windows. The differences for OS/X and Linux appear later. WHAT YOU NEED for MS-Windows (1) A graphics program. Free software: IRFANVIEW, FASTSTONE (2) File transfer program. Free software: PUTTY, WINSCP FREE SOFTWARE DETAILS IRFANVIEW. FASTSTONE. A free graphics program to view, crop, resize, resample and convert graphics files. Choose one or use your favorite. PUTTY, SSH, SFTP, WINSCP. Free secure ftp and secure telnet. Provides sftp and ssh. The ftp interface is command line. The telnet interface is vt100 terminal. Both are used by WinSCP, and you can forget them once installed and the preferences are set. WinSCP is a free windows file transfer graphical interface, with built-in PUTTY launcher. Recommended for moving files between laptop and university account. Launches putty without extra password entry, giving a single interface. PUTTY PREFERENCES. The setup for a university math dept account requires site "xserver.math.utah.edu". Set the default user name to your user name in the "Connection --> Data" section of Putty. Save the setup under a name like "math" (instead of "Default"), then each use of putty will require only a password. Customize putty for colors, font and font size, then save the setup again under "math". REMOTE MAPLE. Start putty with a button click in WinSCP. Start maple [not xmaple] in the putty connection window. Type in the several lines of code below to test the interface. EASY EXAMPLE: file:="plot.jpg"; opts:="width=400,height=320"; plotsetup(jpeg,plotoutput=file,plotoptions=opts); plot(sin(x),x=0..Pi); plotsetup(default); This example diverts graphics output to file "plot.jpg", does the plot, then resets the plot device back to maple default. After executing the four lines, transfer file "plot.jpg" back to your local machine with WinSCP. View it locally in IrfanView/FastStone. Recommended: Copy and paste the lines of text above into WORDPAD. Then paste WORDPAD contents into the Putty window [which is running MAPLE]. Do all editing in WORDPAD. Graphics: The name "plot.jpg" is just a container to pass to the graphics program. Edit the graphic, SAVE AS to keep it and OPEN/REREAD to load a new image. Programmer's Puzzle: Write a maple function myplot(u) that does the 5 lines above, so that myplot(sin(x),x=0..Pi) does it in one line. COMPLEX EXAMPLE: b1:=1:b2:=2:m1:=1:m2:=1: de1:=diff(x1(t),t,t)=-(b1+b2)/m1*diff(x1(t),t)+ b2/m1*diff(x2(t),t); de2:=diff(x2(t),t,t)=b2/m2*diff(x1(t),t)- b2/m2*diff(x2(t),t); dsolve({de1,de2},{x1(t),x2(t)}); p:=subs(_C1=1,_C2=1,_C3=1,_C4=1,%); p1:=convert(p,list); X1:=unapply(rhs(p1[2]),t); X2:=unapply(rhs(p1[1]),t); file:="plot.jpg"; opts:="width=400,height=320"; plotsetup(jpeg,plotoutput=file,plotoptions=opts); plot([X1(t),X2(t)],t=0..10,thickness=3); plotsetup(default); This dynamical system is a linear cascade for uranium and thorium. Then the solutions x1(t), x2(t) are plotted on one set of axes. WRITTEN REPORTS. Both Open Office and MS-word can be used to put together the maple code and the images. The result is a pad of paper not different from what you get by printing a worksheet from maple. =========================== OS/X and LINUX DIFFERENCES =========================== Both systems support SSH and SFTP programs that can do everything described above for Windows. It is possible in both to mount a remote disk, so that all file transfer operations are done through the graphical window interface, and not directly through SFTP. Both systems require ssh or its equivalent to be installed. To detect previous installs, try in a terminal window commands STFP and SSH. If they work, then the install was already done. LAUNCH REMOTE TERMINAL. Do this command in an xterm window. ssh -X -Y username@xserver.math.utah.edu It sets up a vt100 terminal to the remote machine from which to run command line MAPLE. In each system, there is a graphical user interface to launch the equivalent of SSH. Names vary but the idea is identical: open a vt100 terminal window and log into the remote site. Settings for the Linux REMOTE DESKTOP VIEWER: Protocol: SSH Host: xserver.math.utah.edu Username: XXXXXX It is the same as " ssh XXXXXX@xserver.math.utah.edu " with command line split into three strings, entered in a different order. =================== SAVING MAPLE CODE. =================== A safe method for writing maple code is to produce everything in a text editor (Wordpad, gedit), then mouse-copy it and paste it into maple. No mouse copying is done from the maple screen back to wordpad, except error correction. This interface offers the best and safest method for saving code. Mouse copying from the maple terminal interface is problematic, due to maple's default sub and super scripts, plus unusable output for matrices and vectors. A work-around is discussed below. There are maple commands writeto, connectdir, appendto which can save maple code in a specific location as text. An example: currentdir("/home/tmp"); # To write file /home/tmp/foo.mpl writeto("foo.mpl"); # Screen output sent to file. .. then mouse-paste code from wordpad writeto(terminal); # closes foo.mpl, back to normal interface. To save massive amounts of code, error-free, please investigate the MAPLE command "save". The command ' save p, "foo.mpl" ' will deposit variable p into text file "foo.mpl"; the extension ".mpl" is required. Code saved in foo.mpl can be executed inside command line maple with the statements currentdir("/home/tmp"); # Where to find foo.mpl read "foo.mpl"; # Execute contents as though typed. ============================== COPYING TEXT in a REMOTE MAPLE ============================== # Solve the remote MAPLE mouse copy problem. # Some displays are useless for mouse copy. # Make the default display text. No subs or supers. interface(prettyprint=0); # Function to pretty-print specific output. # USE: "pprint" used instead of maple's "print" pprint:=proc(x) global prettyPrint; interface(prettyprint = 1); print(x); interface(prettyprint = 0); end proc # Put this function into MAPLE startup [not for xmaple]. ===================== SOME USEFUL COMMANDS: ===================== ssh -X -Y username@xserver.math.utah.edu Sets up a vt100 terminal to the remote machine which can run X-window applications like xmaple, emacs, openoffice, etc. Leave off the "-X -Y" to get a terminal window without X-windows. sftp username@xserver.math.utah.edu Starts an ftp session for upload or download of files. Works in OS/X (with linux support installed) and Linux. Works in Windows from a CMD.EXE window (install package putty). Don't use an ampersand! =============================================================