use of arrays in variable

조회 수: 1 (최근 30일)
shiv gaur
shiv gaur 2022년 1월 7일
댓글: shiv gaur 2022년 1월 7일
function y=f(kx)
l=6330*(10)^(-10);
k0=2*pi/l;
nc=1.33;
ec=nc^2;
na=1.43;
ea=na^2;
nf=1.59;
ef=nf^2;
nm=0.064+1i*4;
em=nm^2;
ns=1.495;
es=ns^2;
df=0.5e-6;
dm=0.03e-6;
%da=0.06e-6;
%kx=(2*pi/l)*np*sin(a);
kc=k0*sqrt(x^2-ec);
ka=k0*sqrt(ea-x^2);
kf=k0*sqrt(ef-x^2);
km=k0*sqrt(em-x^2);
ks=k0*sqrt(x^2-es);
rfm=(kf-km)/(kf+km);
rms=(km-ks)/(ks+km);
rfa=(kf-ka)/(kf+ka);
rac=(ka-kc)/(ka+kc);
a=(1-rfm)/(1+rfm);
b=(1-rms*exp(2*1i*dm*km))/(1+rms*exp(2*1i*dm*km));
c=(1-rfa)/(1+rfa);
f=(1-rac*exp(2*1i*da*ka))/(1+rac*exp(2*1i*da*ka));
pfms=2*atan(1i*a*b);
pfac=2*atan(1i*c*f);
y=2*kf*df-pfms-pfac;
end
this is the simple function program we have to calculate the value of df/ddna ie chane in f/change in na vs da
how to use this program
  댓글 수: 3
shiv gaur
shiv gaur 2022년 1월 7일
modified program
function y=f(x)
l=6330*(10)^(-10);
k0=2*pi/l;
nc=1.33;
ec=nc^2;
na=1.43;
ea=na^2;
nf=1.59;
ef=nf^2;
nm=0.064+1i*4;
em=nm^2;
ns=1.495;
es=ns^2;
df=0.5e-6;
dm=0.03e-6;
%da=0.06e-6;
%kx=(2*pi/l)*np*sin(a);
kc=k0*sqrt(x^2-ec);
ka=k0*sqrt(ea-x^2);
kf=k0*sqrt(ef-x^2);
km=k0*sqrt(em-x^2);
ks=k0*sqrt(x^2-es);
rfm=(kf-km)/(kf+km);
rms=(km-ks)/(ks+km);
rfa=(kf-ka)/(kf+ka);
rac=(ka-kc)/(ka+kc);
a=(1-rfm)/(1+rfm);
b=(1-rms*exp(2*1i*dm*km))/(1+rms*exp(2*1i*dm*km));
c=(1-rfa)/(1+rfa);
f=(1-rac*exp(2*1i*da*ka))/(1+rac*exp(2*1i*da*ka));
pfms=2*atan(1i*a*b);
pfac=2*atan(1i*c*f);
y=2*kf*df-pfms-pfac;
end
shiv gaur
shiv gaur 2022년 1월 7일
pl solve this problem if any one not interested leave it others to solve the problem this is high class problem
by changing two variable df/dna ie change in x/change in na at different value of da
fig is attatch

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 BPSK에 대해 자세히 알아보기

태그

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by