home *** CD-ROM | disk | FTP | other *** search
-
- MUMATH%.DOC documentation for the muMATH files on this disk
-
- These files are to be used with the muMATH/muSIMP symbolic
- mathematics system. I will assume that anyone reading this
- has at least a minimal familiarity with that system. The
- files have been named according to the usual muSIMP scheme to
- display their dependences upon each other. Most of the files
- are intended as enhancements or replacements for files fur-
- nished with muMATH. I recommend that you keep the original
- files and give the new files different names, since you may
- sometimes want to use the old version instead of the new one.
-
- These files will allow many calculations to be done that could
- not be done with the original muMATH release. When PBRCH is
- non-false (so that picking a branch for a multi-valued function
- is expected), the calculation of #I^(2/3) as 1/2 + 3^(1/2)*#I/2
- can be carried out. Formulas for the solution of third and
- fourth degree equations are included. Exact values of many
- more of the trig functions can be obtained; for example
- COS(#PI/16) and SIN(11*#PI/15). Evaluation of the inverse
- trig functions are included, so that calculations like
- DEFINT(1/(1+X^2),X,MINF,PINF) can be done (answer: #PI).
- Also,values for the error function have been added, so that
- DEFINT(#E^-X^2,X,MINF,PINF) can be calculated. Many of the
- most common infinite series can be evaluated.
-
- Most of the files furnished here cannot be loaded as-is by
- muSIMP. I have included the character `%' in the names of
- such files: muSIMP will not load a file containing it unless
- the % is doubled. Instructions for creating a RDS-able file
- from the %-file are contained at the beginning of the file.
- Normally this is involves merging the file with one of the old
- muMATH files, using a text editor.
-
- Descriptions of the new files and/or the differences in the
- new versions are given below. I have included many
- calculator-mode examples. When you have loaded a new file,
- I recommend that you try at least a couple of the examples for
- that file to make sure it is working properly.
-
- I would be interested in hearing from other users of muMATH,
- especially those who have written programs to do non-trivial
- mathematical tasks. My address: Gerald Edgar, 107 W. Dodridge
- St., Columbus, OH 43202. Perhaps we can exchange programs
- (hard copy form, or even on disk - 8" CP/M only, please).
-
- G. A. Edgar
- March 1, 1982
-
- ============================================================
- ARITH.MUS
-
- This file is a replacement for the existing ARITH.MUS. The
- only difference is in evaluation of powers #I^R when PBRCH
- is non-false and the exponent is rational. In that case,
- #I^R is replaced by a complex exponential. Example:
-
- ? #I^(2/3);
- @: #E ^ (#I*#PI/3)
-
- ? TRGEXPD: -7;
- @: -7
-
- ? #I^(2/3);
- @: #I*SIN(#PI/3) + COS(#PI/3)
-
- With TRGNEG, we get:
-
- ? #I^(2/3);
- @: 1/2 + 3^(1/2)*#I/2
-
-
- ============================================================
- SOLVE4.EQN
-
- The file SOLVE4.EQN replaces SOLVE.EQN. It was constructed by
- adding the formulas for third and fourth degree equations to
- SOLVE.EQN. Usage is the same as described in the manual. (In
- some of the following examples, the new version of ARITH.MUS
- has made a difference.)
-
- ? SOLVE(9*X^3-3*X^2-8*X+4==0,X);
- @: {X == -1,
- X == 2/3+5*#I/(3^(1/2)*6)-3^(1/2)*5*#I/18}
-
- ? EXPD(@);
- @: {X == -1,
- X == 2/3}
-
- ? EXPD((X-1)*(X-2)*(X-3)*(X-4));
- @: 24 - 50*X + 35*X^2 - 10*X^3 + X^4
-
- ? SOLVE(@,X);
- @: {X == 4,
- X == 1,
- X == 3,
- X == 2}
-
- ? EXPD((X-1)*(X+1)*(X+3));
- @: -3 - X + 3*X^2 + X^3
-
- ? SOLVE(@,X);
- @: {X == -1+6/(3^(3/2)*#E^(#I*#PI/6))+2*#E^(#I*#PI/6)/
- 3^(1/2),
- X == -1-1/(3^(1/2)*#E^(#I*#PI/6))-#E^(#I*#PI/6)/
- 3^(1/2)+#I/#E^(#I*#PI/6)-#E^(#I*#PI/6)*#I,
- X == -1-1/(3^(1/2)*#E^(#I*#PI/6))-#E^(#I*#PI/6)/
- 3^(1/2)-#I/#E^(#I*#PI/6)+#E^(#I*#PI/6)*#I}
-
- ? TRGEXPD(@,-7);
- @: {X == 1-#I/3^(1/2)+#I/3^(1/2),
- X == -1,
- X == -3}
-
- ? EXPD(@);
- @: {X == 1,
- X == -1,
- X == -3}
-
- Of course, this last example used file TRGNEG.ALG for the
- evaluation of the complex exponentials.
-
- This file is not as useful as you might expect at first. I
- must admit that the above examples are contrived so that they
- will look good. To see an example where the formulas do not
- work well, try EXPD((X-1)*(X-2)*(X+4)); and then SOLVE(@,X);
- Can you get muMATH to simplify these roots to 1, 2, and -4 ?
- Can you even tell which root is 1 ?
-
-
- ============================================================
- TRGNEG.ALG
-
- This is a replacement for the existing TRGNEG.ALG. Exact
- evaluation of many more functions is now possible. SIN and COS
- of rational multiples of #PI, where the denominator is a power
- of 2 possibly multiplied by 3 or 5 (or both) are included.
- These are cases that can be evaluated using only square roots.
- (I have not included all such angles that are theoretically
- possible, such as #PI/17 and #PI/65537.) Examples:
-
- ? DENNUM: -6;
- @: -6
-
- ? COS(2*#PI/5);
- @: -1/4 + 5^(1/2)/4
-
- ? COS(#PI/16);
- @: (2^(3/4)+(1+2^(1/2))^(1/2))^(1/2) / 2^(7/8)
-
- ? SIN(11*#PI/15);
- @: (7-5^(1/2)+(30-5^(1/2)*6)^(1/2))^(1/2) / 4
-
-
- ============================================================
- ATRG.TRG
-
- This file handles inverse trigonometric functions. It depends
- on TRGNEG.ALG.
-
- The functions in this file are:
-
- ASIN(X) arc sine of X
- ACOS(X) arc cosine of X
- ATAN(X) arc tangent of X
- ACOT(X) arc cotangent of X
- ASEC(X) arc secant of X
- ACSC(X) arc cosecant of X
-
- Firstly, if PBRCH is non-false, these functions are all written
- in terms of ASIN and ATAN. Example:
-
- ? ACOS(U);
- @: #PI/2 - ASIN(U)
-
- Certain elementary reductions are carried out:
-
- ? ATAN(TAN(U));
- @: U
-
- ? ACOS(SIN(X));
- @: #PI/2 - X
-
- Inverse trig functions are evaluated in a few cases. (I
- have essentially just included a list of the cases in the
- program, probably not a very good algorithm.)
-
- ? ASIN(1/2);
- @: #PI / 6
-
- ? ASEC(2^(1/2));
- @: #PI / 4
-
- ? ATAN(MINF);
- @: -#PI / 2
-
- This is useful in connection with some of the other files:
-
- ? DEFINT(1/(1+X+X^2),X,-1/2,0);
- @: #PI / 3^(3/2)
-
- ? DEFINT(1/(1+X^2),X,MINF,PINF);
- @: #PI
-
- This feature is helpful also with SERIES.DIF, described below.
-
- When TRGEXPD is a positive multiple of 7, inverse trigonometric
- functions are converted to expressions involving logarithms:
-
- ? ATAN(U);
- @: ATAN (U)
-
- ? TRGEXPD(@,7);
- @: #I*LN((#I+U)/(#I-U)) / 2
-
- The reverse transformation is described below in file LOG.ALG.
-
-
- ============================================================
- LOG.ALG
-
- This file contains only one new feature. I can't think of a
- situation in which to use it; I have included it only because
- it is the logical reverse of a feature of ATRG.TRG, above.
-
- In file ATRG, inverse trig functions are replaced by logarithms
- when TRGEXPD is a positive multiple of 7. In this file, the
- reverse can be done. If TRGEXPD is a negative multiple of
- 7, then natural logarithms are converted to inverse trig
- functions. Example:
-
- ? A:LOG(U);
- @: LN(U)
-
- ? TRGEXPD: -7;
- @: -7
-
- ? EVAL(A);
- @: 2 * #I * ATAN((#I-#I*U)/(1+U))
-
-
- ============================================================
- INT.DIF and LIM.DIF
-
- There are minor changes in these files to take into account
- the error function ERF. Examples:
-
- ? ERF(0);
- @: 0
-
- ? ERF(MINF);
- @: -1
-
- The following example is done with INT.DIF, INTMORE.INT,
- LIM.DIF, and LOG.ALG (for those with a lot of memory):
-
- ? DEFINT(#E^-X^2,X,MINF,PINF);
- @: #PI ^ (1/2)
-
-
- ============================================================
- SERIES.DIF
-
- This file is a replacement for the existing file SIGMA.ALG.
- Usage of SIGMA and PROD are as described in the manual. The
- file has been completely rewritten. Notice that SERIES
- requires DIF.ALG and is larger than SIGMA. All of the series
- that SIGMA can do and several of the most common infinite
- series can be summed.
-
- The program may ask questions in the manner of LIM in order to
- determine which method to use or to determine whether a series
- converges. The files LOG.ALG, TRGNEG.ALG, and ATRG.TRG may be
- useful with this file. Some of the examples below were done
- with the help of these additional files.
-
- ? SIGMA(N^2*3^N,N,1,K);
- @: -3/2 + 3^(1+K)*K + 3^(1+K)*K^2/2 - 3^(2+K)*K/2 +
- 3^(1+K)/2 - 3^(3+K)/4 + 3^(3+K)/4
-
- ? SIGMA((-1)^N*X^(2*N+1)/(2*N+1)!,N,0,PINF);
- @:
- ??? - X^2 ???
- ENTER SIGN (0 + -)? -
- SIN(X)
-
- ? SIGMA(2^N/(4*N-1)!,N,3,PINF);
- @: -421/1260 - SIN(2^(1/4))/2^(3/4) - 2^(1/4)/(4*
- #E^2^(1/4)) + 2^(1/4)*#E^2^(1/4)/4
-
- ? SIGMA((-1)^N/N,N,1,PINF);
- @: - LN(2)
-
- ? SIGMA(X^N/(2*N+3),N,1,PINF);
- @:
- ??? 1 + X ???
- ENTER SIGN (0 + -)? +
-
- ??? 1 - X ???
- ENTER SIGN (0 + -)? +
-
- ??? X ???
- ENTER SIGN (0 + -)? +
- -1/3 - LN(1-X^(1/2))/(2*X^(3/2)) + LN(1+X^(1/2))/(2*
- X^(3/2)) - 1/X
-
- ? SIGMA((-1)^N/(3*N+1),N,1,PINF);
- @: -1 + #PI/3^(3/2) + LN(2)/3
-
- ? SIGMA(N^2/((2*N+1)*4^N),N,0,PINF);
- @: -1/9 + LN(3/2)/4 - LN(1/2)/4
-
- ? LOGEXPD(@,30);
- @: -1/9 + LN(3)/4
-
- Without LOG.ALG:
-
- ? SIGMA(N*X^N/N!,N,0,PINF);
- @: #E^X * X * LOG(#E,#E)
-
- Try this one to see an impressive-looking answer:
-
- ? SIGMA((-1)^N/(5*N+2),N,0,PINF);
-
-
- ============================================================
-
- In addition to these descriptions, let me list a few bugs (or
- misprints - the distinction is a bit fuzzy here) in muMATH
- (at least in version 2.12).
-
- 1. In file DIF.ALG, in the function beginning
-
- PROPERTY DIF, DEFINT,
-
- the line just before ENDFUN should end
-
- EVSUB(EX1,EX2,EX3),
-
- For example,
-
- ? DIF( DEFINT(F(T),T,X,0), X );
-
- should yield
-
- @: -F(X)
-
- not
-
- @: -F(T)
-
- 2. In file LIM.DIF, in the function beginning
-
- PROPERTY LIM, !,
-
- (near the end of the file), the second line should
- contain
-
- EX1:LIM1(EX1,#LIM),
-
- rather than
-
- EX1:LIM(EX1,#LIM),
-
- 3. Also in file LIM.DIF, the handling of LIM with only one
- argument supplied is not as specified in the manual.
- For example, try the following:
-
- ? LIM(R+S);
- @: ?
-
- ? LIM((X-X^2)/(1-X));
- @: 0
-
- If you get these (wrong) answers, here is a fix: In
- FUNCTION LIM , move the four lines between BLOCK and
- ENDBLOCK (inclusive) to the beginning (just before
- `LOGBAS: #E,') and then just after these four lines
- (still before `LOGBAS: #E,') add a new line:
-
- WHEN NOT INDET, LIM1(EX1,#LIM) EXIT,
-
- Now you should get the correct answers:
-
- ? LIM(R+S);
- @: R + S
-
- ? LIM((X-X^2)/(1-X));
- @: (X-X^2) / (1-X)
-
- 4. This one is not really a bug, but it will speed up LIM
- involving exponents when LOG.ALG is not loaded. In
- FUNCTION LIM , change
-
- LOGEXPD: 70,
-
- to
-
- LOGEXPD: 10,
-
- then in PROPERTY LIM, ^, at the beginning (just after the
- comment % Fluid vars ... % ) add five new lines:
-
- BLOCK
- WHEN FREE(EX3,INDET) OR FREE(EX4,INDET),
- EX2:EX4, EX1:EX3 EXIT,
- EX2:EX4*LOG(EX3,#E), EX1:#E,
- ENDBLOCK,
-
- and finally change the next-to-last line (just before
- ENDFUN) from
-
- EX1^EX2,
-
- to
-
- LIM1(EX3,#LIM)^LIM1(EX4,#LIM),
-
-
- 5. In the manual, page 9-4, item 4. near the top of the
- page, the second sentence should begin
-
- When TRGEXPD is a negative multiple of 7,
-
- The correct information is given on page 9-28.
-
- =============================================================
-