400nm_700nm.zip

  • koarlin
    了解作者
  • matlab
    开发工具
  • 1KB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • 1 积分
    下载积分
  • 2
    下载次数
  • 2020-12-07 18:52
    上传日期
自己随便写的多层光材料,可以绘制出反射与投射
400nm_700nm.zip
  • 400nm_700nm.m
    4.3KB
内容介绍
d1 = 0.36e-7; d2 = 0.18e-7;%光子晶体厚度 n1 = 1; n2 = 8;%光子晶体折射率 theta0 = linspace(0,70,701); lambda = 1e-9*(100:0.1:1000); frequency = 3e8./lambda; ms = zeros(length(lambda),length(theta0)); mp = ms; %s偏振 figure for number1 = 1:length(theta0) theta = theta0(number1); theta1 = pi/2*theta/90; theta2 = asin(n1/n2*sin(theta1)); M = eye(2); t = zeros(1,length(lambda)); r = ones(1,length(lambda)); for i = 1:1:length(lambda) k = 2*pi./lambda; k1 = k*n1; k2 = k*n2; m12 = (n1*cos(theta1)-n2*cos(theta2))/(n1*cos(theta1)+n2*cos(theta2)); m21 = m12; m1 = [exp(1j*k1(i)*d1/cos(theta1)),0;0,exp(-1j*k1(i)*d1/cos(theta1))]; m2 = [exp(1j*k2(i)*d2/cos(theta2)),0;0,exp(-1j*k2(i)*d2/cos(theta2))]; t12 = 2*n1*cos(theta1)/(n1*cos(theta1)+n2*cos(theta2)); t21 = 2*n2*cos(theta2)/(n1*cos(theta1)+n2*cos(theta2)); M1 = [1,m12;m21,1]/t12; M2 = [1,-m12;-m21,1]/t21; M0 = (M*m1*M1*m2*M2); M = M0^5; t(i) = det(M)/M(2,2); r(i) = -M(2,1)/M(2,2); ms(i,number1) = abs(M0(1,1)+M0(2,2))<=2; M = eye(2); end pause(0.01); subplot(2,1,1) plot(frequency,abs(r).^2,'r',frequency,1-abs(r).^2,'b',3e8/4e-7*ones(1,10),linspace(-0.05,1.05,10),'k-.',3e8/7e-7*ones(1,10),linspace(-0.05,1.05,10),'k-.','linewidth',2); set(gca,'xlim',[min(frequency),max(frequency)],'ylim',[-0.05,1.05]); str = ['theta=',num2str(theta),' s偏振']; xlabel('\nu (1/s)','fontname','times new roman'); legend('reflection','transmission'); title(str,'fontsize',14); subplot(2,1,2) h1 = plot(lambda,abs(r).^2,'r',lambda,1-abs(r).^2,'b',4e-7*ones(1,10),linspace(-0.05,1.05,10),'k-.',7e-7*ones(1,10),linspace(-0.05,1.05,10),'k-.','linewidth',2); set(gca,'xlim',[min(lambda),max(lambda)],'ylim',[-0.05,1.05]); xlabel('\lambda (nm)','fontname','times new roman') legend('reflection','transmission'); title(str,'fontsize',14); end %p偏振 figure for number2 = 1:length(theta0) theta = theta0(number2); theta1 = pi/2*theta/90; theta2 = asin(n1/n2*sin(theta1)); M = eye(2); t = zeros(1,length(lambda)); r = ones(1,length(lambda)); for i = 1:1:length(lambda) k = 2*pi./lambda; k1 = k*n1; k2 = k*n2; m12 = (n2*cos(theta1)-n1*cos(theta2))/(n1*cos(theta2)+n2*cos(theta1)); m21 = m12; m1 = [exp(1j*k1(i)*d1/cos(theta1)),0;0,exp(-1j*k1(i)*d1/cos(theta1))]; m2 = [exp(1j*k2(i)*d2/cos(theta2)),0;0,exp(-1j*k2(i)*d2/cos(theta2))]; t12 = 2*n1*cos(theta1)/(n1*cos(theta2)+n2*cos(theta1)); t21 = 2*n2*cos(theta2)/(n1*cos(theta2)+n2*cos(theta1)); M1 = [1,m12;m21,1]/t12; M2 = [1,-m12;-m21,1]/t21; M0 = (M*m1*M1*m2*M2); M = M0^5; t(i) = det(M)/M(2,2); r(i) = -M(2,1)/M(2,2); mp(i,number2) = abs(M0(1,1)+M0(2,2))<=2; M = eye(2); end pause(0.01); subplot(2,1,1) plot(frequency,abs(r).^2,'r',frequency,1-abs(r).^2,'b',3e8/4e-7*ones(1,10),linspace(-0.05,1.05,10),'k-.',3e8/7e-7*ones(1,10),linspace(-0.05,1.05,10),'k-.','linewidth',2); set(gca,'xlim',[min(frequency),max(frequency)],'ylim',[-0.05,1.05]); xlabel('\nu (1/s)','fontname','times new roman'); legend('reflection','transmission'); str = ['theta=',num2str(theta),' p偏振']; title(str,'fontsize',14); subplot(2,1,2) plot(lambda,abs(r).^2,'r',lambda,1-abs(r).^2,'b',4e-7*ones(1,10),linspace(-0.05,1.05,10),'k-.',7e-7*ones(1,10),linspace(-0.05,1.05,10),'k-.','linewidth',2); set(gca,'xlim',[min(lambda),max(lambda)],'ylim',[-0.05,1.05]); xlabel('\lambda (nm)','fontname','times new roman'); legend('reflection','transmission'); str = ['theta=',num2str(theta),' p偏振']; title(str,'fontsize',14); end %能带图 figure theta1 = pi/2*theta0/90; [beta,w] = meshgrid(sin(theta1),1./lambda*(d1+d2)); hold on pcolor(beta,w,ms); shading interp plot(sin(theta1),1/4e-7*(d1+d2)*ones(size(theta1)),'-.k',sin(theta1),1/7e-7*(d1+d2)*ones(size(theta1)),'-.k','linewidth',2); set(gca,'xlim',[min(sin(theta1)),max(sin(theta1))],'ylim',[min(1./lambda*(d1+d2)),max(1./lambda*(d1+d2))]); colormap([1 1 1; 1 0 0 ]) xlabel('\beta(2\pi/\Lambda)'); ylabel('\omega(2\pic/\Lambda)'); box on figure pcolor(beta,w,mp); hold on plot(sin(theta1),1/4e-7*(d1+d2)*ones(size(theta1)),'-.k',sin(theta1),1/7e-7*(d1+d2)*ones(size(theta1)),'-.k','linewidth',2); colormap([1 1 1; 1 0 0 ]) xlabel('\beta(2\pi/\Lambda)'); ylabel('\omega(2\pic/\Lambda)'); shading interp box on
评论
    相关推荐
    • matlab实现
      matlab实现 matlab实现matlab实现matlab实现matlab实现
    • matlab 教程
      matlab 信号处理资料,里面包含信号处理pdf文档,一些杂乱的程序和命令等
    • matlab 课件
      matlab 功能很强大,本课件详细的介绍了matlab在科学计算中的应用。
    • MATLAB教程
      MATLAB教程MATLAB教程MATLAB教程MATLAB教程MATLAB教程MATLAB教程
    • MATLAB 论文
      基于MATLAB的论文撰写!可以为你指明一条写作MATLAB论文的道路!
    • Matlab教程
      Matlab讲义教程第一章节资源共享。用于学习Matlab的应用。
    • matlab教程
      matlab教程,PPT格式,包含 matlab基本知识、matlab入门、matlab作图、线性规划、无约束优化、非线性规划、统计工具箱、差值、微分方程等多项知识点,并且每个知识点独立成为PPT,内还含有matlab信号处理详解等文档...
    • MATLAB
      MATLAB 该项目是在matlab上完成的,涉及创建和移动宇宙飞船和机器人。 太空飞船和机器人是使用Matlab中的简单几何形状创建的,并通过连续变换矩阵进行移动。 这个项目教我如何使用变换矩阵(旋转,平移等)的概念...
    • Matlab合集
      冈萨雷斯数字图像处理MATLAB版.中文版+数字图像处理第二版中文版(冈萨雷斯)+MATLAB-R2014a完全自学一本通+MATLAB R2016a完全自学一本通 素材文件+[模式识别与智能计算:MATLAB技术实现(第2版)].杨淑莹.扫描版
    • matlab简介
      1.MATLAB 开发环境 1.1 MATLAB 的视窗环境 进入MATLAB之后,会看到一个视窗MATLAB Command Window称为指令视窗,它是你键入指令的地方同时 MATLAB也将计算结果显示在此。 1.2 简易计算 我们先从MATLAB的...