# Thread: calculating unknown and solving equation

1. ## calculating unknown and solving equation

Hi
I work as an air quality researcher and am trying to calculate two unknowns in an equation. I have a set of results (ATN= attenuation of light measured on a filter; BC= black carbon concentration) and according to literature the data should fit the following equation (derived from the Lambert-Beer-law):
ATN= -100 ln (α + (1-α) exp(-σ [BC])).
1) I have a set of ATN and corresponding BC measurements (about 300) but need to determine best fit for α (a sort of filter constant) and σ (specific attenuation) as these vary according to the measurement site and filter used.
2) I have a further 600 measurement where I only have attenuation and need to then use the equation and calculate BC.

What's the best way to go about it/best software to use maybe and how to use it (for problem number one)? And for step two I might need some help solving the equation to BC as well...

Thanks

Anja

2. ## Re: calculating unknown and solving equation

Just so I am clear about the equation, I have re-written it with TeX:

$ATN= -100 \ln (a + (1-a) \exp [-\sigma (BC)])$

It can be re-arranged very slightly:

$ATN/100 = - \ln (a + (1-a) \exp [-\sigma (BC)])$

but it doesn't help very much.

If you only had to find a best fit for one variable, I would have suggested using a Linear (or Non-Linear) Least Squares data-fitting routine, depending on the curve described by the data. However, I have never seen it done for two variables. Perhaps MATLAB or some other commercial software package has these capabilities which I don't know about. Do you have access to MATLAB or a similar package?

Alternately, perhaps you could assume an exact equation, pick two points, and simply solve for the equation at those points (two equations in two unknowns).

Not sure what else to suggest.

3. ## Re: calculating unknown and solving equation

Hi !

Your problem is to fit a non linear function to experimental data, i.e. : a non linear regression.
All statistic packages can do that, using recursive algorithms.
I want to draw to attention another method, which consists first to transform the non linear problem to a linear problem, thanks to a convenient integral equation. That way, a simple linear regression is sufficent and no complicated algorithm is required.
Originally Posted by AHT
I work as an air quality researcher and am trying to calculate two unknowns in an equation. I have a set of results (ATN= attenuation of light measured on a filter; BC= black carbon concentration) and according to literature the data should fit the following equation (derived from the Lambert-Beer-law):
ATN= -100 ln (α + (1-α) exp(-σ [BC])).
1) I have a set of ATN and corresponding BC measurements (about 300) but need to determine best fit for α (a sort of filter constant) and σ (specific attenuation) as these vary according to the measurement site and filter used.
The general principle of the method using an integral equation and linear regression is explained in the paper : "Régressions et équations intégrales" (not translated yet), through the link :
JJacquelin's Documents | Scribd
Nevertheless, if necessary, I could give you all the details of the algorithm coresponding to your problem (if you need it, send me a private message). In fact, the algorithm will be non recursive, very short (a few lines). The integral equation to be used in this case is shown in attachment.

4. ## Re: calculating unknown and solving equation

@David: I have access to MATLAB and will try it - I have never used it before but I think from what I have googled, you can enter your own equation to try and fit.
@JJacquelin: if I do non-linear regression, will I not get a different formula for my data set? My thought was to try and fit my data set to the equation that underlies the measurement principle...I will have a read through the attachment.
Thanks again!!!

5. ## Re: calculating unknown and solving equation

Using MATLAB will be the the classical way to solve your problem. So, I suggest you to do it.
The method using an integral equation also fits your equation to your data set. There is no change in the equation that underlies the measurement principle.
In fact, the initial data set is first transformed to another data set. The advantage of the new data set is to allow a linear regression instead of a non linear regression. But the parameters alpha and sigma are not changed. The linear regression gives the approximate values of these parameters. Then, you bing them back into the equation that underlies the measurement principle and the fitting is obtained with your data set.

6. ## Re: calculating unknown and solving equation

Sorry for the mistake while sending an answer to another topic.