# Curve Fitting

1. Aug 25, 2004

### kprokopi

hi,
I face the following problem.
I need to find the best values of the parameters $a,b,c$
of the complex function $f(x)=a+\frac{b-a}{1+j x c}$ of the real
variable $x$ where ($j^2=-1$)
such that
$f(2 \pi 10^6)=2.33-j 1.165 10^{-3}$ and
$f(2 \pi 10^{10})=2.347-j 3.7552 10^{-3}$.

It seems to be a curve fitting problem but the function $f(x)$ is complex!

2. Aug 25, 2004

### arildno

True enough; you have three constants to optimize to 4 restraints.

3. Aug 25, 2004

### HallsofIvy

Oh, those engineers and their jmaginary numbers!

4. Aug 26, 2004

### arildno

To get you started:
1. Define:
$$x_{0}=2\pi{10}^{6}$$
$$x_{1}=2\pi{10}^{10}$$
Why have you been given so huge arguments?
In particular, can I use that fact to my advantage later on?

2.Rewrite:
$$f(x)=a+\frac{b-a}{1+jxc}=a+\frac{1-jxc}{1-jxc}\frac{b-a}{1+jxc}=\frac{ax^{2}c^{2}+b}{1+x^{2}c^{2}}+j\frac{(a-b)xc}{1+x^{2}c^{2}}$$
3. Requirements of curve fitting:
$$\frac{ax_{0}^{2}c^{2}+b}{1+x_{0}^{2}c^{2}}\approx{2.33}$$
$$\frac{ax_{1}^{2}c^{2}+b}{1+x_{1}^{2}c^{2}}\approx{2.347}$$
$$\frac{(a-b)x_{0}c}{1+x_{0}^{2}c^{2}}\approx{-1.16510*10^{-3}}$$
$$\frac{(a-b)x_{1}c}{1+x_{1}^{2}c^{2}}\approx{-3.755210*10^{-3}}$$
4. Define:
$$y_{0r}=2.33,y_{1r}=2.347,y_{0i}=-1.16510*10^{-3},y_{1i}=-3.755210*10^{-3}$$
5. Define:
$$\hat{y}_{0r}=\frac{ax_{0}^{2}c^{2}+b}{1+x_{0}^{2}c^{2}}$$
$$\hat{y}_{1r}=\frac{ax_{1}^{2}c^{2}+b}{1+x_{1}^{2}c^{2}}$$
$$\hat{y}_{0i}=\frac{(a-b)x_{0}c}{1+x_{0}^{2}c^{2}}$$
$$\hat{y}_{1i}=\frac{(a-b)x_{1}c}{1+x_{1}^{2}c^{2}}$$

6. Construct:
$$S(a,b,c)=(y_{0r}-\hat{y}_{0r})^{2}+(y_{0i}-\hat{y}_{0i})^{2}+(y_{1r}-\hat{y}_{1r})^{2}+(y_{1i}-\hat{y}_{1i})^{2}$$

Clearly, S>=0, and S=0 if and only if the curve fitting is exact.
We are interested in the choice of (a,b,c) such that a minimum of S is found.
Hence, we should consider the system of 3 equations:
$$\frac{\partial{S}}{\partial{a}}=0$$
$$\frac{\partial{S}}{\partial{b}}=0$$
$$\frac{\partial{S}}{\partial{c}}=0$$

This system can (theoretically, at least!) be solved for minimizing values
$$(a_{m},b_{m},c_{m})$$
To find a simple, approximate solution to the system of equations, I suggest that you utilize your knowledge that $$(x_{0},x_{1})$$ are huge numbers.
Good luck!
NOTE:
This is just one of many techniques to derive curve-fitting coefficients.
It is by no means clear that this technique provides the simplest system to solve for coefficients (a,b,c). Look up in a numerical analysis book (or something like that) to get other ideas..

Last edited: Aug 26, 2004
5. Aug 26, 2004

### Corneo

Hahaha :rofl: