Copyright: (c) 1995 by Technosoft Software


Index

Welcome to the CurveFit help. In this file you will find Help about the following items :

CurveFit:

What is Data Regression

CurveFit for Windows - application overview

Working with CurveFit for Windows

Technical support and contact information:

Technical support

How to get in contact with Technosoft Software

Legal information:

License, copyright, and disclaimer


Working With CurveFit

CurveFit´s features:

Fit equations

Fit algorithms

Fitting data

Using the clipboard

Modifying data

Formulas

Formula files

Fit Result

Error analysis

Sensitivity Analysis

Detecting and removing Outliers

Preferences


CurveFit for Windows

Click at the following picture to obtain more information about the structure of your CurveFit application.


Registration

When you install CurveFit the program is in a "Demo"-mode. This means that you cannot use all features of the full version, but you can test the software before decide to purchase it.

If you want to terminate the restrictions you will have to register.

Unregistrated (Demo) Version

Without registering your copy of CurveFit the following restrictions apply :

•	Only 6 data points can be drawn and calculated.

•	You are not able to save a formula.

•	A reminder message box occurs any time you modify your data or want to calculate.

You can test the Demo version as long as you want or pass copies of your program disk to people who are interested in the program.

Registrated Version

Registering your software gives you some real advantages :

•	No program limitations.

•	Free information on program updates for the entire lifetime of the product.

•	Free hotline in case of troubles

When you purchase a license for CurveFit  you get your personal registration number. With this number you have to personalize your program copy. Select the menu item "Registration" (Menu: Help/Registration).

The registration-window will open. Enter your user name, organization and registration number exactly as they are printed on your license (this includes all blanks and other characters). After you are done, check all entries carefully and then press the "Registrate"-key.

You can see your user name and organization in the "About"-window (Menu: Help/About) or in the CurveFit logo being displayed at the program start.


Professional Version

The professional version of CurveFit offers you the possibility to compile your formulas for increasing calculation speed.

That means that when you have entered your desired formula and you start the fit process, first CurveFit translates your formula into machine language and second starts the fitting process.

Each compiled formula is added to an executable formula library (a Windows-DLL). Therefore it is not necessary to compile these formulas again if you start another fitting process.

Once the your formulas are translated to machine language, they can be executed extremely fast compared to normal interpreting them as it the standard version of CurveFit does.


Chem-Fit

Chem-Fit is a widely used data-regression and curve-fitting program for DOS. It offers some of the functions you know from CurveFit.

If you use Chem-Fit, you can import your formula files to CurveFit without any problems.

Chem-Fit is © copyright 1993 by Kurt Burtscher and Siegfried Voessner-


Technical support

If you can't find the information you need in this help file, you will find it in the CurveFit User's Manual. The manual is very complete and has an extensive index. However, it is difficult to foresee every possibility. If you still have questions, need help, have a bug to report, or would like to suggest improvements or new features, please feel free to contact us. You can reach us by mail, by phone (Monday through Friday, 8 a.m. to 5 p.m., Central European time), or FAX, or electronically via Internet as follows:

TECHNOSOFT Software

Dr. Siegfried Voessner

Peterstalstrasse 107

A-8042 Graz, AUSTRIA

Phone: ++43 (316) 473470

Hotline: Internet-Email: techsoft@ping.at

Important: Please include your registration number in any communication. The number will then be shown in the CurveFit startup screen and any time you choose the "About" menu item from CurveFit's Help menu.


Contact Technosoft Software

For ordering a version of CurveFit or to obtain updates, bugfixes etc. you can reach us by mail, by phone (Monday through Friday, 8 a.m. to 5 p.m., Central European time), or FAX, or electronically via Internet as follows:

TECHNOSOFT Software.

Dr. Siegfried Voessner

Peterstalstrasse 107

A-8042 Graz, AUSTRIA

Phone: ++43 (316) 473470

Hotline: Internet-Email: techsoft@ping.at


License, copyright, and disclaimer

License:

The use of this package indicates your understanding and acceptance of the following terms and conditions. This license shall supersede any verbal, or prior verbal or written, statement or agreement to the contrary. If you do not understand or accept these terms, or your local regulations prohibit "after sale" license agreements or limited disclaimers, you must cease and desist using this product immediately.

Copyright:

This product is © Copyright 1995 by Siegfried Voessner, all rights reserved. This product is protected by Austrian and international copyright treaties and all other applicable national or international laws. This software product and documentation may not, in whole or in part, be copied, photocopied, translated, or reduced to any electronic medium or machine readable form, without prior consent in writing, from Siegfried Voessner and according to all applicable laws. The sole owner of this product is Siegfried Voessner.

Liability disclaimer:

This product is provided as is, without any representation or warranty of any kind, either express or implied, including without limitation any representations or endorsements regarding the use of, the results of, or performance of the product, its appropriateness, accuracy, reliability, or correctness. The entire risk as to the use of this product is assumed by the user. Siegfried Voessner and Technosoft Software do not assume liability for the use of this program beyond the original purchase price of the software. In no event will Siegfried Voessner or  Technosoft Software be liable for additional direct or indirect damages including any lost profits, lost savings, or other incidental or consequential damages arising from any

defects, or the use or inability to use these programs, even if Siegfried Voessner or  Technosoft Software have been advised of the possibility of such damages.

Restrictions:

You may not use, copy, modify, translate, or transfer the programs, documentation, or any copy except as expressly defined in this agreement. You may not attempt to unlock or bypass any copy protection or authentication algorithm utilized by the program. You may not remove or modify any copyright notice nor the About dialog box or the method by which it may be invoked.

Operating license:

You have the non-exclusive right to use any enclosed program only by a single person, on a single computer at a time. You may physically transfer the program

from one computer to another, provided that the program is used only by a single person, on a single computer at a time.

In group projects where multiple people will use the program at the same time, you must purchase an individual license for each member of the group.

Back-up and transfer:

You may make one copy of the program solely for back-up purposes, as prescribed by Austrian and international copyright laws. You must reproduce and include the copyright notice on the back-up copy. You may transfer the product to another party only if the other party agrees to the terms and conditions of this agreement and completes and returns registration information (name, address, etc.) to Technosoft Software. If you transfer the program you must at the same time transfer the documentation and back-up copy or transfer the documentation and destroy the back-up copy. You may not retain any portion of the program in any form.

Terms:

This license is effective until terminated. You may terminate it by destroying the program, the documentation and copies thereof. This license will also terminate if you fail to comply with any terms or conditions of this agreement. You agree upon such termination to destroy all copies of the program and of the documentation, or return them to Technosoft Software for disposal.

Other rights and restrictions:

All other rights and restrictions not specifically granted in this license are reserved by Siegfried Voessner and/or Technosoft Software.


Data Regression

Given a set of observations, one often wants to condense and summarize the data by fitting it to a "model" that depends on adjustable parameters. Sometimes the model is simply a convenient class of functions, such as polynomials or Gaussians, and the fit supplies the appropriate coefficients. Other times the models parameters come from some underlying theory that the data are supposed to satisfy; examples are coefficients of rate equations in a complex network of chemical reactions, or orbital elements of a binary star. In other cases a data fit can verify or falsify a physical theory  (determination of  reaction order). Fitting can also be used as a kind of constrained interpolation, where you want to extend a few data points into a continuous function, but with some underlying idea of what that function should look like.

The basic approach in all cases is usually the same: You choose or design a figure-of-merit-function ("merit"- or "object"-function, for short) that measures the agreement between the data and the model with a particular choice of parameters. The object function is conventionally arranged so that small values represent close agreement. The parameters of the model are then adjusted to achieve a minimum in the object function, yielding best-fit parameters. The adjustment process is thus a problem in minimization in many dimensions.

Suppose that we are fitting N data points [image] [image] , to a model which has M adjustable parameters [image]. The model predicts a functional relationship between the measured independent and dependent variables,

where the dependence on the parameters is indicated explicitly on the right-hand side.

There are important issues that go beyond the mere finding of best-fit parameters. Data are generally not exact. They are subject to measurement errors. Thus, typical data never exactly fit the model that is being used, even when that model is correct.

We need the means to asses whether or not the model is appropriate, that is, we need to test the goodness-of-fit against some useful statistical standard.

We usually also need to know the accuracy with which parameters are determined by the data set. In other words, we need to know the likely errors of the best-fit parameters.

Finally, it is not uncommon in fitting data to discover that the object function is not unimodal, with a single minimum. In some cases, we may be interested in global, rather than local questions. Not, "how good is this fit?", but rather, "how sure am I that there is not a much better fit in some corner of parameter space?". This kind of problem is generally quite difficult to solve.

With this last paragraph we want to clarify that fitting of parameters is not the end-all of parameter estimation. To be genuinely useful, a fitting procedure should provide parameters, error estimates on the parameters and a statistical measure of goodness-of-fit. When the last item indicates that the model is an unlikely match to the data, then the rest is worthless.

Least Squares

The object function we want to minimize is the sum of the squared vertical distances between  data and model function.

Vertical distances between data and model function (continuous line)

The least squares fit method minimizes

over [image].

If each data point [image] has its own standard deviation [image], then the equation above is modified  by adding its [image] as a weight ("weighted fit") :

Generally we can say: The smaller the sum of squares the better the fit. In special cases it is necessary to use in addition a graphic control tool (see Sensitivity Analysis).

Continue:

Types of fit-equations


Fit equations

Two different types of equations exists, and therefore different mathematical methods are applied to.

Linear fit-equations

Non-linear fit-equations


Linear fit-equations

All functions that can be written as :

are so called "linear equations". No fit-coefficients may appear in the function.

Examples of linear equations:

Line

Exponential

Logarithm

Linear functions have the following advantages:

*  You don't need any initial values.

*  The solution is exact.

Linear equations are solved by following algorithms:

Linear Standard Algorithm

Linear Decomposition Algorithm

Compare to:

Non-linear fit-equations


Non-linear fit-equations

If the term f(x) contains coefficients like

then the function is called non-linear.

Disadvantages compared to linear functions:

*  You need initial values to get a solution

*  The coefficients are improved by stepwise iteration.

*  You can never be sure that there doesn't exist any better solution.

    This means that an equation has always to be tested by several sets of initial values.

Non-linear equations are solved by the following algorithms:

Marquardt Algorithm

Genetic Algorithm

Compare to:

Linear fit-equations


Fit algorithms

Depending which formula type you want to fit (LINEAR / NON-LINEAR) CurveFit uses two different families of algorithms:

Linear algorithms:	Linear Decomposition and

Linear Standard

, and non-linear algorithms:	Marquardt and

Genetic.

CurveFit uses the information in the linear check box of each formula (see Create a new formula) to decide which family to use.


Linear Standard Algorithm

How the Linear Standard method works

The equations are solved by easy matrix operations (Solution by use of the Normal Equations).

When you use the Linear Standard method

If Linear Decomposition algorithm fails (which occurs very, very seldom) , switch over to this algorithm.

Comparison to the Linear Decompositon algorithm

Depending on your fit problem try one of the two algorithms. For stability we recommend to try the Decomposition method first.

See also:

Linear fit-equations


Linear Decomposition Algorithm

How the Linear Decomposition method works

In some applications, the normal equations are perfectly adequate for the problems. However in many cases the normal equations are very close to singular. This method uses a limited iterative algorithm to avoid these problems.

When you use the Linear Decomposition method

For linear fit problems this algorithm is a good choice. It is rather solid and insensitive concerning singularities.

Comparison to the Linear Standard Algorithm

Depending on your fit problem try one of the two algorithms. For stability we recommend to try the Decomposition method first.

See also:

Linear fit-equations


Marquardt Algorithm

How the Levenberg - Marquardt algorithm works

Starting from an initial vector, the steepest descent to the minimum  is determined. The advantage of this method is its velocity, the disadvantage is that you are unsure whether the solution represents a local minimum. Therefore you have to try several initial values to be sure a better solution does not exist.

When you use the Marquardt algorithm

For a first try, we suggest to use this algorithm. If you know the approximate values of the parameters, and if you are able to enter good initial values for your parameters Marquardt will produce good results. The algorithm is not very solid, so if it fails, switch over to Genetic.

Comparison to the Genetic algorithm

In general it is recommended to use the Marquardt method which is the default setting. If you can't find a solution with different initial values, switch to the Genetic algorithm. With this algorithm it is possible to find good initial values for a further calculation with Marquardt algorithm.

See also:

Non-linear fit-equations


Genetic Algorithm

How the Genetic algorithm works

Here you have to define the parameter range instead of an initial parameter set. Parameter combinations that lead to small least square sums "survive", others "die".  So the process moves slowly towards the optimal parameters. Accuracy increases with the number of iterations.

When you use the Genetic algorithm

With complex functions the finding of good initial values may take a long time. It is also possible that by trying different initial values Marquardt does not lead to any solution. In such cases the genetic algorithm may help. Coefficients that give low error sums propagate - others however are eliminated. Because only "good" (close to the optimum) coefficients can be hereditary (therefore the name "Genetic") you reach the solution area in a slow but secure way.

With this algorithm you don't have to enter initial values, but limits for every fit coefficient. The limits can be chosen arbitrarily. To reach the optimum, you should enter realistic limits - the smaller the better. The advantage of the genetic algorithm is the quick approach to the solution. To find the accurate solution, switch over to Marquardt algorithm. In most cases the calculation can be stopped after 5 to 20 iteration steps because the result doesn't improve essentially.

The Genetic algorithm implemented in this program is designed for searching initial values but not for finding the accurate solution !

Comparison to Marquardt

For a first approach, methods based on a defined area (Genetic algorithm) should be preferred. So the danger of finding a local minimum can be avoided. Due to the algorithm this can take a little while. Then, already being around the minimum, you should switch over to Marquardt algorithm, using the result of the genetic approach as starting vector.

See also:

Non-linear fit-equations


Number Format

Scientists and engineers often write numbers in a so called scientific format as a convenient shorthand for expressing both large and small values. A number is represented by a sign, a real number in the range of [0..1] with a fix number of decimals , and an exponent at the base of 10.

So the following number:

-1.2345E-009 means [image] and is equal to -0.0000000012345.

Sometimes, however it is easier to survey numbers in a so called natural format. In this format numbers are written with the smallest number of decimals possible. 1.22300E+001 is printed as 12.23.

CurveFit provides you with both number formats. You can change the actual numerical format by selecting the concerning menu item (menu: Setup/Preferences) in the preferences. Any change there affects all open data-files and the format of all output functions (save a result, copy numbers to the clipboard and so on ..). The following table gives you an overview on both number formats CurveFit uses :

scientific	natural

0.00000000000000E+000	0

1.23340000000000E+001	12.334

-1.23340000000000E+002	-123.34

1.02323000000000E+005	102323

-1.23333000000000E+005	-123333

1.00000000000000E+000	1

1.20000000000000E+001	12

1.40000000000000E-009	0.0000000014


Clipboard

The clipboard is a part of the Microsoft Windows environment.

It is used to transfer data between two or more applications.

The clipboard can hold text data, graphic data and data in application-defined formats.

CurveFit is able to import text (ASCII) data from the clipboard to its spreadsheet. It also can export data from the spreadsheet, graphs from the graphic and error window and its results to the clipboard.

The commands for transferring data between CurveFit and clipboard are:

Copy

Cut

Paste


Copy

You can export data or charts to other applications via the clipboard for using or manipulating your data or chart in other applications.

Copy data to clipboard

Copy a data/curve plot to clipboard

Copy result to clipboard

Copy an error plot to clipboard

See also:

Paste

Cut


Copy data to clipboard

purpose

Copy one or more adjoining cells, rows or columns of your data spreadsheet.

perform the following steps

Select the data window from which you want to copy your data to the clipboard.

Select the desired cell(s) (or rows or columns) in the spreadsheet.

Press Ctrl-C or menu: Edit/Copy.

result

All selected cells are copied to the clipboard.

Copy


Copy a data/curve plot to clipboard

purpose

Copy a data/curve plot.

perform the following steps

Select the graphic window from which you want to copy the data/curve plot to the clipboard.

Press Ctrl-C or menu: Edit/Copy.

result

The selected data/curve plot is copied to the clipboard.

Notice

The copied data/curve plot is a metafile which can be modified by other applications which are able to work with metafiles.

Copy


Copy result to clipboard

purpose

Copy the result of a fit.

perform the following steps

Select the result window from which you want to copy your result to the clipboard.

Select the desired formula within the combo box.

Press Ctrl-C or menu: Edit/Copy.

result

The selected result (one formula and the calculated parameter set) is copied to the clipboard.

Notice

If you want to copy all results (= all formulas you selected for fitting a data set) to another application we recommend to save the results into a file and reload it within your desired application.

Copy


Copy an error plot to clipboard

purpose

Copy an error plot.

perform the following steps

Select the error plot window from which you want to copy the error plot to the clipboard.

Press Ctrl-C or menu: Edit/Copy.

result

The selected error plot is copied to the clipboard.

Notice

The copied error plot is a metafile which can be modified by other applications which are able to work with metafiles.

Copy


Copy data from clipboard

purpose

Paste one or more cells, rows or columns from the clipboard into your data window.

perform the following steps

Select the data window you want to copy the data to.

Select the cell in the spreadsheet where you want to paste the contents of the clipboard to by clicking at this cell.

Press Ctrl-V or menu: Edit/Paste.

result

All data in the clipboard is copied into your data window.

Paste


Cut

Cut works like Copy  but the data you copied to the clipboard are removed from your spreadsheet.

purpose

Cut one or more adjoining cells, rows or columns.

perform the following steps

Select the data window from which you want to cut your data to the clipboard.

Select the desired cell(s) (or rows or columns) in the spreadsheet.

Press Ctrl-X or menu: Edit/Cut.

result

All selected cells are erased and copied to the clipboard.


Paste

You can import data from other applications via the clipboard for the transfer and modification of data within CurveFit's data windows.

Copy data from clipboard

See also:

Copy

Cut


Modifying data

Some data sets require modifications prior to a fit calculation. This can happen due to different units, measurement systems or because you want to add the Ys errors manually. Especially in the last case it could be necessary to apply a mathematical formula (which contains the values of other cells) to one or more cells. Therefore CurveFit provides a built-in formula parser with a lot of mathematical standard functions. Instead of entering a number into data windows edit field, you also can enter a formula which refers to other cells of the current line. To access values of the X, Y, Z column use X, Y and Z as variable names. The number of the current row is stored in variable R. The entered formula applies to all cells you have selected in the spreadsheet.

The following table shows a list of variables, constants and formula you can use in data windows edit field:

name	type	comment

(	o	open parenthesis

)	o	close parenthesis

+	o	add

-	o	subtract

*	o	multiply

/	o	divide

^	o	raised to power

X	v	x-value at current row

Y	v	y-value at current row

Z	v	z-value at current row

R	v	current row number

PI	c	pi=3.1415926535897932384

e	c	e=2.7182818284590452354

RND	f	generates a random number [0<=RND<1]

ln(x)	f	natural logarithm (base = e)

log(x)	f	logarithm (base = 10)

exp(x)	f	exponential function (= e^x)

sin(x)	f	sine of x

cos(x)	f	cosine of x

tan(x)	f	tangent of x

arcsin(x)	f	arcus sine of x

arccos(x)	f	arcus cosine of x

arctan(x)	f	arcus tangent of x

cot(x)	f	cotangent of x

arccot(x)	f	arcus cotangent of x

sinh(x)	f	hyperbolic sine of x

cosh(x)	f	hyperbolic cosine of x

tanh(x)	f	hyperbolic tangent of x

arctanh(x)	f	hyperbolic arcus tangent of x

sqrt(x)	f	square root of x

frac(x)	f	fractional portion of x (-0.234 if x=-1.234)

abs(x)	f	absolute value of x

signum(x)	f	signum of x

type : o ... operator, v... variable, f ... function

Undo modification of data


Undo modification of data

CurveFit allows you to undo the last modification in your data window.

Select the menu item Undo (menu: Edit/Undo).

Please note that only the last modification can be canceled. If you want to cancel all modifications made, reload the original data file.


Saving data

Select the data window you want to save by activating it (just click on it) and select File/Save or File/Save from the menu. "Save" writes data to the current file; "Save As" asks you for a filename and writes them into a new file.

CurveFit saves all data exactly as it appears on screen. Therefore the default decimal separator and the default number format (menu: Setup/Preferences) is used.

Be careful not to overwrite existing measurement files !

If the original measurement file contains some lines with text (experiment name, date, time ...) CurveFit does not read these lines when you open the data file. So if you save the data to the same file this information is lost! We suggest to use a new filename or a new directory (Save As) to save your modified data.


Formulas

CurveFit can use up to 40 different formulas simultaneously. A formula consists of a name, the formula itself, a field where you can enter a comment (e.g.: description of the parameters) and a switch that indicates if the formula is of type LINEAR or not.

Select formulas

Modify formulas

See also:

Formula files


Select formulas

To select a formula you must load a formula file first (Menu: Fit/Formulafile/Load). The formulas are displayed in a formula table (Menu: Fit/Formula/Select) where you have the option to select the formulas you want to apply for fit calculation by clicking on or next to their names.

For less confusion especially in graphic output and for better program performance we suggest to select as few formulas as possible.

Should you want to select all formulas in the formula table, use the "Select All"-button. For de-selecting of all selected formulas use the "Unselect All"-button.


Modify formulas

CurveFit comes with a lot of predefined formulas which cover a lot of fit problems. Nevertheless it is sometimes necessary to create or modify your own formulas.

Therefore CurveFit provides simple methods for modifying formulas (Menu: Fit/Formula/Modify):

Create a new formula

Edit a Formula

Delete a Formula


Create a new formula

Choose the menu item: Fit/Formula/Modify.

The "New"-button enables you to create a new formula. If you want default values in your new formula you can select an already existing formula from the combo box and press the "Paste"-button instead of "New".

First enter a new name for the formula.

In the next text-field enter the formula. The formula you entered will be tested by the built-in formula parser. Refer to Parsing formulas.

In the "comment" field you should enter a short description of the formula parameters and their measurement units. When you perform a data fit, this line will remind you of the meaning of your parameters.

Checkbox "Linear"

The small checkbox at the bottom of the formula edit window lets you decide if the formula is regarded to be of type LINEAR (see Fit equations).

Linear formulas are fitted very quickly and the algorithm does not require any initial values. If you leave the check box unchecked the formula is supposed to be of type NON-LINEAR. Non-linear formulas require initial values and their calculation takes a little longer.


Edit a formula

Choose the menu item: Fit/Formula/Modify.

Select the formula you want to edit from the combo box. Then click the "Edit"-button. The formula window will appear, where you can perform your modifications.

For more information refer to Create a new formula.


Delete a formula

Choose the menu item: Fit/Formula/Modify.

To delete a formula from the current formula file, select the formula you want to delete in the combo box and press the "Delete"-button.


Parsing formulas

The built-in formula parser is very powerful.

The parser offers a lot of useful mathematical functions and enables you to give any name you like to a parameter.

If an error has occurred during parsing a formula, the parser marks the wrong character in the formula and tells you what kind of character he expects. Only a correct formula will be accepted by CurveFit.

The parser's features and restrictions :

Independent variable

X

Number of user defined parameters

10

Maximum characters in an user defined parameter

15

Allowed characters in an user defined parameter

alphanumeric, no leading number, not case-sensitive.

e.g.:  a, A1, kd, mass, speed_v1

Mathematical functions and constants

PI (), e, ln, log, exp, sin, cos, tan, arcsin, arccos, arctan, cot, arccot, sinh, cosh, tanh, arctanh, sqrt, frac, abs, signum.


Formula files

Formulas are saved onto disk in so called Formula Files. They are in ASCII Format, so it can be manually edited with any text editor. CurveFit displays the formula file which is currently in use in a formula table (Menu: Fit/Formula/Select).

Notice

CurveFit shows the file name of the current formula file in its statusline at the bottom of the mainwindow.

Refer to:

Create a new formula file

Load a formula file

Save a formula file


Create a new formula file

With menu: Fit/Formulafile/New you can create a new formula file.

A new, blank formula table will be created. You can add your own formulas.

Do not forget to save your new formula file onto disk !


Load a formula file

Before you can start a fit, you need at least one formula. Therefore you can load an existing formula file by selecting the menu item: Fit/Formulafile/Load.

CurveFit can read two types of formula files:

1.) Files with the extension EQU: These are CurveFit formula files, and

2.) files with the extension GLG:	 These are Chem-Fit formula files.

Chem-Fit formula files have the disadvantage that its formulas are not marked as linear or not-linear. So all Chem-Fit formulas are treated as non-linear ! If you want to mark one or more formulas as linear, then refer to Edit a Formula

Notice

CurveFit will load the last formula file you used whenever you start CurveFit, if you have selected the option "Load setup at program start" in the menu: Setup/Preferences.

See also:

Formula files


Save a formula file

After any modification you should save your formula file immediately. Select the menu item menu: Fit/Formulafile/Save.

Notice

CurveFit saves the formula file always in its special file format (files with the extension EQU). If you have loaded a Chem-Fit formula file, it will be saved as a CurveFit formula file, too. Afterwards Chem-Fit will not able to read this formula file again !


Fitting data

After you have loaded at least one data file (up to 5 !) and selected at least one formula (up to 40 !) you can start the data fit. If you have loaded more than one data file, make sure that the right one is selected (just click on it).

The next step should be, checking the settings in Fit Options (Menu: Fit/Options).

If everything there is to your satisfaction and after you have selected at least one formula for your data window and you can start the calculation (Menu: Fit/Calculate).

The calculation window will open (see also Fit Dialog).

You have the possibility to enter some initial values for your parameters, set parameter limits or constrain them to a constant value by selecting the "Edit Values"-button.

In the calculation window you can start the fitting process by selecting the "Start"-button. The first selected formula will be calculated. If you press the "Start All"-button, all selected formulas will be calculated one after another (until an error occurs or initial values are needed).

By selecting the "Next"-button, you switch over to the next selected formula.

During fitting process step by step you will see the parameter values change. You can stop the fitting process at any time by pressing "Stop".

After you stopped it (or after it stopped automatically), you can change the parameter values and start fitting process again (select the button "ReStart"), or you switch over to the next selected formula ("Next") and start its calculation ("Start"). Both steps "Next" and "Start" you can execute in one by pressing the "StartNext"-button.

After the calculation is done you can examine the result in a result window or in a graphic window.


Fit Dialog

The window shows you all formulas and their parameters when they are calculated - one after the other.

You can control the fit process with the four buttons "Start All", "Next", "Start" and "Cancel" in the right lower corner of the window.

Button	Action

Start All	Starts an automatic calculation of all selected formulas which do not need initial values.

Next	Switches over to the next formula. With this button you can step through all selected formulas without calculating them.

Start	Start the calculation for the actual formula

Cancel	Cancel the calculation and abandon all results

When a fit calculation is in process, you see four other buttons which offer the following functions :

Button	Action

Stop	Stops the calculation at the current status.

Restart	After a calculation is done of after you have stopped it, you can start the calculation again by pressing this button.

Start Next	Switches over to the next formula and starts the calculation (= "Next" + "Start")

Done	Closes the Fit Dialog.

The last button to be discussed is the "Edit Values"-button. It allows you to edit and modify the parameter values. (see Modify parameter values).

At the bottom of the window you will find a section entitled "Fitness". Here you can observe three values that represent the quality of a data fit :

sigma (Standard Regression)

It is a kind of measure for the quality of the data fit and can be used for comparative purposes.

(N ... number of data; M ... number of parameters; [image] ... data; [image] ... model function )

chi^2 (Chi Square) :

This value is also a measure for the quality of a data fit and takes in addition to Standard regression the measurement errors (weights) into consideration.

(N ... number of data, M ... number of parameters, [image] ... measurement data, [image] ... model function, [image] ... standard deviation of measurement data)

Rxy (Correlation coefficient) :

It is a measure for the correlation between measurement data and model. The closer the correlation coefficient is to 1 the better the data are described by the model.

(N ... number of data; M ... number of parameters; [image] ... data; [image] ... model function )


Fit Options

Before you do a fit calculation you should always check the settings in fit options (menu: Fit/Options).

Limits

In this section you can enter settings that affect the accuracy and the iteration process.

Arithmetic Accuracy

This setting is only available when Genetic algorithm is selected (Section Algorithm) and chooses a division rate of parameter space. The Genetic algorithm divides the parameter range (min - max) into discrete pieces. The more divisions the more exact a solution can be. "low" uses 1000 divisions (10 bit encoding), "medium" 30000 divisions (15 bit encoding) and "high" 33000000 divisions (25 bit encoding). The greater the accuracy, the longer it takes Genetic to fit your data. For good performance you should enter the parameter range (min, max) as small as possible and set the accuracy to "low". For common problems we suggest the "low" setting.

Maximum iteration steps

Here you can specify the maximum number of iteration steps the fit algorithm will use for one calculation. If the algorithm has found a solution of sufficient accuracy (error limit - see next paragraph) the calculation can stop before the maximum number of steps is reached.

Error Limit

If the error sum (chisq) calculated by your fit algorithm becomes smaller than the number you specify as Error Limit, the calculation stops. The number you enter here, depends on your data, your fit function and which accuracy you want to achieve. If you select an Error Limit which is too small, the fit calculation will not stop automatically. In this case you will have to stop the calculation manually ( Stop-button at the bottom of  calculation window).

Calculation Limit for X

Sometimes it is necessary to fit only some data points. This can happen when you use different models to describe different areas in your measurement data. You have to fit these areas one by one. With the settings in this section you can restrict the fit calculation to a special area (xfrom - xto).

Weighted Fit

If this option is enabled the errors (weights) of the Y-values (column Z in your data window) will be considered. The minimization of the data regression is calculated hereby with the following formula:

(N .. number of data, M.. number of parameters, [image] .. measurement data, [image] model function, [image] .. standard deviation of measurement data)

This means: The bigger the error range (deviation) of the corresponding measurement value, the smaller is the influence on the data regression. Therefore measurement data with a big deviation are not so important for the fit calculation.

Fit Algorithm

Please refer to Fit algorithms.


Modify parameter values

When you press the "Edit Values"-button in the Fit-Dialog window (Menu: Fit/Calculate), a parameter edit window will open where you can edit and modify their values.

You can also command CurveFit here to constrain a parameter to a certain value by clicking at the "Fix"-field. The value of a constrained parameter is held constant during a fit calculation.


Toolbar

Clicking one of the buttons in the toolbar is equal to a selection via menu.

The different buttons have the following functions :

Symbol	Function	Menu Item	Short Cut

Open a new data file	File / New

Open an existing data file	File / Open

Save a data file	File / Save

Print 	data/result/graphFile / Print

Zoom window	Window / Zoom	F5

Cut selected data	Edit / Cut	Ctrl + X  ( Shift + Del )

Copy to clipboard	Edit / Copy	Ctrl + C  ( Ctrl + Ins )

Paste from clipboard	Edit / Paste	Ctrl + V  ( Shift + Ins )

Select formulas	Fit / Formula /Select

Fit options	Fit / Options

Start calculation	Fit / Calculate

Show the fit results	Result / Show

Draw a data chart	Plot / Plot

Draw an error plot	Plot / Error Plot

Find outliers	Data / Outliers

Sensitivity Analysis	Plot / Sensitivity

Help	Help / Index


Data Window

All data entered, imported or pasted are shown in the so called "data window". This window contains a spreadsheet, which holds your data. Above the spreadsheet you find the "Edit  Field" where you can enter and modify the active (selected) spreadsheet cell. If you have selected more than one cell in the spreadsheet your modification affects all these cells.

Refer to:

SpreadSheet

See also:

Modifying data

Printing data

Saving data


SpreadSheet

Moving Around the Spreadsheet

You can move around the Spreadsheet by using the scroll bars or by moving the spreadsheet cursor with the keyboard. To select a specific cell, just click on it.

Function	Keystroke

Move one cell right or left

Move one cell up or down

Move one window view up or down	PgUp or PgDn

Move to the end of the worksheet 	End

Move to the top of the worksheet 	Home

Selecting a Block of Data

To select a block of spreadsheet cells, drag the mouse cursor over the desired cells, by holding the "Shift key" down and pressing the arrow, "PgUp", "PgDn", "Home" or "End" keys.

Another way of selecting a block is by using the mouse: select the upper left cell of the block you want to select. Then keep the left mouse key pressed and drag the mouse cursor over the cells you want to select.

To select entire rows or columns, click on the desired row or column labels.

To select entire rows or columns, click on the desired row or column labels.

To select all data in the spreadsheet, click the button in upper left corner of the cell area.

Inserting and Deleting Data Points

To delete selected data points, press the "Del"-key.

Sometimes it could be necessary to add or delete some more or less "convenient" data points. To do this CurveFit allows you to add or remove lines (rows) in your data window:

Insert one row

Select the cell or row before want the new row to be inserted in data windows spreadsheet.

Select the menu item "Insert Row" (menu: Data-Insert Row).

One row is inserted before the selected position.

Delete one or more rows

Select the desired row(s) in data windows spreadsheet.

Select the menu item "Delete Row" (menu: Data-Delete Row).

All selected rows are deleted.

See also:

Modifying data

Copy data to clipboard

Paste data from clipboard


Open data file

To read data from a data file, open an existing file (menu: File/Open).

A dialog will appear where you can select the file you want to open. If you have selected the "show load file dialog-option" in the preferences dialog (Menu: Setup/Preferences), the program will ask you for some load options :

Notice

CurveFit reads data from ASCII-files. These files could either be in IBM-PC or Macintosh file format. The first number in line is the X-value, the second the Y-value and the third (if existing) represents the error (or standard deviation) of the Y-value.


Create a new data file

To create a new data file, choose menu: File/New.

A data window with an empty spreadsheet opens.

Now you can enter data from the keyboard. When you type the number you want to enter in the edit field it will be written to the selected cell (active cell) of the spreadsheet below. If you choose to enter a number in more than one cell, select these cells in the spreadsheet, click at the edit-field and enter the number. All selected cells will contain the number entered.

See also:

Modifying data


Read Data Options

The dialog window "Read Data Options" appears whenever you load a data file.

Maximum number of records

Here you can enter maximum number of records you want to read.

X-Range / Y-Range

You can also set some limitations similar to a filter-function. You can advise CurveFit to read a record only if its X- and/or Y-value lies in the specified range.

Record

In addition to that you can specify the starting and the last record number CurveFit should read.

Step

The value in the "Step" field specifies the stepsize reading the data records. A stepsize of two e.g. only reads every second data record.

Notice

If you don't need to change read parameters every time you load a data file, you can disable this dialog window in menu: Setup/Preferences/Show load-file dialog.


Recent files

CurveFit stores the last five file names in menu "File" where you can select them.

To open one of the files listed in the menu, just click on its name.


Creating graphs

To visualize its results and other information CurveFit uses different graphs. They are shown in a "Graphic"-, "Error"- and in a "Sensitivity"-window.

Create a data/curve plot

Sensitivity Analysis

Error analysis


Graphic Window

For creating the graphic window choose the menu item "Plot" (Menu Plot/Plot).

The graphic window holds a chart containing your measurement data and the fitted formulas.

 Copy a data/curve plot to clipboard

Please note

CurveFit draws the fitted curves in this window whenever the window visibility or the window size has changed. Drawing a curve takes some time because many points must be calculated. How many time it takes depends on the number of fitted formulas.

We recommend to close the graphic window if you do not need it any more.


Data/curve plot

To create a chart containing your measurement data and the fitted formulas select the menu item "Plot" (Menu Plot/Plot).

A graphic windows will open which contains your chart. You can copy the contents of this window with "Copy" (Ctrl-C or Menu: Edit/Copy) to the clipboard and paste it in other applications.


Graphic options

In the Graphic Options Window you can modify the chart style and axes labels. You open the Graph Options window by selecting the menu item "Options" (Menu: Plot/Options).

In this window you can see a lot of different settings:

Graph title

The line you enter in this field is displayed in the graphic windows as a chart title. By default CurveFit suggests the filename of your data file.

Axis title

The next two text fields contain the labels for x- and y-axis. You can modify them according to your own needs.

Axis scaling

Sometimes it is necessary to show data in a logarithmic scale. This section enables you to choose between linear and logarithmic axis scaling.

For both axes you can select different scalings. If your data contain values less or equal zero be aware that logarithmic scaling does not display these data points.

Axis grid

Data charts are much easier to handle if you use grid lines.

In this section you can select gridlines for the x- and/or the y-axis.

Plot range

When you click at Plot Range X and/or Plot Range Y, only data points which lie in the specified range (from - to) are drawn. This gives you the opportunity to draw special areas of your data.

Color selection

CurveFit draws its graphs by default in color.

When you select the "Monochrome" option here in this section, the charts are drawn in black and white. To be able to distinguish between the different curves they are additionally marked by symbols. Monochrome graphs produce a better output quality when they are sent to a b/w printer.

Error bars

With this option you can turn on the drawing of error bars (z-column in your data window).


Result Window

The menu item "Show" (Menu: Result/Show) opens a window where you can inspect the results of the fit calculation.

You can see only one result a time. If you have selected and calculated (!) more than one formula, you can browse through the results by selecting the formula name in the combo box.

The results are arranged according to their individual fitness (chisq). The top of the list displays the best results - and on the bottom the worst results are placed.

See also:

Fit Result


Fit Result

After you have completed a fit calculation you can examine the results. They can be seen in an output window (Result-window), printed, saved to a file or be exported via copy and paste through the clipboard.

Result Window

Save the fit results

Load a result file

Notice

The clipboard provides a more elegant way to export CurveFit´s results than to save them onto disk and reload them from another application. By "Copy" (Ctrl+C, or menu: Edit/Paste) you can copy the result directly into the clipboard. With your results in the clipboard you can Paste them in any other Windows application that supports Clipboard access.

(see Copy result to clipboard)


Save the fit results

With menu item "Save" (Menu: Result/Save) you can save all your results in an internal- or in ASCII-format to disk.

A result file contains the following information :

•	Program version

•	File name

•	Date and time

•	Formula name(s)

•	Formula(s)

•	sigma(s)

•	chi square(s)

•	Rxy(s)

•	Parameter name(s), value(s) and standard deviation(s)

•	A list of all data points

•	An interpolation table with function values of the fitted formula(s)

Interpolation table

This table is very useful if you want to export your fitted curves to charting programs like MS-Excel.


Load a result file

To read fit results from a result file, open an existing file (menu: Result/Load).

A dialog will appear where you can select the file you want to open.

CurveFit will show the loaded fit results in a result window.


Error Analysis

After having fitted your data you should have a look at the local differences between your measurement data (reference) and your fit model(s) (formula(s)). By selecting the menu item "Error Plot" (Menu: Plot/Error Plot) you open the Error-window.

In this window you can see the vertical distances between data points and your fitted formulas. The smaller the distances the better the formula fits your data.


Sensitivity Analysis

If you have done complicated fit calculation and you are not sure if the parameters you have found are a global optimum or just a local one then you should perform a Sensitivity Analysis.

Starting from the result found by your data fit, one parameter is varied within its range (min - max) while the others are kept at their original values. Then chi square (here we call it error sum) is calculated. Usually the error sum grows when a parameter moves away from its original value. If the error sum grows for all your parameters in both directions it is a sign that you have found a global optimum in the specified range. You can modify the range by editing the parameter's min and max values in menu: Fit/Calculate.

By selecting the menu item "Sensitivity" (Menu: Plot/Sensitivity) you open the sensitivity window.

In the sensitivity window you can see a chart which shows the error sum according to the parameters value. Select the formula of which you want to analyze the results by selecting the formula name in the listbox at the bottom of the window. You can now examine all parameters by clicking at their name. A much more comfortable way to perform the analysis is to press the "Analyze"-button and start an automatic analysis. When an analysis is done you see a green, yellow or red lamp in front of each parameter name.

Green:

A green light indicates, that there is no better solution for the parameter possible.

Yellow:

A yellow light indicates, that there the parameter you found lies near (10% of total range) the optimum. In this case you should continue the fit calculation.

Red:

A red light indicates, that the solution you found is far away from the optimum. Your data fit was not successful. You have to repeat the calculation process once more.

When you want to examine the sensitivity plot of a special parameter, just click on its name.


Outliers - detection and removing

As it is usual for measurement data, some data points lie far away from all the others. We call them outliers and assume that they are caused by measurement errors like voltage peeks in amplifiers or sensors or by sources not known to us. They have to be removed because they influence our data fit as shown in the figure below.

To find and remove outliers you first have to perform a data fit with one or more formulas and all the data. Then you can open the outlier-window by clicking either the toolbar or by selecting the menu item: Data/Outliers.

In the combo-box at the right you see all fitted formulas. By selecting one of them you set it as a "reference" for the outlier detection (green line in the graphic window on the left side). The radiobuttons below the combo box determine the detection method : ABSOLUTE or RELATIVE.

absolute

All data of which the vertical distance to the fit curve is greater than the entered tolerance limit  are outliers.

relative

All data of which the vertical distance to the fit curve is greater than a certain percentage of the average deviation of all data points (average) are outliers.

With the "Find"-button you start the automatic detection process. All data points which are outliers are drawn in red - the others are drawn in green.

"Remove" kills all outliers (red points) which were found from your data window.


Setup

CurveFit saves its setup in the file "CURVEFIT.INI", which is located in the program directory. If you want to modify this file by hand you could edit it with any text editor.

Only if you have selected the option "Save setup at program exit" in menu: Setup/Preferences, the actual program settings are saved onto disk when you end the program.

At program start they are only loaded if the option "Load setup at program start" is enabled in Preferences.

Load setup

Save setup


Preferences

By selecting the menu item "Preferences" (Menu: Setup/Preferences) you open the preferences window.

The options you can select are described below:

Number Format

Decimal separator

Here you have the option to display your floating point numbers with a full stop or with a comma.

Notation

This option changes the format in which numbers are written in CurveFit. Please refer to chapter Changing Number Format for more information.

File Format

This options tells CurveFit which file format to use when saving a data- or result file.

IBM Format

The file is saved as DOS text.

Macintosh

The file is saved as a text for Apple computers.

Setup

Load setup at program start

 ... loads the settings saved in CURVEFIT.INI.

Save Setup at program exit

 ... saves the settings in CURVEFIT.INI when you end CurveFit. If you do not want to keep your settings, disable this option.

Load last data file at program start

If this option is enabled, CurveFit loads the last data file you worked with on program start.

Show load file dialog

In many cases you may want to read all data, without any limitations from your data file. With this options you can hide the Load File Dialog when you open a data file.


Load setup

You can load the last saved settings with the "Load" menu item (Menu: Setup/Load).


Save setup

"Save" (Menu: Setup/Save) saves the current settings onto disk.


Arrange windows
The menu item "Window" allows you to arrange all windows (data-, graph-, result-, outlier-, sensitivity- windows) you use in this program.

Zooming Windows

You can click at CurveFit´s windows, move them and resize them by clicking at their borders. If you want to zoom windows to their maximum size, press the F5-key or use menu: Window/Zoom.

Cascading Windows

Cascading windows (Shift+F5 or menu: Window/Cascade) piles all your windows in a way that they overlap. You will see all window titles and can select the window by a simple mouse click.

Tiling Windows

Tiling (Shift+F4 or menu: Window/Tile) arranges all your windows so that they do not overlap.

Selecting Open Windows

All open windows are listed in the Windows menu. They can be activated (selected) by clicking on their name.


Help system

Using Help

CurveFit provides a fully integrated context sensitive help system, which is based on Windows help. Press the "F1" key anytime you need help. You also can browse through the help index to find your topic of interest.

Windows Help

If you are not familiar to the Windows help system please refer to your MS-Windows Manuals.


Dialogbox Print

The Print dialog box contains controls that let a user configure a printer for a particular print job. The user can make such selections as page range and number of copies (if the printer supports multiple copies).

The button "Setup" allows a user to configure the selected printer.


Select printer

In the dialog window "Select Printer" you can choose one of the listed printers for printing out of CurveFit.

The button "Setup" opens the dialog window "Installation: ...." showing options which depend on the features of your printer.

Now you can change the normal printer configuration.


Printing data

A printout of your data can directly be done from CurveFit.

Select the desired data window you want to print by activating it (just click on it) and select File/Print from the menu.

The standard print dialog will appear. Go ahead by pressing the "OK"-button.

Please note

Another way of printing your data is to copy your data via clipboard to another application which is able to print it.


Printing graphs

A printout of your data/curve plot or your error plot can directly be done from CurveFit.

Select the desired graphic or error window you want to print by activating it (just click on it) and select File/Print from the menu.

The standard print dialog will appear. Go ahead by pressing the "OK"-button.


Leaving CurveFit

You can exit CurveFit by choosing menu: File/Exit or keystroke "Alt"+"F4".

If there is a data window holding data which has been changed, CurveFit will ask you if you would like to save the data.

If you have modified the active formula table, CurveFit will ask you if you would like to save the formula file.


Mathematical Functions

CurveFit's integrated Formula Parser offers the following mathematical functions and constants :

name	type	comment

(	o	open parenthesis

)	o	close parenthesis

+	o	add

-	o	subtract

*	o	multiply

/	o	divide

^	o	raised to power

X	v	x-value at current row

Y	v	y-value at current row

Z	v	z-value at current row

R	v	current row number

PI	c	=3.1415926535897932384

e	c	e=2.7182818284590452354

RND	f	generates a random number [0<=RND<1]

ln(x)	f	natural logarithm (base = e)

log(x)	f	logarithm (base = 10)

exp(x)	f	exponential function (= e^x)

sin(x)	f	sine of x

cos(x)	f	cosine of x

tan(x)	f	tangent of x

arcsin(x)	f	arcus sine of x

arccos(x)	f	arcus cosine of x

arctan(x)	f	arcus tangent of x

cot(x)	f	cotangent of x

arccot(x)	f	arcus cotangent of x

sinh(x)	f	hyperbolic sine of x

cosh(x)	f	hyperbolic cosine of x

tanh(x)	f	hyperbolic tangent of x

arctanh(x)	f	hyperbolic arcus tangent of x

sqrt(x)	f	square root of x

frac(x)	f	fractional portion of x (-0.234 if x=-1.234)

abs(x)	f	absolute value of x

signum(x)	f	signum of x

type : o ... operator, v... variable, f ... function

All functions and constants shown above can be used in the data windows edit field and as well in formulas.


OVERV_Toolbar
This is the toolbar. Clicking on of the buttons is equal to a selection via menu.


OVERV_Datawindow
This is the data window. It contains the spreadsheet which holds your data.

Here you can modify your data.


OVERV_Graphicwindow
This is the graphic window. It contains a plot which shows your data points and fitted curves.


OVERV_Resultwindow
This is the result window. It contains your fit results.


OVERV_Memorystatus
This area of the status line shows the remaining free memory of your computer system.


OVERV_Statusline
This area of the status line displays the status of CurveFit or you get the information what CurveFit is doing.


OVERV_Infoline
This area of the status line contains the name of the active formula file or it displays the formula you have selected within a window.