home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ARM Club 1
/
ARM_CLUB_CD.iso
/
contents
/
education
/
n
/
sciapps
/
!SciModel
/
!Help
< prev
next >
Wrap
Text File
|
1992-05-19
|
6KB
|
140 lines
/---------------------------------------------------\
| !SciModel - by Dr. Roderick Ferguson, March 1992. |
\---------------------------------------------------/
!SciModel is a RISC OS 'desktop friendly' general
purpose nonlinear least squares curve fitting (NLLSQ)
application. It uses the same format of data file as
my !SciGraph application.
The nonlinear least squares curve routines are based
on the LevenBerg-Marquhardt Algorithm which is explained
in the excellent book "Numerical Recipes: The Art of
Scientific programming". The routines used in this program
were taken from the FORTRAN source code given in this book.
To get more help when using this program, use the
interactive help application, "!Help".
The built in models (given in the 'models' file and
available from the main menu) include ones which most Polymer
Chemists would use for routine work. [Yes, I am a Polymer Chemist!]
For a full description of the NLLSQ routines, see chapter 14
in the "Numerical Recipes" book by W.H. Press et al. (published
by Cambridge University Press, Cambridge). However, for those
people who haven't yet read this worthy book, here are a few
points to note:-
The quantity being minimised is the ChiSquared function which is
defined as the sum over all of the data points of the quantity
(Ri)^2 {for i=1 to N}
(Yi - Fi)
where Ri = [---------],
(Sig i)
Yi = the i'th experimental Y value, Sig i = ErrY, the Absolute
error in Y ie Y +/- ErrY, and Fi = the i'th theoretical Y value
obtained from the model being used, ie Fi = F(Xi,U,P1,P2,...P8).
It is EXTREMELY important that you provide a reasonable good
guess for the starting values of the model parameters {Pi}.
In other words, you should NOT merely treat this application
as a "BLACK BOX" type program. It is better if you have a fair
understanding of the process or phenomenon that is being modeled.
This means that you should then have a good idea of the range of
possible values of at least some of the model parameters.
Also if your Y data has fairly large errors then you should
not be tempted to use an over elaborate model where a linear
curve fit would do! Note that increasing the number of parameters
(eg going from a 2 parameter model to a 4 parameter model) may
provide an apparent improvement in the goodness of fit for your
data, but you should beware as there is always a risk of 'over
parameterising'! What I am really saying is that you should
always use the simplest possible model unless you have very
good reasons for going to a more complex model.
I have used this application (together with the !SciGraph
application) to produce both PhD thesis and publication quality
figures for a variety of projects.
COPYRIGHT NOTICE
================
The !SciGraph and !SciModel applications together with the SciGraph
data file format are © Dr. Roderick Ferguson. Furthermore, you use this
software at your own risk! The author accepts no responsibility whatsoever
for any damage caused by these applications whether to Hardware or other software
or to other people.
However, not withstanding the above, I should tell you that these applications
have been tested for at least a year now and they should be 99.9% bug free.
If you DO find any bugs ie "unsupported extra features" then please let me know!!
I can be contacted by :-
Letter Polymer Laboratory,
------ Chemistry Department,
Heriot-Watt University,
Riccarton Campus,
Edinburgh, Scotland.
Phone 031-449-5111 (extension 4109 or 4239).
-----
Email CHERRF@UK.AC.HERIOT-WATT.VAXA
-----
===============================================================
For the sake of completeness, I will now briefly describe
the format of a SciGraph data file (File type = &2FF) :-
The format used is CSV (comma seperated value).
1) The first line in the file can be a comment line, which must
start with a '*' character.
2) The Data section starts with the keyword 'DATA'. This is
followed by the number of data points and the standard error
assosciated with each data point. This can be overrided
however by including a seperate standard error (ErrY) for
each data point after its X,Y values.
The X,Y and ErrY data follow (one line per data point).
3) The Model description section starts with the 'MODEL'
keyword. This is followed by the model description, then two
lines which are the model function and an optional auxiliary
function. This latter function can greatly simplify the form
of the algebraic expressions used for the partial derivatives
later on. The number of parameters is next, then lines
containing each parameter and a flag indicating if this
parameter is to be frozen during the curve fit or allowed to
vary. Finally, one has the expressions for the partial
derivatives of the main function with respect to each
adjustable parameter Pi.
4) The !SciGraph 'LEGEND' keyword. After this keyword, one can
have lines for the Graph Title, the X axis legend and the Y
axis legend. Finally, one has the two scientific notation
flags (again, one per line) 0 = don't use scientific notation
for the axis numbers, and -1 = use scientific notation for
the axis numbers.
Inspection of the 'demo' SciGraph data files in the 'SciGraph'
directory supplied with this application illustrates the
format used.
Also, note that lines corresponding to section (f) can be
ommitted, and a model description chosen from the !SciModel
main menu and the data file saved (after performing a curve
fit). Further models could be added to the 'Models' file.
The maximum allowed number of 'built in' models is 20.
===============================================================