AdvancedTraining版权所有,请勿外传FDTDSolutions©2009LumericalSolutions,Inc.OutlineIntroductionAdvancedFeatures:Scriptinglanguage:Structuregroupsandanalysisgroups:Farfieldanalysiswithscripting:Advancedboundaryconditions:Dispersiveandanisotropicmaterials:InteroperabilitywithASAPanduser-definedsources:CoherenceandpolarizationinFDTDParallelComputationCMOSImageSensordetailedapplicationexample:ReviewtheprinciplesofCMOSImageSensorModelingwithFDTD•Modelingmethodsthatcanbeused•CoherenceandpolarizationWorkshopexamplesandPracticeGoalsLearntheadvancedfeaturesofFDTDSolutions::::::::ScriptingParameterizationofstructuresanddefiningfiguresofmerit(FOM)FarfieldanalysisSymmetric/Anti-SymmetricandBlochboundariesDispersivematerialsInteroperabilitywithASAPDrawcomplexstructureswithscriptingUnderstandhowtoobtainincoherent,unpolarizedresultswithFDTDUnderstandthecapabilitiesofparallelFDTDSolutionsLearnhowtosetupaparallelsimulationStudyaCMOSimagesensordesign©2009LumericalSolutions,Inc.©2009LumericalSolutions,Inc.ScriptingTOPICSThescriptwindowMathematicsInteractingwiththeLayoutEditorAnalyzingsimulationdataScriptfilesandexample©2009LumericalSolutions,Inc.Scripting:EditorandpromptRightclickonmenubar(oruseViewmenu)ScriptfileeditorScriptprompt©2009LumericalSolutions,Inc.Scripting:MathematicsSimpleMathematics:plotsomesimplefunctionsx=linspace(-10,10,500);y=sin(x);plot(x,y,”x”,”y”,”sin(x)”);y=exp(-x^2/9)*sin(10*x);plot(x,y,”x”,”y”,”exp(-x^2/9)*sin(10*x)”);?size(x);©2009LumericalSolutions,Inc.Scripting:MathematicsSimpleMathematics(plota2Dgaussian)x=linspace(-10,10,500);y=linspace(-10,10,500);X=meshgridx(x,y);Y=meshgridy(x,y);?size(x);?size(X);E=exp(-X^2/9–Y^2/4);image(x,y,E,”x”,”y”,”test2Dimage”);x1,ymx2,ymx3ym…xn,ym……………x1,y3x2,y3x3y3…xn,y3x1,y2x2,y2x3y2…xn,y2x1,y1x2,y1x3,y1…xn,y1ymymym…ym……………y3y3y3…y3y2y2y2…y2y1y1y1…y1x1x2x3…xnx1x2x3…xnx1x2x3…xn……………x1x2x3…xnxhaslengthnXhassizenbym©2009LumericalSolutions,Inc.Scripting:MathematicsY=meshgridy(x,y);yhaslengthmYhassizenbymyxyxX=meshgridx(x,y);E=exp(-X^2/9–Y^2/4);Ehassizenbymyx©2009LumericalSolutions,Inc.Scripting:InteractingwiththeLayoutEditorSomeusefulcommandstosetandgetobjectpropertiessetnamed:setnamed(“Source1”,”x”,1e-6);getnamed:x=getnamed(“Source1”,”x”);22Scripting:AnalyzingsimulationdataSomeusefuldatamanipulationcommandsgetdata:retrievesdatafromanymonitorafterthesimulation:Bydefaultitautomaticallyunfoldsdatawiththecorrectsymmetrieswhensymmetric/anti-symmetricboundariesareusedshowdata:Showswhatmonitorsarecurrentlyavailablewithdatashowdata(“monitorname”);:Showstheavailabledatainthemonitor/sourcecalled“monitorname”:Eg:?showdata(source1)showsvariablesin“source1”settingstransmission:calculatesnormalizedtransmissiongetelectric(andgetmagnetic):retrieves:Bydefaultitautomaticallyunfoldsdatawiththecorrectsymmetries©2009LumericalSolutions,Inc.|E|or|H|Scripting:AnalyzingsimulationdataMostelectromagneticfielddatafromthesimulationsisa3or4dimensionalmatrixExampleEx=getdata(“Monitor1”,”Ex”);Ex(i,j,k,m):::::irepresentsthexdimensionjrepresentstheydimensionkrepresentsthezdimension(3Donly)mrepresentsfrequencyortimeThisisafieldquantity,notintensity©2009LumericalSolutions,Inc.©2009LumericalSolutions,Inc.Scripting:AnalyzingsimulationdataThepinchfunction:E=matrix(12,4,1,6);?size(E);?size(pinch(E));#removedimension3?size(pinch(E,2,3));#2nddimension,3rdelementpinchremovesallsingletondimensionspinchwith2arguments,selectsasub-matrix©2009LumericalSolutions,Inc.Scripting:AnalyzingsimulationdataAccessingandmanipulatingmatrixelementsx=1:5;?x;x(2:3)=5:6;?x;©2009LumericalSolutions,Inc.Scripting:ScriptfilesandexampleCopythefilescripting1.fspandscripting1.lsftoyourmachineOpenscripting1.fspandeditscripting1.lsfWe’llcalculatetransmissionandreflectionasafunctionoftheradiusofadielectricrod©2009LumericalSolutions,Inc.Scripting:Scriptfilesandexample##########################################file:scripting1.lsf#Thisfileshowshowtorunmultiplesimulationsusingscripting.#Youshouldopenscripting1.fspbeforerunningthisscript##########################################define10rodradiitouserad=linspace(0.5e-6,3e-6,10);#reserve3matrices,1forTransmission,1forreflection#oneforpoweratsidesT=matrix(length(rad));R=matrix(length(rad));side_power=matrix(length(rad));©2009LumericalSolutions,Inc.Scripting:Scriptfilesandexample#startaloopovereachdesiredradiusfor(i=1:length(rad)){#switchtolayoutmodesothatyoucanedittheobjectsswitchtolayout;#switchtothestructurestabtoeditthescatteringrodstructures;#settheradiusoftheobjectnamedrodtothedesiredvaluesetnamed(rod,radius,rad(i));#outputwhichsimulationisrunning?runningsimulation+num2str(i)+of+num2str(length(rad));#runthesimulationrun;#gettransmissionandreflectionT(i)=transmission(transmission);R(i)=abs(transmission(reflection));side_power(i)=transmission(y2)-transmission(y1);#getthefrequencyatwhichthedatawasrecordedf=getdata(transmission,“f“);#thequotescannotbeuseddirectlyinscript.changeitafterpaste!}#endofthemainloopovertheradius©2009LumericalSolutions,Inc.Scrip