PSION WP DATA FILE Q. T. C. Manual A selection of mathematical programs by Sven Weber For the Psion 3a/3c/3mx QTC: a selection of pure mathematical programs for the Psion series 3a/3c/3mx. NB: This version is shareware. It is only available for 30 days after initial loading and does not include any printing options. Any mention of this option in this document refers to the full version only, which is available from the address at the end. To load and run: (QTC is designed to run from internal loading only.) (NB: QTC will not load into the original series 3 machines: a version is available - minus Grapheq - for S3, from the address given at the end.) Welcome to QTC! If your version is on a floppy disc or flash card (SSD), please follow the instructions below to load the programs into your Psion. There are four files associated with QTC on your disc: QTCS.opa (the menu file), \QTCS\ (the directory containing the individual programs), QTC3.pic (the icon) and QTCman.wrd (this document). Each of these files needs to be put into a certain place on the Psion. 1) From a floppy disc using a PC via Winlink. Use Winlink to select \APP\ directory from Psion (M:\). Copy both QTCS.opa and \QTCS\ from drive A(PC) into this directory, then copy the QTC3.pic file to the internal \pic\ directory. Copy QTCman.wrd to \wrd\. Installation: first put your highlight on the application immediately to the right of where you want the QTC icon to come up on the system screen, then bring up Install on the applications menu. Select the top line in the window and with the horizontal arrow keys find QTCS.opa. Check that the selection gives "current position" and "internal disc" and press Enter. The QTC icon will now appear. Highlight the label below it and press enter - and you're in business. 2. Loading direct from an SSD: place SSD in either A or B locations, press tab and then the appropriate arrow key to find your disc. Copy files to \app\ and \pic\ as above and then install. Or use copy disc command. 3. QTC can be run on a PC under DOS using the Psion emulator S3aEMUL (freeware). The loading conditions are effectively the same as above but Winlink is unnecessary if loading from a floppy disc. Either open S3aEMUL (NOT in windows!!), press tab and use horizontal arrow keys to find drive A (where the floppy disc should be). Highlight the files or directories that need copying, press F9 and copy and proceed with those files as in 1(a) above. Or in DOS/Windows File Manager/ Explorer, create (if they are not there already) both \app\ and \pic\ directories, copy the files into these directories, exit Windows and bring up S3aEMUL. Select where you want the icon, press F9 and navigate to the applications menu, bring down Install and proceed as above in 1a). It is possible that having loaded QTC and got the icon up, all the individual program names will appear under the icon - where they may look pretty but have no loading function. Press tab, guide highlight to the \app\QTCS\ heading, press menu or F9 and highlight 'File Attributes', then using arrow keys, put Yes to 'Read only' and 'Hidden". Enter. NB: Make certain that your Psion is set to Radian measure! (Control menu: Evaluate). The complete selection takes up about 150K of memory. Qtcman (this document) is available under Word. ---------------------------- I hope you find these programs interesting: May I ask you to take a quick glance at the description of them below before you get started. You'll see that they are not meant for professional mathematicians, nothing high flown like that, but are meant rather for those in bud whose study takes them across the subject concerned and who want a simple way of getting an answer to a particular problem. Also for anyone who is sufficiently misguided in their interests to have mathematics as a hobby - as I have myself - and who can contain his cynicism enough to find in these programs some diversion or amusement, although none of them is designed as a game. Not even one. Now, there are plenty (and I mean plenty) of very good maths programs, and with any luck it's possible to find soft-ware that does everything except washing the dishes: this selection in QTC, unfortunately, can't lay claim to these dizzy heights nor even pretend to (see above). But the programs in QTC will do quickly and accurately what they are designed for and hopefully, also, they will stand the strain of applications outside the strict limit of their titles. Most of the programs are self-explanatory, but at risk of being both patronising and boring, I'm going to write a short description of each. A word, first, in general. Nearly every program can be printed out, not as completely as on the screen, but enough to give all the significant results: you will be asked whether or not you want this done after accessing the program. The print-out, or even having the parallel link plugged in does, unfortunately, often slow the routines down somewhat, thus it probably would be an advantage to run the program first to see what it does, and print it only when you have got the results you are looking for. The print-out is limited to parallel printers: they should be set up normally via the Psion menus and you should check that the printers themselves use the character set corresponding to the IBM code page 850. Due to the limitations of this set, certain things cannot be printed either on the screen or on a separate printer. This should not cause too much bother but to prevent any mystery and rumblings about cabalistic signs, I should mention that powers 4 and 5 are sometimes denoted by little hooks, rather than by **4 or **5. Of course, if a character set other than the IBM page 850 is used, there is no telling what you'll get... The programs progress either by use of the space-bar [Sp/b] or entering a letter in response to a question, or entering a number in response to "Enter". In the last case, the entry must be confirmed by the enter key except where the entry is by default. With the exception of Bisect and Grapheq (see later), number entries will only accept numbers in decimal or exponential form: brackets, fractions, pi or other things, will cause a ? to appear, inviting re-entry. Entry defaults or re-calls that occur in some programs are set just by using the Escape key: all other key presses either bypass the default or have no effect. All circular measure is in radians and all unaltered logs are in base e. I have tried to make the programs fool-proof but over- (or under-) loading may cause some programs to complain: the ball is in your court then, altho' it's easy enough to reload if an error signal appears. Incidentally, some of the programs can be combined, ie: Remaneq and Quintec, Simuleq and Quinteq, No81 and Primsolv. A choice will be given in the main program. Now the programs individually: 1. Bisect: Virtually any single-variable equation with a single root can be solved by the bisection method as it tracks over the zero, though equations that have two or more roots, either close together or coincident, can cause trouble. Hopefully that won't happen too often. The big disadvantage of the process is that it is rather slow: there are quicker methods (sometimes much quicker) but they all need a starting point that is a close approximation to the root that you want to find. The bisection method does not. This program will find any real root included in the range x < Abs(100). The length of time it takes to get to the final bisection depends on the length of the eqn., but is generally about 12 - 15secs. The equation [f(x)=0] that you will enter can be almost as complicated as you like (limited to 100 characters): using any of the in-built psion functioms (sin, cos, tan, ln, log, exp, abs, * for ALL multiplication, ** for powers). Writing the equation in the standard way making good use of brackets, you can build up some pretty fearful equations. Number entry can be decimal or exponential; pi, brackets and fractions can be used. Three things, though: a) the variable is x and only x, b) with any appearance of x, it is essential that it is enclosed directly in brackets [ie (x)], and, finally, c) the '= 0' does not need to be written in: it is always implied. Any = sign or other mistake in entering the equation, will confuse the program; it won't give an error flag (or, at least, it shouldn't do), but it may give some ridiculous answer or just sulk and go back eventually to an edit command. The program does not like discontinuous functions [eg (ax^2)*exp(b/x)] although the edit/evaluate part will work quite happily. After running your equation through, you will be given a choice of editing it (and evaluating for a given x) for a further run. Incidentally, it will sometimes give roots which one doesn't expect, but these are still correct (ie: tan(x)-1 gives 5pi/4 whereas one might expect only pi/4.), and on some occasions it takes a dislike to a zero root and goes skipping out to the edge of the limit. Not to worry about this: it will be obvious from your equation that a zero root was in the offing. If it can't find a root it will tell you to reconsider the equation. Don't go looking for complex roots because you won't find any here! 2. Comarith: Simple complex number arithmetic: moduli and arguments, addition, subtraction, multiplication, division, inverses, powers and roots in either Cartesian coordinates (like x,y), or in polar or exponential systems. Values of argument lie between -pi and +pi ccw. Finding the integral roots of any complex number, say, the fifth roots of (3+4i)/(1-8i), can be done in a couple of seconds, and the multiple roots of 1 or -1 are found immediately when the required entries have been made, &c. To remove any misunderstanding, the arithmetic functions A/S/M/D mean simply add/ subtract/ multiply/ divide, and in the root program, the root n must be a positive whole number, although in the power program any fractional root can be found, but, of course, only one will be shown. 3. Diagonal: Builds Pythagorean number sets from 2 to 4 dimensions. Of course, you know that with a 4 dimensional box with unity sides, the longest diagonal is exactly 2. It really is. You can't say that about a 3 dim unity side box: that's 3^.5; nor about 2 dim: these are irrational and thus, in effect, cannot be measured exactly... In this program, r is the diagonal, x the side you start with, and y, z and w the other sides depending on dimension. These sides have to be related between themselves quite apart from the normal Pythagorean formula [ie: x^2+y^2(+z^2+w^2)=r^2]. In two dimensions this is quite simple: y=r-n, n being any whole number difference between the diagonal and the third side, giving r=(x^2+n^2)/2n. With increasing dimensions, things get somewhat more complex: for 3 dimensions, y=r-n, z=r-m, but a further condition is necessary between y and z involving an independent integral 'variable' u: [m=(u^2+x^2)/2n], and for 4 dimensions, y=r-n, z=r-m, w=r-(m+q), with the independent 'variable', u, bound up in [m={(n-q)^2+u^2+2x^2}/4n]. So, obviously, the 3 & 4 dim. versions will have two solutions. Now, the x side in the final result may well be scaled up or down ("Sc.F") depending on various factors. I leave you to work these out for yourself. Keep entered numbers under 100 (75 in dim4) if you want a reasonable running time and don't want the calculating machinery to over-stretch itself. There is an error checking mechanism in the program which will show "ic" if the final solution does not check with itself. 4. Expeq: Solution of certain types of simple exponential equations. Nothing too difficult. Will find logs to any positive base, logs of negative and complex numbers (did you know that ln(-1) = ipi so that e^ipi = -1? Or that there must be n+1 roots of an n degree polynomial when it crosses a simple exponential curve?). You can check these things, and quite a bit more. Bye the bye, -pi<<=pi for complex answers. There are four main types: Aa^f(x)=g(x); Aa^f(x)=Bb^g(x); y^z=a+ib; Aa^2x+Ba^x+C=0. The first will find real roots within a chosen range of up to abs(x)<20, the others all roots, real and complex, within the range of the computer. (e is default - esc button.) 5. Fhyp: All hyperbolic functions, both direct and inverse, with this program, with abs(x)<227. 6. Grapheq: A simple two-dimensional graph program that copes with most ordinary one-to- one, right conic, parametric, Z-plane and polar functions. A bit on the slow side but it gives you an idea of what the function looks like. The one-to-one function range is as in Bisect, the conic section will draw all simple ellipses and hyperbolae (with axes parallel to graph axes: no xy terms - use a matrix transformation to get out of skew axes); the parametric, Z-plane and polar sections will draw any appropriate typed-in functions also a number of in-built graphs, all of which can be adjusted through change of coefficients, axes, scale, range, radius and definition. There are two sets of scales: the basic in-built one of the Psion derived from the origin at the bottom left hand corner of the screen [the top right hand corner is (480,160)], and the graph scale coming from the effective origin wherever this is put. It can even, if needs be, be off the screen. Default origin is (240,80) and the default graph scale divisions are set at unity (all divisions are 20 Psion points). Definition is based on the number of points taken per complete graph and can be varied from 200 to 1000 in units of 200. Of course, the lower the definition, the quicker the graph gets drawn, but some low definition graphs look pretty coarse and crude. 200 has been chosen as the minimum: it gives a fair graph and doesn't take too long. With graphs that go off the screen and start again on the opposite side [ie hyperbolae or sec(x) &c], the plotting sequence will sometimes draw unnecessary lines crossing the screen to get to the next starting position. One of these days I shall get round to removing this bug, and also the one in the conics section where the plot on medium definition can make a small brick where f'(x) is infinite. Now, to repeat the warning given in Bisect, do make certain that on EVERY appearance of the variables in the functions you enter, they are directly enclosed in brackets, also that (a) * is used for each and every multiplication, (b) all brackets correspond and (c) the = sign is never used. Failure to carry out these instructions will muck the graph up no end (if, indeed, you get a graph!). 7. Lazyquin: A simple way into Quinteq, without any of the hassle of on-screen explantions. Just enter the coefficients (max degree first) and let it do the rest. 8. Modn: A little program that does simple modular arithmetic and finds congruences on any base n either with direct entry (integers, fractions or powers) or with the sum/product of two entries (+ve or -ve). For making Cayley tables from Zn - or just playing about with number bases or perhaps seeing what some remainder is after a division. Everything this program does can easily be done in your head (or at least up to n=12(!)) but maybe not quite so quickly... 9. Number 81: Some of the hidden features of this number, a very ordinary number until you start investigating it. Quoting Lewis Carrol, `curiouser and curiouser'. 10. Primsolv: A program for extracting prime factors from medium sized whole numbers up to 1E14 and HCF's (or GCD's) from up to five numbers (integral, naturally). 11. Quinteq: The heart of this selection. Now, as you know, solving polynomial equations above degree two is not the easiest of tasks and the method generally employed uses some kind of iteration. However, up to degree four, they can be solved algebraically (anything above generally cannot be), and any odd degree equation with real coefficients must have at least one real root, which can easily be found by one of the many simple iterative processes. These two factors enable a quintic to be solved easily with a computer (very messy and awkward by hand, though!) and this program carries these processes out quickly and accurately, finding all possible roots, real and complex - from a quadratic to a quintic - normally well within a couple of seconds: quicker than finding them all by iteration with a similar speed processor. Looked at the other way round, the pattern of coefficients, particularly with a quartic and quintic, can be rather curious - with certain types of root. Not saying any more except that if you've ever looked at some Galois theory, you would know why: good hunting! 12. Remaneq: This program started as an adjunct to Quinteq but has since developed further: by numerical methods it will find all the real roots of any polynomial up to degree 9 within a chosen range of up to x1, it can easily be summed by adding each term in the sequence (ie: by brute force!), but this summing can on occasion take a long time with low exponents (with Re(z)=1.5, it would take many thousands of years to get up to 10 d.p!). However, with this present program, after a predetermined number of terms have been straight- forwardly summed, the so-called Euler-Maclaurin method is used to make an estimate of the rest, by integrating it trapezoidally and using error correcting functions with Bernoulli numbers (up to B12). It is remarkably quick and accurate. For instance, the sum with z=2, needs only 10 terms of the basic series to get the sum to within 1 part in 10^-14 (in fact, it's generally not necessary to have more than 25 terms with any value of z: the total error is of the order of the next B term which is easy to estimate crudely), whereas with straight summing, 7000 terms give only 4 d.p.... At higher degrees (around Re(z)=14), the two ways are more or less equally efficient, but at still higher degrees, it is not worth using the E.M method. The series also has a finite sum for degrees with Re(z)<1: another very intriguing result which you wouldn't expect by looking at the basic sequence. It doesn't seem at first glance to be possible, but if you were to examine the functional equation, it shows that for every finite degree except abs(z)=1, the sum is finite in value. Just shows how wrong one can be about this odd function! This program will quickly work out sums with degree values -11 it can be shown (and it is quite obvious) that Z(z) cannot have a root; Re(z)=1 (the ordinary harmonic series), forms a simple pole, ie: Z(z)=inf, but when Re(z)<1 in the analytic continuation, there are roots every Re(z) = -2N (with Im(z)=0), and also, pace the conjecture, when Re(z) is, and only is, 1/2, there are various values of Im(z) (and their conjugates) that make abs[Z(z)]=0. In fact, it can be proved that there is an infinity of roots along this so-called critical line but not, unfortunately, that there are no roots elsewhere. This conjecture that all roots (except the 'trivial roots' along the negative real axis) that are less than Re(z)=1 are on this critical line, is one of the most important and famous hypotheses in all number theory, and no-one knows how Riemann arrived at it. Many other theories depend on its veracity. Mathematicians are still waiting for a water- tight proof for it: all that has been done is to show that with half a billion starting points, not even one has negated the conjecture. But possibly the next one could prove it wrong.... The first roots of this type are z = 1/2+14.134725141734..i, 1/2+21.0220396387..i &c. Now, the present program can be used for the solution of such roots using the regula falsi method (the program is valid for Re(z)>-1). In fact, as far as I am aware, this is still the only way of getting at them accurately. The program will not sum any lower degrees than Re(z)=-1, as these are out of the unit circle z=1 on the split complex plane. But it is fairly certain that any roots for negative degrees that are outside this unit circle are only going to be the trivial ones (see above), so it is hardly worthwhile extending the program for this. Now go ahead and see what you can find... DO PLEASE READ THIS: These programs in QTC are copyright to the author and are neither share nor free-ware. You are welcome to make personal back-up copies but to copy it for someone else, even if no money changes hands, is illegal and ain't what you might call honest. These programs should be accurate (unless otherwise indicated) to at least 10 or 12 digits, but no responsibility can be taken for any result arrived at by any program in QTC., nor on any use of these results, howsoever caused: this condition and also a condition that no attempt is made to reverse engineer any of the programs in QTC in any way whatever must be accepted by any purchaser and subsequent user. In particular, no warranties are given for any specific set-up although copies of QTC which prove defective on purchase will be changed gladly. I would appreciate any constructive comments and suggestions as to how to improve these programs or ideas for new ones. Enjoy yourself. There may be further additions when I get the time. Sven F. Weber E-mail: Sven@Appletreedrive.idps.co.uk or Snail mail: 28 Appletree Drive, Hala, Lancaster, LA1 4QY [QTCdocsfile QTC2QTC:1.XII.97; recast QTCman 4.01.99 and 4.11.99]