I have problem in plot

2 views (last 30 days)
m m
m m on 20 Oct 2012
I have probelm in this code because it appear as discrete point not contious????
for er=[2,4.3,5.4,6.2,7.6,8.5,10.3,12] h=.16; con=10^7; lt=0.025; Zin=50; lambda_o=30.0/freq; ko=2.0*pi/lambda_o; F=8.791/(freq*sqrt(er)); a=F/sqrt(1+2*h/(pi*er*F)*(log(pi*F/(2*h))+1.7726)); ae=a*sqrt(1+2*h/(pi*er*a)*(log(pi*a/(2*h))+1.7726));
  2 Comments
Azzi Abdelmalek
Azzi Abdelmalek on 20 Oct 2012
what is your question?
m m
m m on 20 Oct 2012
dear neglected the qu. above, I have new answer you can see below ||freq=.1:.1:1; er=4.3; h=.16;
F=8.791/(freq*sqrt(er)); a=F/sqrt(1+2*h/(pi*er*F)*(log(pi*F/(2*h))+1.7726)); ae=a*sqrt(1+2*h/(pi*er*a)*(log(pi*a/(2*h))+1.7726));
plot(fr,a,fr,ae,'-o','-r') hold all||
when run this code appear this :
*??? Error using ==> mrdivide Matrix dimensions must agree.
*Error in ==> random at 5 F=8.791/(freq*sqrt(er));*
your support please

Sign in to comment.

Accepted Answer

Azzi Abdelmalek
Azzi Abdelmalek on 20 Oct 2012
Edited: Azzi Abdelmalek on 20 Oct 2012
% F is a vector, use .* instead *
er=[2,4.3,5.4,6.2,7.6,8.5,10.3,12]
freq=1
h=.16; con=10^7;
lt=0.025;
Zin=50;
lambda_o=30.0/freq;
ko=2.0*pi/lambda_o;
F=8.791/(freq*sqrt(er));
a=F/sqrt(1+2*h/(pi*er*F)*(log(pi*F/(2*h))+1.7726)); % F is a vector, use .*
ae=a*sqrt(1+2*h/(pi*er*a)*(log(pi*a/(2*h))+1.7726));
freq=.1:.1:1;
er=4.3;
h=.16;
F=8.791./(freq*sqrt(er));
a=F./sqrt(1+2*h./(pi*er*F).*(log(pi*F/(2*h))+1.7726));
ae=a.*sqrt(1+2*h./(pi*er*a).*(log(pi*a/(2*h))+1.7726));
plot(freq,a,'-r',freq,ae,'-g')
  2 Comments
m m
m m on 20 Oct 2012
thanx dear for your support. Thanx very much.
m m
m m on 20 Oct 2012
DEar can you checked this code below becuase I have some problem in it
clc
%input Parameter%
fr=.8*10^9:.1*10^9:2*10^9;
er=4.3;
fprintf('\nfr=%f\t',fr);
fprintf('er=%f\t',er);
h=0.16;
lt=.025;
%raduis%
F=(8.791*10^9)./(fr*sqrt(er));
a=F./sqrt(1+2*h./(pi*er*F).*(log(pi*F/(2*h))+1.7726));
fprintf('a=%2.4f\t',a);
%effective raduis%
ae=a.*sqrt(1+2*h./(pi*er*a).*(log(pi*a/(2*h))+1.7726));
fprintf('ae=%2.4f\t',ae);
lambda_o=(30.0*10^9)./fr;
ko=2*pi./lambda_o;
t=0.0:0.001:pi/2;
x=ko*ae*sin(t);
j0=besselj(0,x);
j2=besselj(2,x);
j02p=j0-j2;
j02=j0+j2;
grad=(ko*ae)^2/480*sum((j02p.^2+(cos(t)).^2.*j02.^2).*sin(t).*0.001);
fprintf('grad=%4.4f\t',grad);
emo=1;
m=1;
mu0=4*pi*10^-9;
k=ko*sqrt(er);
con=5.7*10^5;
gc=emo*pi*(pi*mu0*fr)^(-3/2)*((k*ae)^2-m^2)/(4*(h)^2*sqrt(con));
fprintf('gc=%4.4f\t',gc);
gd=emo*lt*((k*ae)^2-m^2)/(4*mu0*h*fr);
fprintf('gd=%4.4f\t',gd);
gt=grad+gc+gd;
fprintf('gt=%4.4f\t',gt);
Rin0=gt^-1;
fprintf('Rin0=%4.4f\t',Rin0);
Do=(ko*ae)^2/(120*grad);
fprintf('Do=%4.4f\t',Do);
temp1=Zin/Rin0*besselj(1,k*ae)^2;
maxrho=ae;
minrho=0;
tempk=1;
while tempk>0.00001
nk=0;
rhox=linspace(minrho,maxrho,100);
temp=besselj(1,k.*rhox).^2;
for kk=1:99
if temp(kk)-temp1<=0
if temp(kk+1)-temp1>0
nk=nk+1;
minrho=rhox(kk);
maxrho=rhox(kk+1);
end
else
if temp(kk+1)-temp1<=0
nk=nk+1;
maxrho=rhox(kk);
minrho=rhox(kk+1);
end
end
end
if nk>1
display('*****Warning, there are more than one solutions for RHOo and this program only provides you one exact solution!*****/n');
end
[tempk,kk]=min(abs(temp-temp1));
RHOo=rhox(kk);
end
j1po=besselj(1,k*RHOo);
j1ae=besselj(1,k*ae);
Rinp=Rin0*(j1po^2/j1ae^2);
fprintf('Rinp=%4.4f\t',Rinp);
Qc=h*sqrt(pi*fr*mu0*con);
fprintf('Qc=%4.4f\t',Qc);
Qd=(lt)^-1;
fprintf('Qd=%4.4f\t',Qd);
K=a/2;
w=2*pi*fr;
Qrad0=(2*w*er*K)/(h*gt*(2*a)^-1);
fprintf('Qrad0=%4.4f\t',Qrad0);
Qrad1=((k*ae)^2-1)/(4*h*fr*grad);
fprintf('Qrad1=%4.8f\t',Qrad1);
Qt0=((Qc)^-1+(Qd)^-1+(Qrad0)^-1)^-1;
fprintf('Qt0=%4.8f\t',Qt0);
Qt1=((Qc)^-1+(Qd)^-1+(Qrad1)^-1)^-1;
fprintf('Qt1=%4.8f\t',Qt1);
eff0=Qt0/Qrad0;
fprintf('eff0=%4.8f\t',eff0);
eff1=Qt1/Qrad1;
fprintf('eff1=%4.8f\t',eff1);
plot(fr,eff0,fr,eff1)
xlabel('frequency');
ylabel('effecincy');
legend('eff0',2);
legend('eff1',2);
fprintf('\n');

Sign in to comment.

More Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!