Curve FittingUpdated 25th May 2018IntroductionWhen I joined Chemistry Division in the Department of Scientific and Industrial Research in 1974 I worked on Atomic Spectrometry with Dr. Reiner Goguel. This was mostly Atomic Absorption Spectrometry and Atomic Emission Spectrometry of solutions to determine their elemental composition. The working curves of concentration versus absorbance or emission were typically nonlinear. There was reasonable linearity for small signals but as the amplitude increased, so did the nonlinearity. This situation is not easily described by a simple function. For example, a certain commercial Atomic Absorption Spectrometer had a built in polynomial fitting routine for flame emission. For some flame emission signals negative concentrations were returned by this instrument. For flame emission two processes occur. The signal amplitude grows linearly with concentration until the emitted signal reaches an amplitude matching that emitted by a black body at the emission wavelength and temperature. Spectral line broadening dominates after that as the black body temperature is never exceeded at any wavelength. The first process tends to be linear while the second is parabolic.^{*} An EquationGiven the above information, a calibration equation is required which is linear for low concentrations and parabolic at high concentrations. To cater for other systems such as atomic absorption the second part of the equation was generalised to include a parabolic curve of any order. The following equation works and it found extensive use in our routine atomic spectrometry. y is a concentration and x is the instrument signal reading. y = a.x^{b} + c.x.e^{(d.x)}^{*}The equation models the two features of typical flame emission curves outlined above. The first term is a parabola of order b. The second term has a linear part multiplied by an exponential which reduces the effect of this term for large x. Possible values of the exponential factor range from 0 for large x to 1 for small x. It acts as a switch. No switching is necessary on the first parabolic term of the equation. The second linear part dominates at low x. Four sets of readings are needed to solve this equation. x_{1} is typically a blank reading for y_{1} = 0. For example:
Before using the equation let x_{i}=x_{i}*10/x_{4} Normalising avoided exceeding the numeric range of programmable scientific calculators on certain data sets. After using the equation let y_{i}=y_{i}*y_{4}/10
It was the accurate fitting of experimental data that enabled this equation to be used routinely. For flame emission data the fit covered several orders of magnitude, provided the instrument slit width was wide enough  typically 5 nm for Na at 1000ppm. With narrower slits the useful concentration range is reduced. It was easy to make up intermediate standards to confirm the accuracy of the curve fitting. In most flame emission cases the order b of the equation was slightly greater than 2, as expected. There may be several other equations that could be tried. Most are based on using an exponential term as a soft switch to gradually change from a linear equation to a parabolic form I was lucky that the equation above worked very well with my experimental data, so at the time I explored only a few other options. SoftwareSeveral useful programs make up the AAFlame software collection:
Because the programs are now somewhat dated they should be run using the emulator DOSBOX. This allows DOS programs to be run on most computers. Picasa can be used to grab any screen images of calibrations. BICURVE was very useful for accurate work since curvature and baseline drift could be compensated if standards were run before and after the samples. There are two version of the software included. AAflame4.exe is for manual input of data only. AAFlame3.exe software can be used on any AA with an analog signal output and it would be useful for modernising old instruments. AAFlame3.exe is intended to be used with a Pico ADC16 datalogger. A PC capable of running DOS or opening a DOS window is the minimum requirement to run this software. A functioning RS232 serial port is also required. An old computer is ideal. HP15c/DM15 CurveP program  CurveP.15cI originally wrote a Curve program for the HP65 programmable calculator. Lately I have rewritten a program CurveP.15c for a HP15c or DM15 calculator. The HP15c model is no longer available but a DM15 calculator is available from SwissMicros. This calculator is the size of a credit card and has more memory than the HP15c. The calculator can communicate with a very nice HP15c simulator from Torsten Manz. The advantage of this arrangement is that programs can be saved to and loaded from a computer. The simulator also allows extensive documentation to be saved in the program file. Programs are saved as plain text. An HTML summary file can also be created, for example, as CurveP.htm. I have now written a new web page entitled SwissMicros DM15 Scientific Calculator. HP15c/DM15 Stray light curvature program  StrayLightP.15cStrayLightP.15c is a program which corrects spectrophotometric data when stray light is present. It is an HP15c or a DM15 scientific calculator program. The summary file StrayLightP.htm contains instructions and a program listing. HP15c/DM15 Mercury Analyser calibration curve program  HgCalP.15cA good calibration curve can be obtained using a simplified Dumarey equation  Reference: R. Dumarey, E. Temmerman, R. Dams, J. Hoste, Analyt. Chim. Acta 170, 337 (1985). The program HgCalP.15c uses a temperature in degrees celcius to calculate the concentration of mercury in ng/ml in a calibration vessel. The summary file HgCalP.htm contains instructions and a program listing. HP15c/DM15 Regressions with a single entry of a data set  Stat4P.15cFor general curve fiiting Stat4P.15c provides linear, logarithmic, power and exponential regressions with a single entry of a data set. This program is an adaptaton of software I wrote for a personal computer in 1984. For most statistical work a personal computer is best, but this program is good for a first look at experimental data. The summary file Stat4P.htm contains instructions and a program listing. ConclusionSome of these programs were used at DSIR Chemistry Division for many years. The flame emission curve fitting routines were particularly valuable when saline solutions were analysed as a wide range of concentrations could be handled in a single run. A colleague was even able to use the same equations to accurately model some oil viscosity data. The Stat4P.15c regression program is recent. Publications

JEPSPECTRO  Home Page Email: replace at with @ jepattersonatactrix.co.nz AAFlame Software AAFlame Documentation DOSBOX HP15c/DM15 CurveP Software SwissMicros HP15c simulator SwissMicros DM15 Scientific Calculator AcetyleneNitrous Oxide flame. AAFlame programs. AAFlame calibration. AAFlame calibration. SwissMicros DM15 calculator 