I need help with optimization problem

2 Ansichten (letzte 30 Tage)
Merve
Merve am 27 Sep. 2014
Kommentiert: Matt J am 5 Okt. 2014
I have an optimization problem with 6 variables. The fitness function I use have two outputs: the frequency and the power. What i want to do is to fix the frequency to a range and maximize the power output. However, i could not fix the frequency. Could you please help me?
  2 Kommentare
Star Strider
Star Strider am 27 Sep. 2014
Please post your fitness function and your data, and a breif description of what you are doing. What are you optimising?
Merve
Merve am 27 Sep. 2014
Bearbeitet: Matt J am 27 Sep. 2014
This is my fitness fucntion
function [TVRmin ] =optcircuit6variable(x)
rout_pzt=x(1);
rin_pzt=x(2);
t_pzt=x(3);
Mh=x(4);
rh=x(5);
Mt=x(6);
%Input Properties
fn=15000;
deltaf=5000;
nr_pzt=4;
%%%%%%%%
rho=7.5e3;
eps0=8.85e-12;
eps33s=eps0*6.35e2;
d33=2.8e-10;
tanDirac=0.1;
dw=1000;
cw=1500;
dalu=2780;
Kg=5.456e9;
s33E=1.55e-11;
%Piezoceramic Stack
A_pzt=pi*(rout_pzt^2-rin_pzt^2);
Ecs=1/s33E;
Kcs= Ecs*A_pzt/(t_pzt*nr_pzt);
Mcs=A_pzt*t_pzt*nr_pzt*rho;
Cf=nr_pzt*eps33s*A_pzt/t_pzt; % free capacitance
k33=d33/(s33E*eps33s)^0.5;
C0=(1-k33^2)*Cf;
N=d33*A_pzt/(s33E*t_pzt);
%Head Mass
Ah=pi*rh^2;
th=Mh/dalu/Ah;
%Tail Mass
%Stud
Ks=Kcs/10;
f1=fn-1.5*deltaf;
%f1=fn-2*deltaf;
f2=fn+1.5*deltaf;
Vin=1;
f=f1:1:f2;
for jj=1:length(f)
w(jj)=2*pi*f(jj);
k(jj)=w(jj)/cw;
kaw(jj)=k(jj)*rh;
J1(jj)=besselj(1,2*kaw(jj));
H1(jj)=StruveH1(2*kaw(jj));
Rr(jj)=dw*cw*Ah*(1-J1(jj)/kaw(jj));
Mr(jj)=dw*cw*Ah*(H1(jj)/kaw(jj));
Zq(jj)=Rr(jj)+j*Mr(jj);
z1(jj)=j*w(jj)*Mcs/2+j*w(jj)*Mh+Zq(jj);
z2(jj)=j*w(jj)*Mcs/2+j*w(jj)*Mt;
z3(jj)=z1(jj)*z2(jj)/(z1(jj)+z2(jj))-j*w(jj)*Mcs/6;
z4(jj)=-1i*Kg/w(jj);
z5(jj)=z3(jj)*z4(jj)/(z3(jj)+z4(jj))-1i*Ks/w(jj)-1i*Kcs/w(jj);
z6(jj)=z5(jj)/N^2;
z7(jj)=-i/w(jj)/C0;
z8(jj)=1/(w(jj)*Cf*tanDirac);
z9(jj)=(1/z6(jj)+1/z7(jj)+1/z8(jj))^-1;
Admittance(jj)=1/z9(jj);
% Directivity Factor and Directivity Index
Df(jj)=kaw(jj)^2/(1-J1(jj)/kaw(jj));
DI(jj)=10*log10(Df(jj));
% TVR
i1(jj)=Vin*N/z5(jj);
i5(jj)=i1(jj)/(z3(jj)*(z2(jj)+z1(jj))/(z2(jj)*z4(jj))+(z2(jj)+z1(jj))/z2(jj));
Wa(jj)=i5(jj)*conj(i5(jj))*Rr(jj);
TVR(jj)=10*log10(Wa(jj))+DI(jj)+170.8;
end
[TVRmax,fTVR]=max(TVR);
TVRmin=1/(1+TVRmax);
[~, res]=max(real(Admittance));
fres=f(res);
I have an objective TVRmin. And I try to fix fres to a range of value without treating it as an objective.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Matt J
Matt J am 27 Sep. 2014
It sounds like fmincon or ga could be used with the nonlcon argument to constrain the frequency.
  3 Kommentare
Merve
Merve am 4 Okt. 2014
How can I use nonlcon command for the frequency? Could you help me?
Matt J
Matt J am 5 Okt. 2014
The frequency is, I assume, a nonlinear function of the decision variables. Therefore, you have nonlinear inequality constraints,
[c,ceq]=nonlcon(x)
ceq=[];
c(1)=frequency(x)-upperbound;
c(2)=lowerbound-frequency(x);

Melden Sie sich an, um zu kommentieren.

Community Treasure Hunt

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

Start Hunting!

Translated by