Does simulation annealing minimize objective function which has non constant parameter?

Main File
============================
a0 = [.0001 .0001 .0001 .0001 .0001 ];
w = linspace(0,pi,1000);
for i=1:length(w)
w_scal=w(i);
f =@(a)abc(a,w_scal);
[a_vec fval] = simulannealbnd(f,a0);
end
Function File
============================
function ARE = abc(a,w)
ERR = ((1/(j*w)) - ((a(1)*exp(2*j*w) + a(2)*exp(j*w) + a(3)) / (exp(2*j*w)+a(4)*exp(j*w) + a(5)))/(1/(j*w)));
ARE = sum(ERR.^2);
After estimating variables a(1),a(2)..a(5), the ARE's Plot w.r.t w(Omegha)is.
===========================================================================
But The plot should draw like these two graphs.
===============================================
Conclusively, coefficients a(1)....a(5) are not estimated correctly.
Thanks,
Nitin

 Réponse acceptée

I still don't see where you set the variable "j" in your function "abc".
Best wishes
Torsten.

3 commentaires

The Variable 'j' is a imaginary Unit.
I m using abs() function to calculate absolute value out of a imaginary no.
Thanks, Nitin
I don't see any abs() function in the definition of ARE...
To minimize a function, it has to be real-valued.
Best wishes
Torsten.
What you do above does not make sense to me.
For one value of w, you try to estimate 5 parameters a(1),...,a(5) to make ARE minimal.
My guess is that you want to minimize sum_{i=1}^{n} ARE(i)'*ARE(i)
with
ARE(i)= ((1/(j*w(i))) - ((a(1)*exp(2*j*w(i)) + a(2)*exp(j*w(i)) + a(3)) / (exp(2*j*w(i))+a(4)*exp(j*w(i)) + a(5)))/(1/(j*w(i))));
but I'm not sure.
Best wishes
Torsten.

Connectez-vous pour commenter.

Plus de réponses (0)

Produits

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by