home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / sci / math / symbolic / 3006 < prev    next >
Encoding:
Text File  |  1992-11-17  |  33.8 KB  |  786 lines

  1. Newsgroups: sci.math.symbolic
  2. Path: sparky!uunet!charon.amdahl.com!pacbell.com!sgiblab!darwin.sura.net!wupost!gumby!yale!yale.edu!ira.uka.de!chx400!bernina!neptune!monagan
  3. From: monagan@inf.ethz.ch (Michael)
  4. Subject: Maple V Release 2
  5. Message-ID: <1992Nov17.175815.20205@neptune.inf.ethz.ch>
  6. Keywords: Maple
  7. Sender: news@neptune.inf.ethz.ch (Mr News)
  8. Nntp-Posting-Host: rutishauser-gw.inf.ethz.ch
  9. Organization: Dept. Informatik, Swiss Federal Institute of Technology (ETH), Zurich, CH
  10. Date: Tue, 17 Nov 1992 17:58:15 GMT
  11. Lines: 773
  12.  
  13. Second part of whats new in Release 2 ...
  14.  
  15. New and Enhanced System Facilities
  16. ==================================
  17.  
  18. 1: Type declarations for parameters
  19. -----------------------------------
  20. Procedures accept type declarations as illustrated by the following example.
  21. The purpose of this facility is to encourage better type checking by making
  22. it easy to write and efficient.
  23.  
  24.     proc( a:t ) 
  25.         ....
  26.     end
  27.  
  28. is equivalent to writing
  29.  
  30.     proc(a)
  31.         if nargs > 0 and not type(a,'t') then ERROR(message) fi;
  32.         ....
  33.     end
  34.  
  35. Note, the type checking is not static, it is done when the procedure is called.
  36. The error message generated automatically is illustrated by this example
  37.  
  38.   > f := proc(n:integer) if n < 0 then 0 else n fi end:
  39.   > f(x);
  40.   Error, f expects its 1st argument, n, to be of type integer, but received x
  41.  
  42. 2: D extended to computation sequences and programs
  43. ---------------------------------------------------
  44. The D operator can now compute partial derivatives of functions which are
  45. defined as procedures.  This is known as automatic differentiation.  Consider
  46.  
  47.   > f := proc(x) local t1,t2;
  48.   >     t1 := x^2;
  49.   >     t2 := sin(x);
  50.   >     3*t1*t2+2*x*t1-x*t2
  51.   > end:
  52.   > # The following computes the derivative of f wrt x, the first argument   
  53.   > D[1](f);
  54.  
  55.   proc(x) local t1x,t2x,t1,t2;
  56.       t1x := 2*x;
  57.       t1 := x^2;
  58.       t2x := cos(x);
  59.       t2 := sin(x);
  60.       3*t1x*t2+3*t1*t2x+2*t1x*x+2*t1-t2x*x-t2
  61.   end
  62.  
  63. The reader can check that this really does compute the derivative of f by
  64. verifying that diff(f(x),x) - D(f)(x) = 0.  The advantage of automatic
  65. differentiation is twofold.  Firstly, it is much more efficient, in general, to
  66. represent a function as a program instead of as a formula.  Secondly, it is
  67. more general as functions can have conditional statements and loops.
  68. For example, given the array of the coefficients of a polynomial b,
  69. we can represent the polynomial as a program in Horner form as follows.
  70.  
  71.   > f := proc(x,b,n) local i,s;
  72.   >     s := 0;
  73.   >     for i from n by -1 to 0 do s := s*x+b[i] od;
  74.   >     s   
  75.   > end:
  76.   > f(x,b,4);
  77.                 (((b[4] x + b[3]) x + b[2]) x + b[1]) x + b[0]
  78.  
  79.   > fx := D[1](f);
  80.   fx := proc(x,b,n)
  81.         local sx,i,s;
  82.             sx := 0;
  83.             s := 0;
  84.             for i from n by -1 to 0 do  sx := sx*x+s; s := s*x+b[i] od;
  85.             sx
  86.         end
  87.  
  88. 3: Program optimization -- optimize extended to computations sequences
  89. ----------------------------------------------------------------------
  90. The optimize routine has been extended to optimize Maple procedures.
  91. Currently it does common subexpression optimization on computation sequences,
  92. i.e. procedures with assignment statements to local variables only, e.g.
  93.  
  94.   > f := proc(x) local t; t := x^2; 3*t*sin(x)+2*x*t-x*sin(x) end:
  95.   > readlib(optimize)(f);
  96.   proc(x) local t,t1; t := x^2; t1 := sin(x); 3*t*t1+2*x*t-x*t1 end
  97.  
  98. 4: Multiple libraries -- readlib takes multiple pathnames
  99. ---------------------------------------------------------
  100. Maple automatically reads code from the Maple library using the readlib
  101. function.  The global variable libname specifies where the Maple library is.
  102. This can now be assigned a sequence of names.  E.g. if the user does
  103.  
  104.   > libname := dir1, libname, dir3;
  105.  
  106. this means that when readlib(f) is executed, Maple will search for f first
  107. under dir1, and if unsuccessful, it will search under the Maple library,
  108. and if unsuccessful under dir3.  This means users can have their own
  109. development library and have it override the Maple library.
  110.  
  111. 5: Assume facility
  112. ------------------
  113. One of the deficiencies of Maple and other systems is in handling problems
  114. which contain symbolic parameters where the result depends on the domain or
  115. range of values that the symbolic parameter(s) takes.  E.g. consider
  116.  
  117.   > Int( exp(-a*t)*ln(t), t=0..infinity );
  118.  
  119.                           infinity
  120.                              /
  121.                             |
  122.                             |      exp(- a t) ln(t) dt
  123.                             |
  124.                            /
  125.                            0
  126.  
  127. The answer to this integral depends on the value of the parameter a.  If a is
  128. real and positive, the answer is finite.  If a is real and non-positive, the
  129. answer is infinite.  How can the user tell Maple that a is real and positive?
  130. The solution adopted in Release 2 is to insist that the user state the
  131. assumption about a, i.e. that a is real and positive as follows
  132.  
  133.   > assume(a>0);
  134.  
  135. The result of this assumption is that the variable a has been assigned a new
  136. value which prints as a~ which Maple knows is real (implicitly) and positive.
  137.  
  138.   > a;
  139.                                        a~
  140.  
  141.   > about(a);
  142.   Originally a, renamed a~:
  143.     is assumed to be: RealRange(Open(0),infinity)
  144.  
  145. The assume facility is presently being integrated into Maple, in particular,
  146. Maple can now compute the definite integral above because Maple can determine
  147. that a is positive because signum(a) returns 1.
  148.  
  149.   > signum(a);
  150.                                        1
  151.  
  152.   > int( exp(-a*t)*ln(t), t=0..infinity );
  153.  
  154.                                   ln(a~)   gamma
  155.                                 - ------ - -----
  156.                                     a~       a~
  157.  
  158.   > is(a+1>0);
  159.                                       true
  160.  
  161. A deficiency of the assume facility is that the user needs to know what to
  162. assume in order to get answers out of facilities like definite integration.
  163. We are presently looking at alternative solutions including prompting the
  164. user for help or returning a solution along with the assumptions made.
  165.  
  166. 6: Automatic complex numeric arithmetic
  167. ---------------------------------------
  168. Complex arithmetic in Maple V had to be done with the evalc function.
  169. Now, complex numeric arithmetic is automatic, e.g.
  170.  
  171.   > (2+I/3)^2;
  172.                                   35/9 + 4/3 I
  173.  
  174. And complex floating point arithmetic
  175.  
  176.   > sin( (2.0+I/3)^2 );
  177.  
  178.                           - 1.378776230 - 1.294704958 I
  179.  
  180. The evalc function is now used only for exact symbolic expansions e.g.
  181.  
  182.   > evalc(exp(2+Pi/3*I));
  183.                                                     1/2
  184.                          1/2 exp(2) + 1/2 I exp(2) 3
  185.  
  186.   > evalc( sqrt(a+I*b) );
  187.  
  188.         2    2 1/2         1/2                          2    2 1/2         1/2
  189.  (1/2 (a  + b )    + 1/2 a)    + I csgn(b - I a) (1/2 (a  + b )    - 1/2 a)
  190.  
  191.   > assume(a>0);
  192.   > assume(b>0);
  193.   > evalc(sqrt(a+b*I));
  194.  
  195.              2     2 1/2          1/2             2     2 1/2          1/2
  196.      (1/2 (a~  + b~ )    + 1/2 a~)    + I (1/2 (a~  + b~ )    - 1/2 a~)
  197.  
  198. 7: Arrow operators now accept if statements
  199. -------------------------------------------
  200. The arrow operators, e.g.  x -> x/(x^2-1);  have been extended to handle
  201. if statements so that they can be used to define piecewise functions.
  202. E.g.  x -> if x < 0 then 0 elif x < 1 then x else 0 fi;
  203.  
  204. 8: I/O facilities and changes
  205. -----------------------------
  206. - printf: output a given expression with format (as in the C
  207.   printf, with the added option of %a for algebraic), and also
  208.   includes the C escapes: \b for backspace, \t for tab, \n for newline, e.g.
  209.  
  210.   > printf(`n = %d\tvar = %s\tresult = %a\n`, 10, y, 3*y^2+1);
  211.   n = 10  var = y result = 3*y^2+1
  212.  
  213. - sscanf: decode a string according to a format (inverse of
  214.    printf, identical to the C sscanf function).
  215. - input (tty and read) and output (lprint and save) of numbers in scientific
  216.    E/e notation e.g. 1.2e+3 versus Float(12,2) or 1.2*10^3
  217. - readline: read a line of an arbitrary file and return it as a string
  218. - parse: parse a string into a Maple expression
  219. - readdata: reads a file of numerical data arranged in columns
  220. - output (lprint and save) of powers using ^ instead of **
  221.  
  222. 9: Restart facility
  223. -------------------
  224. The restart statement will clear all user and system variables and
  225. reinitialize the kernel, essentially allowing you to start your Maple
  226. session from scratch without having to exit Maple.
  227.  
  228. 10: errorbreak
  229. --------------
  230. Maple has added some user control for how Maple responds on encountering errors
  231. when reading in a file.  This is provided by the interface option errorbreak.
  232. - With interface(errorbreak=0); the entire input file is read and all errors
  233.   that are encountered are displayed.  This was the Maple V behaviour.
  234. - With interface(errorbreak=1); processing stops after the first syntax error
  235.   thus avoiding nonsensical multiple syntax error messages that are often
  236.   consequences of the first one.  This is the new default behaviour.
  237. - With interface(errorbreak=2); processing stops after the first error,
  238.   whatever it is, i.e. syntax (parse time) or semantic (execution) errors.
  239.  
  240.  
  241. Algorithmic and Efficiency Improvements
  242. =======================================
  243.  
  244. 1: Integration of rational functions
  245. ------------------------------------
  246. The Trager-Rothstein algorithm computes the integral of a rational function
  247. f(x) over a field K as a sum of logs over K(alpha), an algebraic extension
  248. of K of minimial degree.  E.g. consider the following rational function
  249. in Q(x) where note the denominator is irreducible over Q.
  250.  
  251.   > f := (6*x^5+6*x^2-4*x+8*x^3-4)/(x^6+2*x^3+1-2*x^2);
  252.                                5      2            3
  253.                             6 x  + 6 x  - 4 x + 8 x  - 4
  254.                        f := ----------------------------
  255.                                  6      3          2
  256.                                 x  + 2 x  + 1 - 2 x
  257.  
  258. Applying the Trager-Rothstein algorithm yields the following result
  259.  
  260.                        -----
  261.                         \              3
  262.       (1 + alpha)        )         ln(x  - alpha x + 1)
  263.                         /
  264.                        -----
  265.                         2
  266.                   (alpha  - 2) = 0
  267.  
  268. I.e. there are two logs corresponding to two roots +- sqrt(2) of the
  269. polynomial alpha^2-2 = 0.  Hence, Maple gets the following nice result
  270.  
  271.   > int(f,x);
  272.  
  273.               1/2      3    1/2                1/2      3    1/2
  274.         (1 + 2   ) ln(x  - 2    x + 1) + (1 - 2   ) ln(x  + 2    x + 1)
  275.  
  276. The first improvement in Release 2 is in handling coefficient fields which are
  277. function fields, and not just number fields.  I.e. the input rational function
  278. could involve parameters as well as numbers.  This is because of the extension
  279. of evala to handle algebraic functions and not just algebraic numbers.
  280. A second improvement due to Lazard and Trager allows for more efficient
  281. computation of the terms inside the logarithms.  A third improvement by Rioboo
  282. improves the presentation of the result.  An example of the latter is
  283.  
  284. > f := (x^4-3*x^2+6)/(x^6-5*x^4+5*x^2+4);
  285.  
  286.                                      4      2
  287.                                     x  - 3 x  + 6
  288.                            f := --------------------
  289.                                  6      4      2
  290.                                 x  - 5 x  + 5 x  + 4
  291. > int(f,x);
  292.  
  293. The Trager-Rothstein algorithm (Maple V) obtains this result
  294.  
  295.        1/2 I ln(x  + I x  - 3 x - 2 I) - 1/2 I ln(x  - I x  - 3 x + 2 I)
  296.  
  297. Rioboo's algorithm (Release 2) yields this real result which has no new poles
  298.  
  299.            arctan(- 3/2 x  + 1/2 x  + 1/2 x) + arctan(x ) + arctan(x)
  300.  
  301. 2: Bivariate polynomial Gcd's over Z
  302. ------------------------------------
  303. We have implemented the dense modular method of Collins for computing GCDs of
  304. polynomials with in two variables with integer coefficients.  This improves the
  305. efficiency of simplifying rational expressions in two variables.  The method
  306. works by computing many GCDs of polynomials in one variable modulo
  307. different primes and combining these solutions using polynomial interpolation
  308. and the Chinese remainder theorem.  Note, in Maple V, we implemented this
  309. method for univariate polynomials.  Also, this is a dense method. For sparse
  310. polynomials in many variables it is not a good method.  Comparing this with
  311. the default EEZ-GCD algorithm in Maple V, we obtain the following improvement.
  312. We created three dense bivariate polynomials g,a,b each of degree n with
  313. random n digit coefficients and computed the gcd(a*g, b*g).
  314.  
  315.     n                   10     15      20
  316.     Maple V             65.0   1,877   18,763
  317.     Release 2          10.6   33.7    393.7
  318.  
  319. 3: Factorization over algebraic number fields
  320. ---------------------------------------------
  321. We have implemented Lenstra's algorithm for factorization of polynomials over an
  322. algebraic number field.  For some polynomials it runs considerably faster than
  323. the default algorithm.  But it depends very much on the polynomial.
  324.  
  325. 4: Faster numerical evaluation of the arctrig functions
  326. -------------------------------------------------------
  327. The running time of the algorithms used for the numerical evaluation of
  328. exp(x) and ln(x) at high precision is O(n^2 log[2] (n)) for n digits.
  329. This is O(log[2](n)) integer multiplications each of which is O(n^2).
  330. The algorithms for the trig functions sin, cos, tan use repeated argument
  331. reduction to obtain an O(n^(5/2)) algorithm.  The same idea is now used
  332. by the arctrig functions, e.g.
  333.  
  334.         Digits    arcsin(Pi/4)                arctan(Pi/4)
  335.               Maple V    Release 2        Maple V    Release 2
  336.  
  337.          500      25       3.0                 23       2.5
  338.         1000     176      11.0                148      11.2
  339.         2000    1245      50.4               1038      45.2
  340.  
  341. 5: Optimized the evaluation of numerical arithmetic
  342. ---------------------------------------------------
  343. Evaluation of numerical expressions e.g. n-i+1, 2*n-2*j+2, has been sped up to
  344. avoid the creation of an intermediate data structure.  This is a significant
  345. improvement in the cases of small integers, e.g. array subscript calculations.
  346. Consider these two codes for computing the Fibonacci numbers F(n)
  347.  
  348.   > F1 := proc(n) if n < 2 then n else F1(n-1)+F1(n-2) fi end;
  349.   > F2 := proc(n) F2(n-1)+F2(n-2) end; F2(0) := 0; F2(1) := 1;
  350.  
  351. The improvement in the arithmetic that occurs in F(n-1)+F(n-2) yields
  352.  
  353.                  Maple V          Release 2
  354.          n         F1     F2       F1     F2
  355.         16        1.05   0.73     0.78   0.47
  356.         18        2.73   2.17     2.17   1.32
  357.         20        7.30   5.20     5.92   3.55
  358.         22       20.17  13.45    15.20   8.53
  359.  
  360. 6: Floating point solutions to polynomials
  361. ------------------------------------------
  362. We have rewritten the code for computing floating point approximations to roots
  363. of polynomials.  The new code will increase the intermediate precision so that
  364. the roots found are fully accurate, i.e. accurate to 0.6 ulp.  We have
  365. also implemented a routine in the kernel in C to use hardware floating point
  366. arithmetic.  If the roots found using this routine are accurate then the fsolve
  367. routine will execute faster, as illustrated in the following examples.  T(n,x)
  368. is the n'th Chebyshev polynomial of the first kind.  It has all real roots.
  369. F(n,x) is the n'th Fibonacci polynomial which has all complex roots except 0.
  370. The jump in times indicates where hardware precision is no longer sufficient.
  371.  
  372.                 Maple V                 Release 2
  373.         n       T(n,x)  F(n,x)          T(n,x)  F(n,x)
  374.         10      1.68    1.86             0.45    0.23
  375.         20      8.95    11.43            2.17    1.43
  376.         30      FAIL    36.72            6.08    3.47
  377.         40              FAIL            34.22    7.57
  378.         50                              106.2   50.45
  379.  
  380. 7: Character tables for Sn
  381. --------------------------
  382. In computing the character table for S_n the symmetric group on n letters we
  383. are now making use of the conjugate partitions and symmetry in the table.
  384. The improvement is better than a factor of 2 for large n.  Note the table has
  385. dimension p(n) by p(n) where p(n) is the number of partitions of n so requires
  386. exponential space in n to store.
  387. The data here are for computing combinat[character](n)
  388.  
  389.                 Maple V         Release 2
  390.         n
  391.         8         6.6             3.5
  392.         10       26.0            12.6
  393.         12      102.0            43.4
  394.         14      446.8           160.3
  395.  
  396.  
  397. New Library Functions
  398. =====================
  399.  
  400. - AFactor, AFactors: absolute factorization over the complex numbers
  401. - argument: complex argument of a complex number
  402. - assume: for making assumptions about variables
  403. - ceil: ceiling function
  404. - csgn: complex sign
  405. - discont: compute a set of possible discontinuities of an expression
  406. - floor: floor function
  407. - fourier, invfourier: symbolic fourier transform and inverse
  408. - ilog, ilog10: IEEE integer logarithm function
  409. - Indep: test algebraic extensions over Q for independence
  410. - invfunc: table of inverse functions
  411. - is, isgiven: for testing properties against the assume database
  412. - makehelp: for making a Maple help page from a file of text
  413. - maxorder: an integral basis for an algebraic number or function field
  414. - Norm: computes the norm of the algebraic number or function
  415. - Primfield: computes a primitive element over a given algebraic number field
  416. - powmod: computes a(x)^n mod b(x) using binary powering
  417. - ratrecon, Ratrecon: rational function reconstruction (Euclidean algorithm)
  418. - readdata: reads a file of numerical data arranged in columns
  419. - spline: computes a natural cubic spline from a set of data
  420. - split: splits a polynomial into linear factors over its splitting field 
  421. - sqrfree: a square free factorization of a multivariate polynomial
  422. - symmdiff: symmetric difference of sets
  423. - tutorial: on-line tutorial facility
  424. - Trace: computes the trace of the algebraic number or function
  425. - unload: unload a Maple library function
  426.  
  427.  
  428. Library Packages
  429. =================
  430.  
  431. The package mechanism has been extended to support an initialization routine.
  432. The initialization routine should be placed either in the package as the
  433. routine  package[init],  or as the routine `package/init` in the library in
  434. the file `package/init.m`;  This routine is executed by  with(package);
  435. It is up to the initialization routine to decide what to do if it is called
  436. a second time.
  437. Below is a list of the new packages and modifications to existing packages.
  438.  
  439. 1: numapprox (Numerical Approximation Package)
  440. ----------------------------------------------
  441. - pade: computes a Pade rational function approximation
  442. - infnorm: compute the (weighted) infinity norm of an approximation
  443. - minimax: compute a (weighted) minimax numerical approximation
  444. - remez: Remez algorithm for minimax rational function approximation
  445. - chebpade: compute a Chebyshev-Pade rational function approximation
  446. - chebyshev: compute a Chebyhev series numerical approximation
  447. - confracform: convert a rational function to a continued fraction
  448. - hornerform: convert a polynomial or rational function to Horner form
  449.  
  450. The call minimax(f(x),x=a..b,[m,n],w) uses the Remez algorithm to
  451. compute the best minimax rational function with numerator of degree <= m and
  452. denominator of degree <= n (Note: n can be zero meaning a polynomial) to the
  453. function f(x) on the range [a,b].  The optional 4'th paramter w specifies
  454. a weight function (default 1).  For example, here is a [4,3] rational
  455. approximation to erf(x) on [0,3] which we've rounded to 7 decimal digits.
  456. The approximation is accurate to 4 digits on [0,3].
  457.  
  458.   > evalf(minimax(erf(x),x=0..3,[4,3]), 7);
  459.  
  460.     - .000088319 + (1.132571 + ( - .4507723 + (.1724417 - .0209750 x) x) x) x
  461.    --------------------------------------------------------------------------
  462.                 1. + ( - .3706125 + (.4051100 - .04578747 x) x) x
  463.  
  464.  
  465. 2: DEtools (Differential Equation Tools Package)
  466. ------------------------------------------------
  467. A package for plotting differential equations including systems of ODE's
  468. and some special PDE's, allowing the associated vector field to be plotted
  469. and solution curves for different initial conditions.
  470. - DEplot: plot a single ODE or a system of first order ODEs
  471. - DEplot1: plot a first order ODE
  472. - DEplot2: plot a system of two first order ODEs
  473. - PDEplot: plot the surface of a first order, quasi-linear PDE of the form
  474.   P(x,y,u) * D[1](u)(x,y) + Q(x,y,u) * D[2](u)(x,y) = R(x,y u)
  475. - dfieldplot: plot a field plot for a single or two first order linear ODEs
  476. - phaseportrait: plot a phase plot for a single or two first order linear ODEs
  477.  
  478. 3: Gauss
  479. --------
  480. A package which allows one to create "domains" of computation in a similar way
  481. that the AXIOM system allows.  The advantage is that routines for computing
  482. with polynomials, matrices, and series etc. can be parameterized by any
  483. coefficient ring.  E.g. given a ring R, the Gauss statement
  484.  
  485.   > P := DenseUnivariatePolynomial(R,x):
  486.  
  487. creates a dense univariate polynomial domain P which contains all the routines
  488. needed to do arithmetic with polynomials over R.  The advantage is that the
  489. the code supplied by the DenseUnivariatePolynomial function works for any
  490. coefficient domain R which is a ring, i.e. has operations +, -, *, etc.
  491. It is expected that many Maple library routines will be recoded in Gauss over
  492. the next few versions.  The initial implementation includes basic facilities
  493. for computing with polynomials, matrices and series over number rings,
  494. finite fields, polynomial rings, and matrix rings.
  495.  
  496. 4: GaussInt (Gaussian Integer Package)
  497. --------------------------------------
  498. This is a set of routines for computing with Gaussian (complex) integers, i.e.
  499. numbers of the form a + b I where a and b are integers.  Included are routines
  500. for computing the Gcd of two Gaussian integers, the factorization of a Gaussian
  501. integer, and a test for primality, e.g.
  502.  
  503.   > GIfactor(13);
  504.                               (3 + 2 I) (3 - 2 I)
  505.  
  506. 5: linalg (Linear Algebra Package)
  507. ----------------------------------
  508. - blockmatrix: utility routine to create a block matrix
  509. - gausselim, gaussjord, rowspace, colspace: now handle matrices of
  510.   floats, complex floats, and complex rationals
  511. - eigenvals, eigenvects: now handle matrices of floats and complex floats
  512. - entermatrix: utility routine for entering the entries of a matrix
  513. - randvector: utility routine to create a random vector
  514. - ratform: (synonym for frobenius) computes the rational canonical form
  515. - Wronskian: computes the Wronskian matrix
  516.  
  517. 6: numtheory: (Number Theory Package)
  518. -------------------------------------
  519. - cfrac: modified to handle different forms of continued fractions
  520.         real numbers, series, polynomials.
  521. - cfracpol: computes continued fractions for the real roots of a polynomial
  522. - kronecker: Diophantine approximation in the inhomogeneous case
  523. - minkowski: Diophantine approximation in the homogeneous case
  524. - nthnumer: returns the denominator of the n'th convergent
  525. - nthdenom: returns the numerator of the n'th convergent    
  526. - nthconver: returns the n'th convergent of a simple continued fraction
  527. - thue: compute the resolutions of Thue equations or Thue inequalities
  528. - sq2factor: factorization in the UFD Z[sqrt(2)]
  529.  
  530. 7: padic (Padic Number Package)
  531. -------------------------------
  532. A package for computing P-adic approximations to real numbers, e.g.
  533.  
  534.   > with(padic):
  535.   > evalp(sqrt(2),7);
  536.  
  537.                       2      3    4      5    6      7      8      9
  538.            3 + 7 + 2 7  + 6 7  + 7  + 2 7  + 7  + 2 7  + 4 7  + O(7 )
  539.  
  540.   > evalp(exp(3),3);
  541.                             2      3      4    6    8      9
  542.                    1 + 3 + 3  + 2 3  + 2 3  + 3  + 3  + O(3 )
  543.  
  544. 8: plots (Plots Package)
  545. ------------------------
  546. - animate: animate one or more functions in 2 dimensions, e.g.
  547.   a) sine - cosine waves
  548.      animate({sin(x*t),cos(x*t)},x=-2*Pi..Pi,t=0..2*Pi);
  549.   b) a polar coordinate unraveling
  550.      animate([sin(x*t),x,x=-4..4],t=1..4,coords=polar,numpoints=100,frames=100);
  551.  
  552. - animate3d: animate one or more curves or surfaces in 3 dimensions, e.g.
  553.    animate3d(cos(t*x)*sin(t*y), x=-Pi..Pi, y=-Pi..Pi,t=1..2);
  554.  
  555. - conformal: routine is typically 3 times faster
  556. - contourplot: contour plot of a 3 dimensional surface, e.g.
  557.    contourplot(sin(x*y),x=-Pi..Pi,y=-Pi..Pi,grid=[30,30]);
  558.  
  559. - densityplot: density plot, e.g.
  560.    densityplot(sin(x*y),x=-Pi..Pi,y=-Pi..Pi,grid=[30,30]);
  561.  
  562. - fieldplot: plot of a 2 dimensional vector field
  563.    vfield := [x/(x^2+y^2+4)^(1/2),-y/(x^2+y^2+4)^(1/2)]:
  564.    fieldplot(vfield,x=-2..2,y=-2..2);
  565. - fieldplot3d: plot of a 3 dimensional vector field
  566.    fieldplot3d([2*x,2*y,1],x=-1..1,y=-1..1,z=-1..1,
  567.                grid=[10,10,5],arrows=THICK,style=patch);
  568.  
  569. - gradplot: plot the gradient vector field of a 2 dimensional function
  570. - gradplot3d: plot the gradient vector field of a 3 dimensional function, e.g.
  571.    gradplot3d( (x^2+y^2+z^2+1)^(1/2),x=-2..2,y=-2..2,z=-2..2);
  572.  
  573. - implicitplot: plot a curve defined implicitly by F(x,y) = 0, e.g.
  574.    implicitplot( x^2 + y^2 = 1, x=-1..1,y=-1..1 );
  575. - implicitplot3d: plot a surface defined implicitly by F(x,y,z) = 0, e.g.
  576.    implicitplot3d( x^2+y^2+z^2 = 1, x=-1..1, y=-1..1, z=-1..1 );
  577.  
  578. - logplot: log plot, e.g. logplot(10^(20*exp(-x)),x=1..10);
  579. - loglogplot: log log plot, e.g. loglogplot(10^(20*exp(-x)),x=1..100);
  580.  
  581. - odeplot: plot the solution of an ODE from dsolve
  582.    p := dsolve({D(y)(x) = y(x), y(0)=1}, y(x), numeric):
  583.    odeplot(p,[x,y(x)],-1..1);
  584.  
  585. - polygonplot: draw one or more polygons in 2 dimensions
  586.    ngon := n -> [seq([ cos(2*Pi*i/n), sin(2*Pi*i/n) ], i = 1..n)]:
  587.    polygonplot(ngon(8));
  588. - polygonplot3d: draw one or more polygons in 3 dimensions
  589.  
  590. - polyhedraplot: for plotting tetrahedrons, octahedrons, hexahedrons,
  591.      dodecahedrons, icosahedrons e.g.
  592.    polyhedraplot([0,0,0],polytype=dodecahedron);
  593.  
  594. - surfdata: plot a surface input as a grid of data points
  595.    cosdata := [seq([ seq([i,j,evalf(cos((i+j)/5))], i=-5..5)], j=-5..5)]:
  596.    F := (x,y) -> x^2 + y^2:
  597.    surfdata( cosdata, axes=frame, color=F );
  598.  
  599. - textplot: for plotting labelled points in 2 dimensions, e.g.
  600.    textplot([1,2,`one point in 2d`],align={ABOVE,RIGHT});
  601. - textplot3d: for plotting labelled points in 3 dimensions, e.g.
  602.    textplot3d({[1,2,3,`one point in 3d`],[3,2,1,`second point in 3d`]});
  603.  
  604. 9: networks: (Graph Networks Package)
  605. -------------------------------------
  606. A package of routines for creating, manipulating and computing properties of
  607. graphs, i.e. graphs with edges and vertices.  Primitives exist for computing
  608. properties such as edge connectivity, biconnected components, and edge or
  609. vertex set induced subgraphs.  The graphs may have loops or multiple edges,
  610. both directed and undirected, and arbitrary weights can be associated with
  611. both edges and vertices.  Graphs can be drawn as a picture (a plot) for
  612. display.  For example, here we create the Petersen graph and compute and factor
  613. its characteristic polynomial.
  614.  
  615.   > with(networks):
  616.   > factor(charpoly(petersen(),x));
  617.  
  618.                                           4        5
  619.                            (x - 3) (x + 2)  (x - 1)
  620.  
  621. The spanpoly(G,p) function computes a polynomial for the undirected graph G
  622. where p is a probability of failure associated with each edge.  When G is
  623. connected, this is the all-terminal reliability polynomial of G.  Here is the
  624. all-terminal reliability polynomial for the complete graph on 4 vertices.
  625.  
  626.   > spanpoly(complete(4),p);
  627.  
  628.                           3                    2      3
  629.                        - p  (- 16 + 33 p - 24 p  + 6 p )
  630.  
  631.  
  632. Share Library
  633. =============
  634.  
  635. 1: Contributions from Maple users
  636. ---------------------------------
  637. The share library is a repository of applications codes, contributed primarily
  638. by Maple users.  It is distributed with each version of Maple in both src and
  639. Maple ".m" format.  The share library is being reorganized.  Beginning with
  640. this version, it also includes
  641. - TeX/LaTeX introductory documents on using Maple
  642. - TeX/LaTeX support documentation for applications codes
  643. - updates to library routines, i.e. bug fixes, efficiency improvements etc.
  644. - examples of applications of Maple to problem solving
  645. We have also endeavoured to ensure that each contribution comes with on-line
  646. Maple style help files, and Maple style test files to help us ensure that the
  647. code is working correctly.
  648.  
  649. 2: How to access code from the share library from inside Maple
  650. --------------------------------------------------------------
  651. Users can access routines in the share library by reading them in directly
  652. from the files using the read command.  Also, where appropriate, one can now
  653. access them directly from inside Maple using the with command.
  654.  
  655. The command with(share); looks to see if the share library exists, i.e. it
  656. is adjacent to the Maple library (it simply tries to read a file from it).
  657. If successful, it assigns the global variable sharename to the path where
  658. it found the share library, and then it executes the statement
  659.  
  660.   > libname := libname, sharename;
  661.  
  662. Now Maple's readlib command and with command will automatically search the
  663. share library after first searching the Maple library.  If unsuccessful, the
  664. user can locate the share library and set the libname variable directly.
  665. For example, the fit routine in the share library can be used to fit a
  666. formula to some data in the least squares sense.
  667.  
  668.   > with(share): # locate the share library
  669.   > readlib(fit): # now finds the fit routine from the share library
  670.   > fit([-1.5,0.5,1.5],[0,-2,-1.5], a*t^2+b*t+c, t);
  671.    
  672.                                2
  673.                   .4999999997 t  - .5000000001 t - 1.874999999
  674.  
  675.  
  676. Documentation for the code is in the file, i.e. after reading the file, ?fit
  677. will print out a regular Maple style help file.  Note, in many cases,
  678. additional documentation is included in TeX/LaTeX files.
  679. See ?share,contents for a summary of the contents of the share library.
  680.  
  681. 3: Electronic distribution version of the Maple share library
  682. -------------------------------------------------------------
  683. The share library will also be distributed electronically, firstly, over the
  684. internet by using anonymous ftp, and secondly, by electronic mail, with an
  685. electronic mail server.  The electronic version is be updated periodically,
  686. about once every 3 months, with new contributions, corrections to previous
  687. contributions etc.  Unlike the Maple version, it contains a directory of
  688. updates to the Maple library, primarily simple bug fixes.
  689. For directions on how to get code using anonymous ftp, electronic mail,
  690. and how to install it and use it, see ?share for details.
  691.  
  692. 4: Policy of the contributions to the share library
  693. ---------------------------------------------------
  694. The code in the share library has been contributed freely by the authors to be
  695. made freely available to all Maple users.  It is not to be sold for profit or
  696. changed without the author's permission.  Authors who contribute code to the
  697. share library will be asked to write Maple style on-line help documentation and
  698. a test file.  Authors will also be asked to sign a non-exclusive agreement to
  699. let us distribute your code, and to let us change your code to maintain it.
  700.  
  701.  
  702. Miscellaneous
  703. =============
  704.  
  705. - the catenation operator . now expands in ``.(a,b,c).(1..3) to yield
  706.     a1, a2, a3, b1, b2, b3, c1, c2, c3
  707.  
  708. - expand of @ and @@ now handled e.g. expand((sin@@)(2)(x) ); ==> sin(sin(x))
  709. - evalf of @ and @@ now handled e.g. evalf((sin@@2)(2)); ==> .7890723436
  710.  
  711. - anames(t) returns all names of type t
  712.  
  713. - a[1] := x; is dissallowed if a is assigned an object other than
  714.     an array or table
  715.  
  716. - f()[1] is now allowed; it returns unevaluated
  717.  
  718. - Changes to fortran and C
  719.   - use appendto instead of writeto to append output to a file instead of
  720.     overwriting it
  721.   - both now translate subscripts e.g. a[i-2*j] where the 2 here
  722.     is understood to be an integer
  723.   - both now convert symbolic constants e.g. Pi to floating point
  724.   - optional parameter  digits = n  for specifying the precision to be used
  725.     in converting constants to floating point
  726.   - C now also breaks up large expressions which otherwise cause
  727.      some compilers to break
  728.  
  729. - Changes to dsolve/numeric
  730.   The output of dsolve({...},{...},numeric) is a procedure f where f(x)
  731.   returns a tuple of values.  E.g dsolve({...},{y(x),z(x)},numeric);
  732.   returns f a procedure where f(1) returns  x=1, y(x)=y(1), z(x)=z(1)
  733.   The odeplot routine in the plots package can be used to plot the result.
  734.  
  735. - mellin speeded up by a factor of 4-30
  736.  
  737. - ifactor has been sped up for the case of a perfect power
  738.  
  739. - series(f(x),x=a); now allows +-infinity for a
  740.   > series(ln(1-x),x=-infinity);
  741.  
  742.                                   1      1      1      1        1
  743.             - ln(- 1/x) - 1/x - ---- - ---- - ---- - ---- + O(----)
  744.                                    2      3      4      5       6
  745.                                 2 x    3 x    4 x    5 x       x
  746.  
  747. - signum(f) where f is a symbolic constant will use interval arithmetic at
  748.   Digits precision to determine the sign of f, e.g. signum(Pi-4*sin(1));
  749.  
  750. - the for loop clauses by, to, from and while can now
  751.   appear in any order
  752.  
  753. - Changes to automatic simplifications
  754.   - the ln(1/x) ==> -ln(x) automatic simplification has been turned off.
  755.     ln(a^n) ==> n ln(a) is now done iff signum(a) = 1, i.e. x is provably +ve
  756.   - the ln(exp(x)) ==> x automatic simplification has been turned off.
  757.     ln(exp(x)) ==> x is now down iff Im(x) returns 0, i.e. x is provable real
  758.   - the automatic simplification sqrt(x^2) ==> x (incorrect for -ve x) is being
  759.     fixed for the next version (the change is more difficult than the others)
  760.   - the arcsin(sin(x)) ==> x arctrig simplifications have been turned off
  761.   - inverse functions simplifications have been added e.g. sin@@(-1) ==> arcsin
  762.   - trig simplifications for multiples of Pi/8, Pi/10, Pi/12 have been added
  763.   > sin(Pi/8), sin(Pi/10), sin(Pi/12);
  764.  
  765.                         1/2 1/2       1/2                  1/2 1/2
  766.               1/2 (2 - 2   )   , 1/4 5    - 1/4, 1/2 (2 - 3   )
  767.  
  768. - given a file of text, the makehelp function makes a Maple TEXT object out
  769.   of it, i.e. an on-line help page.  I.e. you can make your own help pages
  770.   which can be displayed using the ? command using this.
  771.  
  772. - Additional simplifications for Dirac and Heaviside, and the arc
  773.   trigonomentric functions are provided through the simplify facility, e.g.
  774.   > simplify( Heaviside(x-1)*Heaviside(x-3) );
  775.  
  776.                                 Heaviside(x - 3)
  777.  
  778.   > simplify( F(x+3)*Dirac(x) );
  779.  
  780.                                  F(3) Dirac(x)
  781.  
  782.   > simplify( arctan(x)+arctan(1/x) );
  783.  
  784.                                 1/2 signum(x) Pi
  785.  
  786.