matlab程序中显示如下错误,不知道怎么修改;Error, integer too large in context 10
错误如下:???Errorusing==>sym/mapleError,integertoolargeincontextErrorin==>F:\toolbox\symb...
错误如下:??? Error using ==> sym/maple
Error, integer too large in context
Error in ==> F:\toolbox\symbolic\@sym\mtimes.m
On line 13 ==> X = maple(A,'*',B);
下面为我的程序:
clear;
clc;
tic;
figure;
syms beta lambda k0 n1 n2 n3 a1 a2 c neff u u1 v v1 m;
lambda=1.55;
k0=2*pi/lambda;
n1=1.467;
n2=1.46;
%n3=1.33;
a1=4.5;
aa=[62.5,10,9,8,7,6,5.5,5,4.5];
nn=[1,1.1,1.2,1.3,1.35,1.38,1.4,1.415,1.43,1.44,1.45,1.455,1.459999];
la=length(aa);
ln=length(nn);
for i=1:la
a2=aa(i);
for j=1:ln
n3=nn(j);
c=a1/a2;
beta=neff*k0;
u=a1*sqrt(k0^2*n1^2-beta^2);
u1=a2*sqrt(k0^2*n2^2-beta^2);
v=a2*sqrt(beta^2-k0^2*n3^2);
v1=a2*sqrt(beta^2-k0^2*n2^2);
m=0;
%当beta<k0*n2时,equl:h11*h12/(h14*h15)=h13*h16;
%当beta>k0*n2时,equ2:h21*h22/(h24*h25)=h23*h26;
h11=besselj(m,u)/(u*besselj(m+1,u))-bessely(m,u1*c)/((u1*c)*bessely(m+1,u1*c));
h12=besselk(m,v)/(v*besselk(m+1,v))-besselj(m,u1)/(u1*besselj(m+1,u1));
h13=besselj(m+1,u1*c)*bessely(m+1,u1);
h14=besselj(m,u)/(u*besselj(m+1,u))-besselj(m,u1*c)/((u1*c)*besselj(m+1,u1*c));;
h15=besselk(m,v)/(v*besselk(m+1,v))-bessely(m,u1)/(u1*bessely(m+1,u1));
h16=besselj(m+1,u1)*bessely(m+1,u1*c);
h21=besselj(m,u)/(u*besselj(m+1,u))-besselk(m,v1*c)/((v1*c)*besselk(m+1,v1*c));
h22=besselk(m,v)/(v*besselk(m+1,v))+besseli(m,v1)/(v1*besseli(m+1,v1));
h23=besseli(m+1,v1*c)*besselk(m+1,v1);
h24=besselj(m,u)/(u*besselj(m+1,u))+besseli(m,v1*c)/((v1*c)*besseli(m+1,v1*c));
h25=besselk(m,v)/(v*besselk(m+1,v))-besselk(m,v1)/(v1*besselk(m+1,v1));
h26=besseli(m+1,v1)*besselk(m+1,v1*c);
sol=solve(h21*h22/(h24*h25)-h23/h26,neff)
%解贝塞尔函数
deltanef(i,j)=-sol;
if i>1
deltanef(i,j)=deltanef(i,j)-deltanef(1,j)
deltalambda(i,j)=1058.704*deltanef(i,j)
%光栅周期为0.529352,1.058704是2倍的光栅周期,单位改为纳米
%算出有效折射率变化带来的波长变化
end
end
end
deltanef
deltalambda
plot(nn,zeros(1,13),'m')
hold on;
plot(nn,deltalambda(2,:),':b')
plot(nn,deltalambda(3,:),'-.g')
plot(nn,deltalambda(4,:),'--r')
plot(nn,deltalambda(5,:),':c')
plot(nn,deltalambda(6,:),'-.m')
plot(nn,deltalambda(7,:),'--k')
plot(nn,deltalambda(8,:),':g')
plot(nn,deltalambda(9,:),'-.b')
legend('a2=62.5','a2=10','a2=9','a2=8','a2=7','a2=6','a2=5.5','a2=5','a2=4.5')
title('n与\Delta\lambda的关系')
xlabel('环境折射率n');
ylabel('谐振波长变化\Delta\lambda(纳米)')
toc; 展开
Error, integer too large in context
Error in ==> F:\toolbox\symbolic\@sym\mtimes.m
On line 13 ==> X = maple(A,'*',B);
下面为我的程序:
clear;
clc;
tic;
figure;
syms beta lambda k0 n1 n2 n3 a1 a2 c neff u u1 v v1 m;
lambda=1.55;
k0=2*pi/lambda;
n1=1.467;
n2=1.46;
%n3=1.33;
a1=4.5;
aa=[62.5,10,9,8,7,6,5.5,5,4.5];
nn=[1,1.1,1.2,1.3,1.35,1.38,1.4,1.415,1.43,1.44,1.45,1.455,1.459999];
la=length(aa);
ln=length(nn);
for i=1:la
a2=aa(i);
for j=1:ln
n3=nn(j);
c=a1/a2;
beta=neff*k0;
u=a1*sqrt(k0^2*n1^2-beta^2);
u1=a2*sqrt(k0^2*n2^2-beta^2);
v=a2*sqrt(beta^2-k0^2*n3^2);
v1=a2*sqrt(beta^2-k0^2*n2^2);
m=0;
%当beta<k0*n2时,equl:h11*h12/(h14*h15)=h13*h16;
%当beta>k0*n2时,equ2:h21*h22/(h24*h25)=h23*h26;
h11=besselj(m,u)/(u*besselj(m+1,u))-bessely(m,u1*c)/((u1*c)*bessely(m+1,u1*c));
h12=besselk(m,v)/(v*besselk(m+1,v))-besselj(m,u1)/(u1*besselj(m+1,u1));
h13=besselj(m+1,u1*c)*bessely(m+1,u1);
h14=besselj(m,u)/(u*besselj(m+1,u))-besselj(m,u1*c)/((u1*c)*besselj(m+1,u1*c));;
h15=besselk(m,v)/(v*besselk(m+1,v))-bessely(m,u1)/(u1*bessely(m+1,u1));
h16=besselj(m+1,u1)*bessely(m+1,u1*c);
h21=besselj(m,u)/(u*besselj(m+1,u))-besselk(m,v1*c)/((v1*c)*besselk(m+1,v1*c));
h22=besselk(m,v)/(v*besselk(m+1,v))+besseli(m,v1)/(v1*besseli(m+1,v1));
h23=besseli(m+1,v1*c)*besselk(m+1,v1);
h24=besselj(m,u)/(u*besselj(m+1,u))+besseli(m,v1*c)/((v1*c)*besseli(m+1,v1*c));
h25=besselk(m,v)/(v*besselk(m+1,v))-besselk(m,v1)/(v1*besselk(m+1,v1));
h26=besseli(m+1,v1)*besselk(m+1,v1*c);
sol=solve(h21*h22/(h24*h25)-h23/h26,neff)
%解贝塞尔函数
deltanef(i,j)=-sol;
if i>1
deltanef(i,j)=deltanef(i,j)-deltanef(1,j)
deltalambda(i,j)=1058.704*deltanef(i,j)
%光栅周期为0.529352,1.058704是2倍的光栅周期,单位改为纳米
%算出有效折射率变化带来的波长变化
end
end
end
deltanef
deltalambda
plot(nn,zeros(1,13),'m')
hold on;
plot(nn,deltalambda(2,:),':b')
plot(nn,deltalambda(3,:),'-.g')
plot(nn,deltalambda(4,:),'--r')
plot(nn,deltalambda(5,:),':c')
plot(nn,deltalambda(6,:),'-.m')
plot(nn,deltalambda(7,:),'--k')
plot(nn,deltalambda(8,:),':g')
plot(nn,deltalambda(9,:),'-.b')
legend('a2=62.5','a2=10','a2=9','a2=8','a2=7','a2=6','a2=5.5','a2=5','a2=4.5')
title('n与\Delta\lambda的关系')
xlabel('环境折射率n');
ylabel('谐振波长变化\Delta\lambda(纳米)')
toc; 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询