Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Fitting complex data from dielectric spectrum to a complex parametric model

2 views
Skip to first unread message

Benjamin

unread,
Feb 13, 2012, 11:29:11 AM2/13/12
to
Hello to everyone,

I am trying to extract the parametric values from fitting a set of dielectric spectrum complex data to a complex model as a function of the angular frequency w. As you can see, the dielectric model "d" is a complex function and the parameter vector "a" is real by definition.

However, the results do not show a good agreement when I plot the data "Y" versus the model "d" using the parameters "afinal" obtained from the fitting.

Anyone know how to fit this system of equations? Any ideas? Tips?

Thanks in advance.


global X Y
a; % is the initial vector model parameters
X; %X are the frequency values
Y; %Y are the dielectric complex data

%options for the non-linear fitting
options = optimset('MaxFunEvals',10000);
options = optimset(options,'MaxIter',5000);
options = optimset(options,'TolFun',1e-9);
options = optimset(options,'TolX',1e-9);

[afinal,RESNORM,RESIDUAL,EXITFLAG] = lsqcurvefit(@myfun2,a,X,Y,[],[],options);

function d = myfun2(a,X)
%a=[a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14]
e0=8.85e-12; %vacuum permittivity

d = a(1)+ ...
(a(2)./(1+(1i*2*pi*X*a(3)).^(1-a(4))))+ ...
(a(5)./(1+(1i*2*pi*X*a(6)).^(1-a(7))))+ ...
(a(8)./(1+(1i*2*pi*X*a(9)).^(1-a(10))))+ ...
(a(11)./(1+(1i*2*pi*X*a(12)).^(1-a(13))))+ ...
a(14)./(1i*2*pi*X*e0);

ron

unread,
Mar 30, 2012, 6:01:26 PM3/30/12
to
"Benjamin " <benja...@gmail.com> wrote in message <jhbdon$4lc$1...@newscl01ah.mathworks.com>...
If you have the answer to this one, tell me. (even just for brainstorming)

Roger Stafford

unread,
Mar 30, 2012, 11:16:12 PM3/30/12
to
"Benjamin " <benja...@gmail.com> wrote in message <jhbdon$4lc$1...@newscl01ah.mathworks.com>...
> I am trying to extract the parametric values from fitting a set of dielectric spectrum complex data to a complex model as a function of the angular frequency w. As you can see, the dielectric model "d" is a complex function and the parameter vector "a" is real by definition.
- - - - - - - - -
The documentation for 'lsqcurvefit' contains what is apparently the explanation for your difficulties. It states, under "Limitations", that "lsqcurvefit only handles real variables (the user-defined function must only return real values). When x has complex variables, the variables must be split into real and imaginary parts." See the Mathworks website at:

http://www.mathworks.com/help/toolbox/optim/ug/lsqcurvefit.html

I interpret that to mean that you will have to split both X and Y into real and imaginary parts and the same with d = myfun2(a,X). Your vectors will therefore have to be doubled in length. However your real-valued parameter vector 'a' is presumably all right as it stands.

Roger Stafford
0 new messages