home *** CD-ROM | disk | FTP | other *** search
- ***************************** Copyright Notice ****************************
- * *
- * (C)1991 Duco Fennema *
- * *
- * Read the 'Terms of Use' chapter at the end of this file to know *
- * what you may and may not do with this program. *
- * *
- ***************************************************************************
-
-
- ReadMe file for !Solver v1.10
-
-
- equation solver (like HP calculators)
-
-
-
-
-
- Contents___________________________________________________
-
- This file contains 11 chapters in this order.
- -Why !Solver
- -Using !Solver
- -Using !Solver as a Evaluator
- -Using the library
- -Extending the library
- -How it works
- -Alternative solving methods
- -Acknowledgements
- -Terms of use
- -Release information
- -Correspondence
-
-
-
- Why !Solver ?______________________________________________
-
- Do you know those handy Hewlett Packard calculators with a
- Solver program?
- Well I do, my brother has one, and it is very handy.
- I found it indispensable when calculating the maximum gain
- from given a fase margin for a second order process with
- delay time.
- Thus an idea came to my mind, to give my Archimedes the same
- capability.
-
-
-
- Using !Solver______________________________________________
-
- The Solver main window has three writable icons.
-
- In the top icon 'Equation in X' you may enter an equation
- in X (it has to be a capital X).
- You may enter a function in X on both sides of the "=", if
- you enter a function in X only, Solver tries to find a
- value for X which gives f(X)=0.
-
- In the second icon 'Lower Limit' you have to enter the
- lower limit for X.
- In the third icon 'Upper Limit' you have to enter the upper
- limit for X.
-
- If you press return in the third icon or click on 'Perform'
- !Solver will try to find a value for X between the upper
- and lower limit for which the equation is true.
-
- If there is more than one value of X for which the equation
- is true !Solver will only find one of them.
- To make sure there are no more solutions you could fiddle
- the limits a bit but some mathematical insight would come
- in handy here.
- In most cases though if you move the limit nearest to the
- answer towards to the other limit in such a way that the
- found answer now lies just outside the limits then chances
- are Solver will find another answer.
-
- After you have started the Solver, the 'Perform' icon will
- change to 'Interrupt'.
- If you click on 'Interrupt' Solver will stop and you may
- then change the limits or the equation.
-
- During the Solving process you can monitor it's progres in
- the three icons in the second box.
- The first icon 'Evaluating' gives the value under test,
- while the second icon 'Deviation' gives the deviation from
- the correct answer.
- The third icon 'Messages' reports any errors that might
- occur during the process and also tells you when it is
- finished.
-
- When Solver has found an answer the 'Messages' icon will
- say "Found after ... iterations" and the answer will be in
- the 'Evaluating' icon.
-
- If Solver can not find an answer, that means no answer
- with a zero deviation, it will stop after 160 iterations
- and the 'Messages' icon will report this to you.
- After this the 'Evaluating' icon will display an answer but
- is has a deviation as shown in the 'Deviation' icon.
-
- If you click on 'Interrupt' during the solving process, the
- 'Messages' icon will say "Halted after ... iterations" and
- the 'Evaluating' and 'Deviation' icon display the progress
- so far.
- If you click on 'Perform' after this the solving process
- will start all over again.
- It is not a resume but a restart.
-
-
-
- Using !Solver as a Evaluator_______________________________
-
- You may also use !Solver as a straight Evaluator.
-
- To do so click on the 'Solve' icon, it will change to
- 'Evaluate' and the 'Messages' icon will say "Evaluate
- mode".
-
- After this you may enter a function in X in the 'Equation
- in X' icon.
- The 'Lower Limit' and 'Upper Limit' icons have a slightly
- different use now.
- In the 'Lower Limit' icon you may enter an initial value for
- X while the 'Upper Limit' icon must contain a step value.
-
- Now each time you click on the 'Perform' icon, the function
- will be evaluated for X='Lower Limit' and 'Upper Limit'
- is added to 'Lower Limit' afterwards.
- The 'Evaluating' icon gives the evaluated value of X as
- always, but the 'Deviation' icon now gives the result.
-
- Use the interactive Help application from the applications
- disc 1 if you want any help when using !Solver.
-
-
-
- Using the library__________________________________________
-
- The library functions may be used in exactly the same way
- as Basic functions.
- To find out how many functions there are and what they do try
- the folowing.
- Put !Solver in the Evaluation mode and enter into the three
- writable icons.
-
- Equation in X > FNFunctionInfo(X)
- Lower Limit > -2
- Upper Limit > 1
-
- Clicking on the 'Perform' icon causes the 'Messages' icon to
- display information about the function library.
- Keep doing this until no further messages are displayed.
-
-
-
- Extending the library______________________________________
-
- You may add your own routines to the function library, but
- some rules must be obeyed.
- These rules can be found in the library header.
- Also if you make any worthwhile additions, I would like to
- receive a copy from you to be incorporated into later
- releases of !Solver in the true spirit of shareware.
-
-
-
- How it works_______________________________________________
-
- !Solver works with the relatively simple methode of
- successive halving
-
- It takes the right side of the equation, brackets it,
- subtracts it from the left side of the equation and tries
- to find a value for X for which the resulting function
- becomes zero.
-
- g(X)=f(X) ==> g(X)-{f(X)}=0
-
- After that a test is made to see if one of the limits has a
- negative result and if so than that limit is taken as the
- lower limit.
-
- Now it just takes the mean from the upper and lower limit
- and tests it.
- If the result is negative we found a new lower limit
- otherwise we found a new upper limit.
- This process just goes on until we reach a zero result.
-
- The reason that Solver always stops after 160 iterations is
- that every possible answer should have been found by then.
- This fact can be proven by the following.
-
- Solver uses Basic floating point numbers to evaluate the
- given equation and these have the folowing range and
- accuracy.
- range -1.7x10^38 to 1.7x10^38 (-1.7E38 to 1.7E38)
- accuracy 1 x10^-9 (1E-9)
-
- This means there are
-
- ([most positive]-[most negative])/[accuracy]
-
- definite points in this range.
-
- To find how many times we have to halve this range to end
- at a definite point, we calculate which power of two gives
- the same value as (pos-neg)/acc.
-
- 2^i=(pos-neg)/acc
-
- To solve this we need some trigonometry.
-
- log(2^i) = log((pos-neg)/acc)
-
- i*log(2) = log(pos-neg)-log(acc)
-
- i = {log(pos-neg)-log(acc)}/log(2)
-
- So, to find i from Basic we need to evaluate
-
- i=(LOG(3.4E38)-LOG(1E-9))/LOG(2)
-
- Sadly this is too much for Basic and it gives a 'Number too
- big' error.
- Time for another trick, we divide both the range and the
- accuracy by two.
- This gives the same number of definite points but the log
- arguments stay within range.
- Now we evaluate:
-
- i=(LOG(1.7E38)-LOG(2E-9))/LOG(2)
-
- If you enter the right part of this in the Solver and
- Evaluate it the answer will be 155.89.... which is almost
- accurate because it should be 157.89....
-
- And I think that should conclude our maths for this moment.
-
-
-
- Alternative solving methods________________________________
-
- There are a number of other methods to find a zero crossing
- for a given function, most notably Newton Raphson and
- Regula Falsi.
- They both converge a lot faster than successive halving but
- both have drawbacks as well.
-
-
- Newton Raphson works by iteration of the folowing lines:
-
- y=x-f(x)/f'(x)
- x=y
-
- As you can see it needs the first derivative to be
- determined and has to evaluate two functions in every
- iteration.
-
-
- Regula Falsi works by iteration of the folowing lines:
-
- y=x1-((x1-x0)/f(x1)-f(x0))*f(x1)
- x0=x1
- x1=y
-
- As you can see a lot more calculations are needed, but with
- some clever coding only one function evaluation is
- neccessary for every iteration.
-
- Personally I did not feel the need to implement one of these
- methods into !Solver.
- If you have written a working version suitable for
- incorporation in !Solver I would like to hear from you.
-
-
-
- Acknowledgements___________________________________________
-
- Thanks to:
- -Joris Roling for his !Help application (you are probably
- staring at that right now).
- -Freddy Huttner for his excellent !NewModes module.
- (the 56Hz 896x360x16 mode is great to work with).
- -Acorn for developing this tremendous machine.
- -My girlfriend for putting up with so much lack of
- attention.
- -And all others I forgot to mention.
-
-
-
- Terms of Use_______________________________________________
-
- You may freely copy as long as:
- -all files in this application directory are included.
- -this is not for commercial purposes
- -you do not charge for copying.
- -you do not put this program or parts of it on a disc for
- which you are charging (other than the costs of the disc
- itself).
- -the application is not tampered with.
- -this Readme file is always included without any change
- made to its contents.
- -you do not upload this on a bulletin board which charges
- for its downloads.
-
- The author reserves the right to amend these terms in cases
- where he deems misuse.
-
-
-
- Release information________________________________________
-
- v1.00 (26-12-90) First release (for selected persons only)
- v1.10 (04-01-91) Library added.
-
-
-
- Correspondence_____________________________________________
-
- Send remarks, bugs and praise to:
-
- Duco Fennema
- Eursingerweg 34
- 9411 BB BEILEN
- HOLLAND
-
- Telephone:
- 05930-22277
-
- From outside Holland:
- <International entry code> 031 5930 22277
-
-