optimization of a function using optiminzation toolbox commands
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Hello,I have built a function in the code shown bellow.The function is plotted as follows.
my goal is to lower the lobe at X=-22 from -7.4 to -15 without changing the rest of the plot.
For that i need to optimize real_voltage and phases vectors.
Is there a matlab function which could use maybe "genetic algorithm" to get me values of real_voltage and phases vectors which would produce such result?
Thanks.
clear all
clc
amplitude_norm_V=[1,1,1,1,1,1,1,1];
x=sqrt(1/(sum(amplitude_norm_V.^2)));
real_voltage=amplitude_norm_V.*x;
real_power=(real_voltage.^2);
sum(real_power);
phases=[0,0,0,0,0,0,0,0]
theta=linspace(-pi/2,pi/2,1000);
theta_0=pi*((0)/180);
f=5.6;
N=10;
lambda=300/f;
k=(2*pi)/lambda;
d=0.8*lambda;
total=0;
tot=0;
delta=k*d*sin(theta_0);
for z=1:8
AF=real_voltage(z)*exp(1i*(phases(z)/180*pi))*exp(-1i*(z-1)*(k*d*sin(theta)+delta));
total=total+AF;
end
plot((theta/pi)*180,20*log10(total));
0 Kommentare
Antworten (0)
Siehe auch
Kategorien
Mehr zu Genetic Algorithm finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!