How to use remote maple ======================= Do you work at home at night and the weekend with slow internet? Then maple graphics at home 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: IRFANVIEW, a free graphics program to view, crop, resize, resample and convert graphics files. Substitute your favorite. PUTTY, a free secure ftp and secure telnet. Provides sftp and ssh. The ftp interface is command line. The telnet interface is vt100 terminal. These are used by WinSCP, and you can forget them once installed and the preferences are set. WinSCP, 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 usual 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 see how the interface works. EASY EXAMPLE: opts:="width=400,height=320";file:="plot.jpg"; 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 and view it locally in IrfanView. Recommended: Copy the lines of text above and paste into the Putty window [which is running MAPLE]. 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); opts:="width=400,height=320";file:="plot.jpg"; 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. 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 Putty or its equivalent to be installed. To detect previous installs, in a terminal window try commands STFP an SSH. If they work, then the install was already done. ssh username@xserver.math.utah.edu 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 the same: open a vt100 terminal window, logging onto the remote site. Settings for the ubuntu 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. All code entered into the maple interface can be saved as a file, then accessed again either at school or at home. An easy method is mouse copy of maple code on the display, then paste it into a text editor (Wordpad) and save it. This works unless the code you wanted to save scrolled off the screen. Mouse copying from the 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. A safe method for coding is to write all maple code in Wordpad, then mouse-copy it and paste it into maple. Mistakes are easily corrected by this method, and the result is somewhat interactive. No mouse-copying is done from the maple screen back to wordpad. 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 it 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. prettyPrint:=0;interface(prettyprint=prettyPrint); # Function to pretty-print specific output. pprint:=proc(x) global prettyPrint; interface(prettyprint = 1); print(x); interface(prettyprint = prettyPrint) 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. xmaple -cw& Starts xmaple with classical window interface, not java, 10-times faster. Must be run after you have logged in with ssh, as above. Only works with high-speed internet or a university campus connection. 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 after Putty is installed, from a CMD.EXE window. Don't use an ampersand! =============================================================