function [Error] = opskinmodel(x)
Einf=x(1);
Es_cole(1)=x(2);
Es_cole(2)=x(3);
Es_cole(3)=x(4);
Es_cole(4)=x(5);
Tau(1)=x(6);
Tau(2)=x(7);
Tau(3)=x(8);
Tau(4)=x(9);
Cond=x(10);
alpha(1)=x(11);
alpha(2)=x(12);
alpha(3)=x(13);
alpha(4)=x(14);
freq=90e9;
Eo = 8.854e-12;
g =1:1:(freq/1e9);
CondGabData=xlsread('tissueproperties(final).csv','C:C');
PermGabData=xlsread('tissueproperties(final).csv','D:D');
i=1;
j=sqrt(-1);
m=1;
Error=0;
PDiff=0;
CDiff=0;
for f =1e9:1e9:(freq)
tmp = 0;
for k=1:4
tmp = tmp + Es_cole(k) / (1 + (j * 2 * pi * (f) * Tau(k)))^(1-alpha(k));
end
Er_relative(i) = Einf + tmp + Cond/(j * 2 * pi * (f) * Eo);
Er(i)=real(Er_relative(i));
Ei(i)=-imag(Er_relative(i));
Conductivity(i)=Ei(i)*Eo*2*pi*f;
i=i+1;
end
for f=1e9:1e9:freq;
lossfactor(m)=CondGabData(m)/(Eo*2*pi*f);
PDiff=PDiff+((PermGabData(m)-Er(m))/median(Er))^2;
CDiff=CDiff+((CondGabData(m)-Conductivity(m))/median(Conductivity))^2;
m=m+1;
end
Error=(PDiff+CDiff)/length(g);
3 Comments
Direct link to this comment
https://es.mathworks.com/matlabcentral/answers/274996-genetic-algorithm-taking-too-long-to-optimize#comment_352461
Direct link to this comment
https://es.mathworks.com/matlabcentral/answers/274996-genetic-algorithm-taking-too-long-to-optimize#comment_352461
Direct link to this comment
https://es.mathworks.com/matlabcentral/answers/274996-genetic-algorithm-taking-too-long-to-optimize#comment_352483
Direct link to this comment
https://es.mathworks.com/matlabcentral/answers/274996-genetic-algorithm-taking-too-long-to-optimize#comment_352483
Direct link to this comment
https://es.mathworks.com/matlabcentral/answers/274996-genetic-algorithm-taking-too-long-to-optimize#comment_352507
Direct link to this comment
https://es.mathworks.com/matlabcentral/answers/274996-genetic-algorithm-taking-too-long-to-optimize#comment_352507
Sign in to comment.