Warning: this is an htmlized version!
The original is across this link,
and the conversion rules are here.
#######
#
# E-scripts for Maple.
#
# Note 1: use the eev command (defined in eev.el) and the
# ee alias (in my .zshrc) to execute parts of this file.
# Executing this file as a whole makes no sense.
#
# Note 2: be VERY careful and make sure you understand what
# you're doing.
#
# Note 3: If you use a shell other than zsh things like |&
# and the for loops may not work.
#
# Note 4: I always run as root.
#
# Note 5: some parts are too old and don't work anymore. Some
# never worked.
#
# Note 6: the definitions for the find-xxxfile commands are on my
# .emacs.
#
# Note 7: if you see a strange command check my .zshrc -- it may
# be defined there as a function or an alias.
#
# Note 8: the sections without dates are always older than the
# sections with dates.
#
# This file is at <http://angg.twu.net/e/maple.e>
#           or at <http://angg.twu.net/e/maple.e.html>.
#        See also <http://angg.twu.net/emacs.html>,
#                 <http://angg.twu.net/.emacs[.html]>,
#                 <http://angg.twu.net/.zshrc[.html]>,
#                 <http://angg.twu.net/escripts.html>,
#             and <http://angg.twu.net/>.
#
#######



# «.maple-11»	(to "maple-11")




#####
#
# MapleVr5 - student edition
# «99oct05»
#
#####

#*
# «erase_and_recopy_from_CD»
# To copy from the CD to /big:

mount /big -o rw,remount
cd /big/nonfree
rm -Rv MapleV5s/
mkdir  MapleV5s/
cd /cdrom/
cp -dipPvR readunix install* /big/nonfree/MapleV5s/
mount /big -o ro,remount

# (find-fline "/big/nonfree/MapleV5s/")
# (find-fline "/big/nonfree/MapleV5s/readunix")
# (find-fline "/big/nonfree/MapleV5s/install")

#*
# «install»
# Installing:

rm -Rv /usr/local/maple/
mkdir  /usr/local/maple/
cd     /usr/local/maple/
tar -xvf /nonfree/MapleV5s/install_base/base.tar
tar -xvf /nonfree/MapleV5s/install_base/bin.tar
tar -xvf /nonfree/MapleV5s/install_base/license.tar
tar -xvf /nonfree/MapleV5s/install_bins/bin_ibm_intel_linux.tar

apti libc5 xlib6
#*

cd /usr/local/maple/bin/
./TestMaple

cd /usr/local/maple/bin/
./xmaple




######
#
# maple + expect
# 99oct??
#
######

# «maple_expect»
# (find-fline "~/EXPECT/emaple")
# (find-fline "~/.mapleinit" "prompt")
# (find-angg ".emacs" "maple")

?linalg
?evalm
?matrix
?linalg[matrix]

a := [[2,1],
      [0,2]];
a*a;
a &* a;
evalm(a * a);
evalm(a &* a);


cat > /tmp/m <<'---'
a := [[2,1,0,0,0],
      [0,2,1,0,0],
      [0,0,2,0,0],
      [0,0,0,5,1],
      [0,0,0,0,5]];
evalm(a^2);
evalm(a^3);
evalm(a^4);
---
emaple -np -f /tmp/m


emaple -np -s '
a := [[2,1,0,0,0],
      [0,2,1,0,0],
      [0,0,2,0,0],
      [0,0,0,5,1],
      [0,0,0,0,5]];
evalm(a^2);
evalm(a^3);
evalm(a^4);
'

emaple -np -s "
with(linalg);
HC('linalg[curl]');
HC(linalg[curl]);
"

emaple -np -s "
with(linalg);
HC('linalg[curl]');
HC(linalg[curl]);
"

# «decode»
emaple -np -s "with(linalg);" -decode 'linalg[curl]' -q
emaple -np -s "with(linalg);" -q | tr -d \\r | tee ~/o

emaple -np -s "with(linalg);" -c '
  foreach f {BlockDiagonal GramSchmidt JordanBlock LUdecomp QRdecomp
Wronskian addcol addrow adj adjoint angle augment backsub band basis
bezout blockmatrix charmat charpoly cholesky col coldim colspace
colspan companion concat cond copyinto crossprod curl definite delcols
delrows det diag diverge dotprod eigenvals eigenvalues eigenvectors
eigenvects entermatrix equal exponential extend ffgausselim fibonacci
forwardsub frobenius gausselim gaussjord geneqns genmatrix grad
hadamard hermite hessian hilbert htranspose ihermite indexfunc
innerprod intbasis inverse ismith issimilar iszero jacobian jordan
kernel laplacian leastsqrs linsolve matadd matrix minor minpoly mulcol
mulrow multiply norm normalize nullspace orthog permanent pivot
potential randmatrix randvector rank ratform row rowdim rowspace
rowspan rref scalarmul singularvals smith stackmatrix submatrix
subvector sumbasis swapcol swaprow sylvester toeplitz trace transpose
vandermonde vecpotent vectdim vector wronskian
} {decode "linalg\[$f\]"}
' | tr -d \\r > ~/o

emaple -np -decode 'help INTERFACE_HELP' -q

?makehelp
readlib(makehelp);
?help[update]
?INTERFACE_HELP

?expression
?inifcns
?ininames
?arithmetic

print(`*`);
print(`intersect`);
print(limit);

emaple -np -s '
  with(linalg);
  print(linalg);
' -q

emaple -np -s '
  print(evalf);
  print(evalm);
  print(eval);
' -q





######
#
# .mapleinit
#
######

# (find-fline "~/TH/Htmllib.tcl" "proc readfile")
# (find-fline "~/.mapleinit")
expect -c 'spawn maple; interact "~~" {send "ee();\r"}'

expect -c '
  spawn maple
  set prompt "%%> "
  interact "~~" {
    foreach li [split [exec cat $env(HOME)/bin/ee.maple] "\n"] {
      send "$li\r"
      interact -o $prompt {send_user $prompt; return}
    }
  }
'

%*
interface(echo);
interface(prompt);
interface(echo=2);
%*


?interface
?interface(output)






######
#
# gslab - very old notes on maple<->emacs
#
######

(load-library "~/CRIM/gslab")
(find-fline "~/CRIM/gslab.el")
(eeg "1+2;\n")
(eegs "3+4;\n")
(find-etag "comint-mode")
(find-etag "c-mode")

(find-fline "~/CRIM/maplelab.el")
(load-library "~/CRIM/maplelab")

1+2;

?help
HC(`help`);
HC(`HC`);
?lprint
HC(`lprint`);
HC(`print`);
?print
?writeto
?echo


?screenheight

?interface
interface(screenheight=4000);

help('help');
HC('help');
?print
HC(`INTERFACE_HELP`);
?makehelp
?help[update]
?INTERFACE_HELP

(find-fline "/usr/local/maple/lib/maple.hdb")

cd /usr/local/maple/lib/
strings maple.hdb | agrep HYPERLNK

?Matlab
?index
?index[expression]
?index[function]
?index[misc]
?index[packages]
?index[procedure]
?index[statement]
?MapleTech

(eegs "q")

HC(`plots/conformal`);
HC(`plots/conformal2`);









~/nicolau/kasteleyn/
  x2matrix.c

~/nicolau/kasteleyn/edrx/
  8x8

  ../x2matrix 8x8
  (produz 8x8.{mt,out})

maple
read `/home/boto/nicolau/kasteleyn/edrx/8x8.mt`:
# det(M)
l:=array(1..100):
b:=array(1..100):
for i to 100 do l[i] := det(subs(q=i, evalm(M)))/i^34: b[i]:=i: od:
P:=interp(b,l,q):
R:=[fsolve(P,q,complex)]:
for i to 84 do printf(`%f %f\n`, Re(R[i]), Im(R[i])): od:

export DISPLAY=:0.0
gnuplot <<'EOF'
set parametric
set trange [-pi:pi]
plot cos(t),sin(t)
replot "/home/boto/nicolau/kasteleyn/edrx/rts.txt"


A := [[1, 2], [3, 4]];
eval(A * A);





#####
#
# Making a help file
# 99nov05
#
#####

# «ohm»

emaple -w -np -s '
# (find-es "maple" "ohm")
?
?TEXT
?colon
?example
?index
?intro
?keyword
?makehelp
?plot
?plots
?process
?process[block]
?process[exec]
?process[fork]
?process[kill]
?process[pclose]
?process[pipe]
?process[popen]
?process[wait]
?quit
?quotes
?worksheet
' -q | tee ~/o

tr -d \\r < ~/o | perl -nle 's/^\%\%\> \?(.*)$/\n\n# «\1»\n#/; print' \
  > ~/ohm

# (find-fline "~/ohm")
# (find-mapleh "index")
# (find-mapleh "plot")

# (find-mapleh "process")







######
#
# Frutilly esqueleto
#
######

Problema dos palitos do frutilly esqueleto: se eu já comprei s
sorvetes eu tenho uma certa chance de ter palitos de t=0 tipos, outra
de ter de t=2 tipos, etc., até de t=10 tipos.

frutilly := proc(s,t)
  option remember;
  if s = 0 then
    if t = 0 then 1
    else 0
    fi
  else frutilly(s-1, t) * t             # palito repetido
     + frutilly(s-1, t-1) * (11-t)	# palito que eu nao tinha
  fi
end:

frutilly(2,1);
frutilly(2,2);

frutilly(3,3);
frutilly(3,2);
frutilly(3,1);

frutilly(18,10);
frutilly(18,10)/10^18;

op(4, eval(frutilly));

A := array(1..5, 1..5);
for s from 1 to 5 do
  for t from 1 to 5 do
    A[s,t] := frutilly(s,t);
  od;
od;
eval(A);






######
#
# Random notes
#
######

# Heck, p.123
#
polyeqn := x^3 - a*x = 1;
sols := solve( polyeqn, x );



# Heck, p.306:
array(1..10, p -> frutilly(4,p));

?matrix
?hilbert
?linalg,hilbert
with(linalg);
HC(linalg[hilbert]);
HC(`linalg/hilbert`);

A := array(1 .. n, 1 .. n, 'symmetric');
for i to n do for j from i to n do A[i, j] := 1/(i + j - x) od od;

#*
cat > $EEG <<'---'
with(linalg);
# nopause();
A := [[x, 1, 0, -5, 0, 0],
      [-1, x, 0, 0, 0, -5],
      [-1, 0, x, 0, 1, 0],
      [0, 0, -1, x, 0, 1],
      [0, -1, -1, 0, x, 0],
      [0, 0, 0, -1, -1, x]];
Det(A);
det(A);
---
eeg /usr/local/maple/bin/maple
#*




#####
#
# Problema da Paula
# 2001mar31
#
#####

# P_A = a + d + e + g;
# P_B = b + d + f + g;
# P_C = c + e + f + g;
#
#   +-----+C
#   |  c  |
#  +|---+ |
#  || +---|+
#  ||e|g|f||
#  |+-----+|
#  |a |d| b|
# A+--|-+  |
#     +----+B
#
# roAB := P_AxorB / P_AuB;
# RoAB := roAB * P_AuB * P_AuC * P_BuC;
## i.e.,
# RoAB := P_AxorB      * P_AuC * P_BuC;

#*
cat > $EEG <<'---'
P_AxorB := a + e + b + f;
P_BxorC := b + d + c + e;
P_AxorC := a + d + c + f;
P_AuBuC := a + b + c + d + e + f + g;
P_AuB := P_AuBuC - c;
P_AuC := P_AuBuC - b;
P_BuC := P_AuBuC - a;
RoAB := P_AxorB * P_AuC * P_BuC;
RoAC := P_AxorC * P_AuB * P_BuC;
RoBC := P_BxorC * P_AuB * P_AuC;
expand(RoAB + RoBC - RoAC);
quit
---
#eeg /usr/local/maple/bin/maple
eeg -c 'set prompt %%>; set fast 1' /usr/local/maple/bin/maple  |& tee ~/o
#*




#####
#
# Maple 11
# 2010jul20
#
#####

# «maple-11»  (to ".maple-11")
# (find-fline "/tmp/pen/maple_11_for_linux__original/")
* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
sudo mkdir /sda5/maple/
sudo chown edrx:edrx /sda5/maple/
cp -rv /tmp/pen/maple_11_for_linux__original/ /sda5/maple/
sudo mv /sda5/maple/maple_11_for_linux__original/ /sda5/
sudo rmdir /sda5/maple/
# (find-fline "/sda5/maple_11_for_linux__original/")
# (find-fline "/sda5/maple_11_for_linux__original/install.nfo")
# (find-fline "/sda5/maple_11_for_linux__original/License/")

* (fvwm-sloppy-focus)
* (eexterm "A")
* (fvwm-click-to-focus)
cd /sda5/maple_11_for_linux__original/
./Maple11Linux32Installer.bin |& tee /tmp/o
# (find-fline "~/maple11/")
# (find-fline "~/maple11/license/")
cp -v /sda5/maple_11_for_linux__original/License/license-linux.dat ~/maple11/license/license.dat

# (find-fline "~/maple11/bin/maple")
~/maple11/bin/maple
quit;

~/maple11/bin/xmaple

(defun eepitch-maple () (interactive) (eepitch-comint "maple" "~/maple11/bin/maple"))

* (eepitch-maple)
* (eepitch-kill)
* (eepitch-maple)
*;; (find-angg ".mapleinit")
interface(screenheight=4000);
?
? colon

# (find-fline "~/maple11/samples/CodeGeneration/ANSIC/Definition.mm")




#  Local Variables:
#  coding:               raw-text-unix
#  ee-delimiter-hash:    "\n#*\n"
#  ee-delimiter-percent: "\n%*\n"
#  ee-anchor-format:     "«%s»"
#  End: