Vous êtes sur la page 1sur 409

FDTD S olu tion s

Reference Guide

Release 8.0

Contents

Table of Contents
Part I New Features
1 2 3 4 5 New New New New New

12
13 15 16 18 20

features ............................................................................................................ for version 8.0 features ............................................................................................................ for version 7.5 features ............................................................................................................ for version 7.0 features ............................................................................................................ for version 6.5 features ............................................................................................................ for version 6.0

Part II Solver physics

23

1 FDTD ............................................................................................................ 23
FDTD ................................................................................................................................................. and Maxw ell's equations 24 Meshing ................................................................................................................................................. in FDTD 26

2 Eigenmode ............................................................................................................ Solver 26


Meshing ................................................................................................................................................. in the Eigenm ode solver 27

3 Propagator ............................................................................................................ 28
Variational ................................................................................................................................................. FDTD 28 Eigenm ................................................................................................................................................. ode expansion 30 Meshing ................................................................................................................................................. in the propagator 30

4 INTERCONNECT ............................................................................................................ 31
Tim................................................................................................................................................. e Dom ain Sim ulator 31 Frequency ................................................................................................................................................. Dom ain Sim ulator 32

5 DEVICE ............................................................................................................ 32
System ................................................................................................................................................. of Equations 33 Meshing ................................................................................................................................................. in DEVICE 35

Part III Units and normalization

37

1 Time domain ............................................................................................................ solvers 37


Frequency ................................................................................................................................................. dom ain norm alization 39 Spectral ................................................................................................................................................. averaging 41 Source ................................................................................................................................................. am plitudes 48

2 Frequency ............................................................................................................ domain solvers 48 3 Calculating ............................................................................................................ and normalizing power in the frequency domain 48 4 Integrating ............................................................................................................ over lines, surfaces and volumes 49

Part IV CAD layout editor

51

1 Main title ............................................................................................................ bar 52 2 Toolbars ............................................................................................................ 52


Main ................................................................................................................................................. 52 Edit ................................................................................................................................................. 54 Mouse ................................................................................................................................................. m ode 55 View ................................................................................................................................................. 57 Sim................................................................................................................................................. ulation 58 2003 - 2012 Lumerical Solutions, Inc

Reference Guide
Alignm ................................................................................................................................................. ent 59 Search ................................................................................................................................................. bar 59

3 View ports ............................................................................................................ 60 4 Object............................................................................................................ Tree 60


Enable/Disable ................................................................................................................................................. Sim ulation Object 61

5 6 7 8 9 10 11

Object............................................................................................................ Library Results ............................................................................................................ View Optimization ............................................................................................................ and Sweeps Script ............................................................................................................ Prompt and Script Editor Script ............................................................................................................ Workspace and Script Favorites Changing ............................................................................................................ the CAD layout Converting ............................................................................................................ from 2D to 3D

62 62 63 63 63 64 65

Part V Simulation objects

68

1 Structures ............................................................................................................ 70
Prim ................................................................................................................................................. itives 71 Attributes ................................................................................................................................................. 72 Com ................................................................................................................................................. ponents 73 Geom ................................................................................................................................................. etry tab 74 Material ................................................................................................................................................. tab 74 Rotations ................................................................................................................................................. tab 74 Graphical ................................................................................................................................................. Rendering tab 74 Custom ................................................................................................................................................. tab 75 Im port ................................................................................................................................................. Data tab 76 Surface ................................................................................................................................................. tab 80 Properties ................................................................................................................................................. tab 82 Script ................................................................................................................................................. tab 82

2 Simulation ............................................................................................................ 83
General ................................................................................................................................................. tab 83 Geom ................................................................................................................................................. etry tab 84 Mesh ................................................................................................................................................. settings tab 84 Boundary ................................................................................................................................................. conditions tab 86 Advanced ................................................................................................................................................. options tab 89

3 Sources ............................................................................................................ 91
General ................................................................................................................................................. tab 93 Geom ................................................................................................................................................. etry tab 95 Frequency/Wavelength ................................................................................................................................................. tab 95 Beam ................................................................................................................................................. options tab 97 Advanced ................................................................................................................................................. tab 99 Integrated ................................................................................................................................................. m ode source 100

4 Monitors ............................................................................................................ 104


Frequency ................................................................................................................................................. Pow er/Profile tab 106 Frequency ................................................................................................................................................. Pow er/Profile Advanced tab 106 General ................................................................................................................................................. tab 107 Data ................................................................................................................................................. to record tab 108 Geom ................................................................................................................................................. etry tab 108 2003 - 2012 Lumerical Solutions, Inc

Contents

Spectral ................................................................................................................................................. averaging and apodization tab 108 Advanced ................................................................................................................................................. tab 109 Setup ................................................................................................................................................. tab 110 Analysis ................................................................................................................................................. tab 110 Mode ................................................................................................................................................. expansion tab 112

5 Equation ............................................................................................................ interpreter 114

Part VI Material database

116

1 Material ............................................................................................................ database 116 2 Permittivity ............................................................................................................ models 117


Anisotropic ................................................................................................................................................. m aterials 121

3 User-defined ............................................................................................................ models 122 4 Material ............................................................................................................ explorer 125 5 Mesh............................................................................................................ order 127

Part VII Running simulations and analysis

129

1 Resource ............................................................................................................ Manager 129


Resources ................................................................................................................................................. Advanced Options 131

2 Running ............................................................................................................ a simulation 132 3 Analysis ............................................................................................................ tools 133


Analysis ................................................................................................................................................. tools and the sim ulation environm ent 134 Analysis ................................................................................................................................................. groups 134 Figure ................................................................................................................................................. w indow s for plots and im ages 136 Data ................................................................................................................................................. export 138 Visualizer ................................................................................................................................................. 139 Results ................................................................................................................................................. Manager 142

4 Optimization ............................................................................................................ and parameter sweeps 146


Optim ................................................................................................................................................. ization 148 Particle ................................................................................................................................................. Sw arm Optim ization 150 Param ................................................................................................................................................. eter Sw eeps 152 Nested ................................................................................................................................................. Sw eeps 153

Part VIII Scripting Language

155

1 System ............................................................................................................ 156


new ................................................................................................................................................. project 158 new ................................................................................................................................................. 2d 159 new ................................................................................................................................................. 3d 159 new ................................................................................................................................................. m ode 160 save ................................................................................................................................................. 161 load ................................................................................................................................................. 161 del ................................................................................................................................................. 162 rm................................................................................................................................................. 162 dir................................................................................................................................................. 162 ls ................................................................................................................................................. 163 cd ................................................................................................................................................. 163 pw................................................................................................................................................. d 164

2003 - 2012 Lumerical Solutions, Inc

Reference Guide
cp ................................................................................................................................................. 164 mv ................................................................................................................................................. 165 exit ................................................................................................................................................. 165 system ................................................................................................................................................. 166 fileexists ................................................................................................................................................. 166 currentfilenam ................................................................................................................................................. e 167 filebasenam ................................................................................................................................................. e 167 fileextension ................................................................................................................................................. 168 filedirectory ................................................................................................................................................. 168 getcom ................................................................................................................................................. m ands 169 Run ................................................................................................................................................. script 169 getpath ................................................................................................................................................. 170 addpath ................................................................................................................................................. 170 w hich ................................................................................................................................................. 171 pause ................................................................................................................................................. 171 break ................................................................................................................................................. 172 Excape ................................................................................................................................................. key 172 form ................................................................................................................................................. at 173 loaddata ................................................................................................................................................. 173 savedata ................................................................................................................................................. 174 savedcard ................................................................................................................................................. 174 readdata ................................................................................................................................................. 175 w rite ................................................................................................................................................. 175 asapexport ................................................................................................................................................. 176 asapload ................................................................................................................................................. 176 asapim ................................................................................................................................................. port 177 gdsim ................................................................................................................................................. port 178 m atlabsave ................................................................................................................................................. 179 m atlab ................................................................................................................................................. 179 m atlabget ................................................................................................................................................. 181 m atlabput ................................................................................................................................................. 181 debug ................................................................................................................................................. 182

2 Manipulating ............................................................................................................ variables 182


= ................................................................................................................................................. 183 : ................................................................................................................................................. 183 [] ................................................................................................................................................. 184 % ................................................................................................................................................. 184 linspace ................................................................................................................................................. 185 m atrix ................................................................................................................................................. 185 randm ................................................................................................................................................. atrix 186 m eshgridx ................................................................................................................................................. 186 m eshgridy ................................................................................................................................................. 187 m eshgrid3dx ................................................................................................................................................. 187 m eshgrid3dy ................................................................................................................................................. 188 m eshgrid3dz ................................................................................................................................................. 188 m eshgrid4d ................................................................................................................................................. 188 clear ................................................................................................................................................. 189 w orkspace ................................................................................................................................................. 189 Accessing ................................................................................................................................................. and assigning m atrix elem ents 190 Matrix ................................................................................................................................................. operators 191

2003 - 2012 Lumerical Solutions, Inc

Contents

Pre-defined ................................................................................................................................................. constants 191

3 Operators ............................................................................................................ 192


. ................................................................................................................................................. 193 * ................................................................................................................................................. 194 / ................................................................................................................................................. 194 + ................................................................................................................................................. 195 - ................................................................................................................................................. 195 ^ ................................................................................................................................................. 196 == ................................................................................................................................................. 196 alm ................................................................................................................................................. ostequal 196 != ................................................................................................................................................. 197 <= ................................................................................................................................................. 198 >= ................................................................................................................................................. 198 < ................................................................................................................................................. 198 > ................................................................................................................................................. 199 & ................................................................................................................................................. 199 and ................................................................................................................................................. 200 | ................................................................................................................................................. 200 or ................................................................................................................................................. 201 ! ................................................................................................................................................. 201 ~ ................................................................................................................................................. 202 " ................................................................................................................................................. 202 ' ................................................................................................................................................. 203 endl ................................................................................................................................................. 204 ? ................................................................................................................................................. 204 com ................................................................................................................................................. m ents 205

4 Functions ............................................................................................................ 205


sin ................................................................................................................................................. 209 cos ................................................................................................................................................. 209 tan ................................................................................................................................................. 210 asin ................................................................................................................................................. 210 acos ................................................................................................................................................. 211 atan ................................................................................................................................................. 211 atan2 ................................................................................................................................................. 212 real ................................................................................................................................................. 212 im ag ................................................................................................................................................. 212 conj ................................................................................................................................................. 213 abs ................................................................................................................................................. 213 angle ................................................................................................................................................. 214 unw ................................................................................................................................................. rap 214 log ................................................................................................................................................. 215 log10 ................................................................................................................................................. 215 sqrt ................................................................................................................................................. 215 exp ................................................................................................................................................. 216 size ................................................................................................................................................. 216 length ................................................................................................................................................. 217 pinch ................................................................................................................................................. 217 sum ................................................................................................................................................. 218 m ax ................................................................................................................................................. 218 m in ................................................................................................................................................. 219 2003 - 2012 Lumerical Solutions, Inc

Reference Guide
dot ................................................................................................................................................. 219 cross ................................................................................................................................................. 220 eig ................................................................................................................................................. 220 m ult ................................................................................................................................................. 221 flip ................................................................................................................................................. 222 perm ................................................................................................................................................. ute 222 reshape ................................................................................................................................................. 223 inv................................................................................................................................................. 223 interp ................................................................................................................................................. 224 interptri ................................................................................................................................................. 224 spline ................................................................................................................................................. 225 integrate ................................................................................................................................................. 225 integrate2 ................................................................................................................................................. 226 find ................................................................................................................................................. 227 findpeaks ................................................................................................................................................. 228 transpose ................................................................................................................................................. 228 ctranspose ................................................................................................................................................. 229 num ................................................................................................................................................. 2str 229 str2num ................................................................................................................................................. 230 eval ................................................................................................................................................. 230 feval ................................................................................................................................................. 231 substring ................................................................................................................................................. 231 findstring ................................................................................................................................................. 232 replace ................................................................................................................................................. 232 replacestring ................................................................................................................................................. 233 fft ................................................................................................................................................. 233 fftw ................................................................................................................................................. 235 fftk ................................................................................................................................................. 236 invfft ................................................................................................................................................. 237 czt................................................................................................................................................. 238 polyarea ................................................................................................................................................. 239 centroid ................................................................................................................................................. 240 polyintersect ................................................................................................................................................. 240 inpoly ................................................................................................................................................. 241 polygrow ................................................................................................................................................. 241 polyand ................................................................................................................................................. 242 polyor ................................................................................................................................................. 242 polydiff ................................................................................................................................................. 243 polyxor ................................................................................................................................................. 244 lineintersect ................................................................................................................................................. 244 linecross ................................................................................................................................................. 245 ceil ................................................................................................................................................. 246 floor ................................................................................................................................................. 246 m od ................................................................................................................................................. 246 sign ................................................................................................................................................. 247 round ................................................................................................................................................. 247 rand ................................................................................................................................................. 248 randreset ................................................................................................................................................. 248 finite ................................................................................................................................................. 249 solar ................................................................................................................................................. 249 stackrt ................................................................................................................................................. 250 2003 - 2012 Lumerical Solutions, Inc

Contents

5 Loop ............................................................................................................ and conditional statements 251


for................................................................................................................................................. 251 if ................................................................................................................................................. 252

6 Plotting ............................................................................................................ commands 252


plot ................................................................................................................................................. 253 plotxy ................................................................................................................................................. 254 polar ................................................................................................................................................. 255 polar2 ................................................................................................................................................. 256 polarim ................................................................................................................................................. age 257 legend ................................................................................................................................................. 257 im age ................................................................................................................................................. 258 visualize ................................................................................................................................................. 259 selectfigure ................................................................................................................................................. 259 setplot ................................................................................................................................................. 260 exportfigure ................................................................................................................................................. 260 closeall ................................................................................................................................................. 261

7 Adding ............................................................................................................ Objects 261


sw................................................................................................................................................. itchtolayout 264 layoutm ................................................................................................................................................. ode 264 addgroup ................................................................................................................................................. 264 addstructuregroup ................................................................................................................................................. 265 addanalysisgroup ................................................................................................................................................. 265 addobject ................................................................................................................................................. 266 addcircle ................................................................................................................................................. 266 addcustom ................................................................................................................................................. 267 addim ................................................................................................................................................. port 267 addpyram ................................................................................................................................................. id 267 addpoly ................................................................................................................................................. 268 addrect ................................................................................................................................................. 268 addtriangle ................................................................................................................................................. 269 addring ................................................................................................................................................. 269 addsphere ................................................................................................................................................. 270 addsurface ................................................................................................................................................. 270 addfdtd ................................................................................................................................................. 270 addeigenm ................................................................................................................................................. ode 271 addpropagator ................................................................................................................................................. 271 addm ................................................................................................................................................. esh 272 addm ................................................................................................................................................. ode 272 addm ................................................................................................................................................. odesource 273 adddipole ................................................................................................................................................. 273 addgaussian ................................................................................................................................................. 273 addplane ................................................................................................................................................. 274 addtfsf ................................................................................................................................................. 274 addim ................................................................................................................................................. portedsource 275 addindex ................................................................................................................................................. 275 addtim ................................................................................................................................................. e 276 addm ................................................................................................................................................. ovie 276 addprofile ................................................................................................................................................. 276 addpow ................................................................................................................................................. er 277 createbeam ................................................................................................................................................. 277 2003 - 2012 Lumerical Solutions, Inc

Reference Guide
adddevice ................................................................................................................................................. 278 adddope ................................................................................................................................................. 278 adddiffusion ................................................................................................................................................. 279 addim ................................................................................................................................................. portdope 279 addbulkgen ................................................................................................................................................. 280 addim ................................................................................................................................................. portgen 280 addgridattribute ................................................................................................................................................. 280 addelem ................................................................................................................................................. ent 281

8 Manipulating ............................................................................................................ objects 282


groupscope ................................................................................................................................................. 284 deleteall ................................................................................................................................................. 285 delete ................................................................................................................................................. 285 selectall ................................................................................................................................................. 286 unselectall ................................................................................................................................................. 286 select ................................................................................................................................................. 287 selectpartial ................................................................................................................................................. 287 shiftselect ................................................................................................................................................. 288 shiftselectpartial ................................................................................................................................................. 289 m ove ................................................................................................................................................. 289 copy ................................................................................................................................................. 290 addtogroup ................................................................................................................................................. 290 adduserprop ................................................................................................................................................. 291 set ................................................................................................................................................. 292 setnam ................................................................................................................................................. ed 292 setglobalm ................................................................................................................................................. onitor 293 setglobalsource ................................................................................................................................................. 294 get ................................................................................................................................................. 294 runsetup ................................................................................................................................................. 295 getnum ................................................................................................................................................. ber 296 getnam ................................................................................................................................................. ed 296 getnam ................................................................................................................................................. ednum ber 297 getglobalm ................................................................................................................................................. onitor 298 getglobalsource ................................................................................................................................................. 298 getsolver ................................................................................................................................................. 299 haveproperty ................................................................................................................................................. 299 im portsurface ................................................................................................................................................. 300 im portsurface2 ................................................................................................................................................. 301 im portnk ................................................................................................................................................. 302 im portnk2 ................................................................................................................................................. 304 setsourcesignal ................................................................................................................................................. 305 updatesourcem ................................................................................................................................................. ode 306 clearsourcedata ................................................................................................................................................. 307 redraw ................................................................................................................................................. 307 redraw ................................................................................................................................................. off 308 redraw ................................................................................................................................................. on 308 redraw ................................................................................................................................................. m ode 309 setview ................................................................................................................................................. 310 getview ................................................................................................................................................. 311 orbit ................................................................................................................................................. 311 fram ................................................................................................................................................. erate 312

2003 - 2012 Lumerical Solutions, Inc

Contents

undo ................................................................................................................................................. 313 redo ................................................................................................................................................. 313 addport ................................................................................................................................................. 314 rem ................................................................................................................................................. oveport 315 connect ................................................................................................................................................. 315 disconnect ................................................................................................................................................. 316

9 Running ............................................................................................................ simulations 316


run ................................................................................................................................................. 317 runparallel ................................................................................................................................................. 317 addjob ................................................................................................................................................. 318 runjobs ................................................................................................................................................. 318 clearjobs ................................................................................................................................................. 319 runsw ................................................................................................................................................. eep 319

10 FDTD............................................................................................................ Measurements and Normalization 320


transm ................................................................................................................................................. ission 321 transm ................................................................................................................................................. ission_avg 322 transm ................................................................................................................................................. ission_pavg 323 getsourceangle ................................................................................................................................................. 323 nonorm ................................................................................................................................................. 324 cw................................................................................................................................................. norm 325 sourcenorm ................................................................................................................................................. 325 sourcenorm ................................................................................................................................................. 2_avg 326 sourcenorm ................................................................................................................................................. 2_pavg 327 dipolepow ................................................................................................................................................. er 328 sourcepow ................................................................................................................................................. er 329 sourcepow ................................................................................................................................................. er_avg 330 sourcepow ................................................................................................................................................. er_pavg 331 sourceintensity ................................................................................................................................................. 333 sourceintensity_avg ................................................................................................................................................. 333 sourceintensity_pavg ................................................................................................................................................. 334

11 Eigenmode ............................................................................................................ Solver Measurements 335


setanalysis ................................................................................................................................................. 335 getanalysis ................................................................................................................................................. 335 analysis ................................................................................................................................................. 336 m esh ................................................................................................................................................. 336 findm ................................................................................................................................................. odes 337 selectm ................................................................................................................................................. ode 337 frequencysw ................................................................................................................................................. eep 338 coupling ................................................................................................................................................. 338 overlap ................................................................................................................................................. 339 bestoverlap ................................................................................................................................................. 340 propagate ................................................................................................................................................. 341

12 INTERCONNECT ............................................................................................................ Measurements 341


validate ................................................................................................................................................. 342 validateall ................................................................................................................................................. 342 setresult ................................................................................................................................................. 342 getresult ................................................................................................................................................. 343 popportdata ................................................................................................................................................. 343 pushportdata ................................................................................................................................................. 344

2003 - 2012 Lumerical Solutions, Inc

10

Reference Guide
cloneportdata ................................................................................................................................................. 344 portdatasize ................................................................................................................................................. 344 setsparam ................................................................................................................................................. eter 345 setfir ................................................................................................................................................. 346

13 Measurement ............................................................................................................ and optimization data 347


getsw ................................................................................................................................................. eepdata 348 getdata ................................................................................................................................................. 349 getresult ................................................................................................................................................. 350 runanalysis ................................................................................................................................................. 350 havedata ................................................................................................................................................. 351 copydcard ................................................................................................................................................. 351 clearanalysis ................................................................................................................................................. 352 cleardcard ................................................................................................................................................. 353 getelectric ................................................................................................................................................. 353 getm ................................................................................................................................................. agnetic 354 Read ................................................................................................................................................. and w rite data to files 354 rectilineardataset ................................................................................................................................................. 354 m atrixdataset ................................................................................................................................................. 355 addparam ................................................................................................................................................. eter 356 addattribute ................................................................................................................................................. 356 getparam ................................................................................................................................................. eter 357 getattribute ................................................................................................................................................. 357

14 Near ............................................................................................................ to far field projections 358


Far ................................................................................................................................................. field projections 359 Coordinate ................................................................................................................................................. system s 361 farfieldfilter ................................................................................................................................................. 362 farfield2d ................................................................................................................................................. 363 farfieldvector2d ................................................................................................................................................. 364 farfieldpolar2d ................................................................................................................................................. 365 farfieldangle ................................................................................................................................................. 365 farfield2dintegrate ................................................................................................................................................. 366 farfield3d ................................................................................................................................................. 367 farfieldvector3d ................................................................................................................................................. 368 farfieldpolar3d ................................................................................................................................................. 369 farfieldux ................................................................................................................................................. 369 farfielduy ................................................................................................................................................. 370 farfieldspherical ................................................................................................................................................. 370 farfield3dintegrate ................................................................................................................................................. 371 farfieldexact2d ................................................................................................................................................. 372 farfieldexact3d ................................................................................................................................................. 373 farfieldexact ................................................................................................................................................. 374

15 Grating ............................................................................................................ projections 376


Grating ................................................................................................................................................. calculations 376 grating ................................................................................................................................................. 378 gratingn ................................................................................................................................................. 379 gratingm ................................................................................................................................................. 379 gratingpolar ................................................................................................................................................. 380 gratingvector ................................................................................................................................................. 381 gratingperiod1 ................................................................................................................................................. 382 gratingperiod2 ................................................................................................................................................. 382 2003 - 2012 Lumerical Solutions, Inc

Contents

11

gratingangle ................................................................................................................................................. 383 gratingu1 ................................................................................................................................................. 383 gratingu2 ................................................................................................................................................. 384 gratingbloch1 ................................................................................................................................................. 384 gratingbloch2 ................................................................................................................................................. 385

16 Material ............................................................................................................ database 385


addm ................................................................................................................................................. aterial 386 copym ................................................................................................................................................. aterial 386 setm ................................................................................................................................................. aterial 387 getm ................................................................................................................................................. aterial 387 getindex ................................................................................................................................................. 388 getfdtdindex ................................................................................................................................................. 388 getm ................................................................................................................................................. odeindex 389 getnum ................................................................................................................................................. ericalperm ittivity 390

17 User defined ............................................................................................................ GUIs 392


m essage ................................................................................................................................................. 392 new ................................................................................................................................................. w izard 393 new ................................................................................................................................................. w izardpage 393 w izardw ................................................................................................................................................. idget 394 w izarddata ................................................................................................................................................. 395 runw ................................................................................................................................................. izard 395 w izardgetdata ................................................................................................................................................. 396 killw ................................................................................................................................................. izard 396 w izardoption ................................................................................................................................................. 397 fileopendialog ................................................................................................................................................. 397 filesavedialog ................................................................................................................................................. 398

18 Creating ............................................................................................................ your own script commands 398

Index

401

2003 - 2012 Lumerical Solutions, Inc

12

Reference Guide

New Features
FDTD Solutions is constantly being upgraded. See the following sections for a list of the latest new features. New features for version 8.0 User defined material models 13 Non-diagonal anisotropic media 13 Results manager and Visualizer 14 3D only user interface 14 Mode expansion monitors 14 Rotatable mode sources 15 Material fitting improvements 15 New script commands 15 New features for version 7.5 Ability to distribute optimizations and parameter sweeps Movie monitors in parallel simulations 15 New script commands 15 New features for version 7.0 Parameter sweeps 16 Optimization 16 Object library 16 Mac OS X support 16 Windows 7 support 16 Conformal mesh 16 Simplified installation and licensing 17 More flexible PML configuration options Improved GDSII import 17 Analytic material model 17 Other new script commands 17 New features for version 6.5 Structure groups 18 Analysis (monitor) groups 18 Object tree browser 18 Built in script file editor 18 Script syntax highlighting 18 Copy and Paste 18 Dipole radiated power calculation 19 New MODE Source script commands Other new script commands 19

15

17

19

2003 - 2012 Lumerical Solutions, Inc

New Features Online Help search bar 19 Simplified installation 19 Improved material fits 20 New features for version 6.0 Multi coefficient material model 20 Auto fitting of experimental data 20 Improved material database GUI 20 Expanded list of material data 20 Spectral averaging 20 More far field analysis 21 GUI upgrade 21 User defined source signals 21 Shorter source pulses 21 Unicode characters 22

13

1.1

New features for version 8.0


User-defined material models
In FDTD Solutions 8.0, users now have the ability to create plugin materials and directly modify the update equations. This will allow for arbitrary nonlinear materials, negative index materials and many other forms of electric and magnetic field updates. Please see the User-defined models 122 section of the Reference Guide for more detail. In addition, the following new material models have been added to the Material database 117 (and more material models will be introduced in the future):
( 2) ( 3)

1. , materials: users can now specify the and terms for nonlinear simulations. An arbitrary dispersive base material can also be specified, in which case the added polarization will be in addition to the polarization of any base material that is selected. 2. Paramagnetic materials: users can now specify both the Permittivity and Permeability to simulate magnetic materials.

( 2)

( 2)

( 3)

Non-diagonal anisotropic media


FDTD Solutions 8.0 supports the full 9 element permittivity tensor:

Di

ij

Ej

where summation over j is implied on the right hand side. The full anisotropy tensor can be written as

2003 - 2012 Lumerical Solutions, Inc

14

Reference Guide

11 21 31

12 22 32

13 23 33

To define this tensor, users will start by specifying the diagonal elements of the tensor. Then, arbitrary rotations to this tensor can be applied through a Grid Attribute 72 object to induce the correct rotation. Please see Anisotropic materials 121 for more information on how to define this tensor. This new feature allows users to simulate magneto-optical effects, as well as arbitrary Liquid Crystals orientations. Please see the Anisotropy and Magneto-Optics section of the Application Library for some examples.

Results manager and Visualizer


The Results Manager 142 is a tool for analyzing simulation data. This includes a Results View window which displays all the results for the simulation object that is currently selected in the Object Tree. The Results Manager also includes a Script Workspace and a Script Favorites window, providing additional GUI-based functionalities. Also featured in FDTD Solutions 8.0 is a Visualizer 139 , which significantly simplifies the process of visualizing simulation data. When used in conjunction, Results Manager and the Visualizer provide a very useful and intuitive way of analyzing and visualizing variables and results through the GUI, greatly reducing the need for scripting.

3D only user interface


FDTD Solutions 8.0 allows users to perform 2D and 3D simulations on the same 3D structure by defining 2D and 3D simulation regions in the same project file. A 2 dimensional drawing mode is provided so that it is possible to work only with a 2 dimensional slice of the structure. The 2 dimensional drawing mode looks very similar to the 2 dimensional drawing environment from 2D FDTD or MODE 4. For more information, see Converting from 2D to 3D 65 .

Mode expansion monitors


FDTD Solutions 8.0 features new mode expansion monitors. These monitors allow users to expand an arbitrary field profile (from a monitor) into a specific mode (or a set of modes). For more information on this expansion calculation, and the results that are returned, see Overlap analysis. The Mode Expansion monitor greatly facilitates the interoperability between FDTD Solutions and INTERCONNECT as it returns the S parameters, which can be imported into

2003 - 2012 Lumerical Solutions, Inc

New Features INTERCONNECT directly.

15

Rotatable mode sources


MODE sources can now be injected along an angled plane by setting the rotation angles (see Sources -> General Tab 93 ). Users should make sure to extend the waveguide/fiber through the PML boundaries, and make sure that the "extend structure through pml" property under Edit FDTD Simulation -> Advanced options is unselected.

Material fitting improvements


The material fitting routine has been optimized to improve material fits for dispersive sampled materials with low losses.

Other new script commands


The following script functions were added in FDTD Solutions 8.0. For more information, see the function descriptions in the scripting section of the Reference Guide. . operator 193 , addattribute 356 , addparameter 356 , eig 220 , debug 182 , getattribute 357 , getparameter 357 , getresult 350 , integrate2 226 , matrixdataset 355 , mult 221 , permute 222 rectilineardataset 354 , reshape 223 ,

1.2

New features for version 7.5


Concurrent simulations
FDTD 7.5 provides a simple way to run multiple simulations at the same time. For example, suppose you have 30 simulations from an optimization or parameter sweep task. In the past, each of the 30 simulations would run consecutively on the local computer. (It was also possible for the user to manually distribute the jobs in some other manner.) With FDTD 7.5, the jobs can be automatically sent to several computers in your local network. If there are three computers in the network, FDTD can run three concurrent simulations (one on each computer), reducing the time to complete the sweep by a factor of 3. Extra FDTD simulation engine licenses will be required to run additional simultaneous simulations.

Movie monitors in parallel simulations


Movie monitors now work in parallel (multi-process) simulations. In previous versions, movie monitors only worked when the simulation was run in single processor mode.

Other new script commands


The following script functions were added in FDTD Solutions 7.5. For more information, see the function description in the scripting section of the Reference Guide. runsweep 319 addjob 318 , runjobs 318 , clearjobs 319

2003 - 2012 Lumerical Solutions, Inc

16

Reference Guide

1.3

New features for version 7.0


Optimization
Optimization is a key component of FDTD Solutions 7.0 Optimization is important when there is a large parameter space, where simple parameter sweeps require too many simulations to be practical. Prior to FDTD 7.0, it was possible to implement your own optimization algorithms via the scripting language, but this can be a difficult task, due to the complexity of optimization algorithms. FDTD 7.0 includes a new optimization feature which provides a graphical interface to a built in Particle Swarm based optimization algorithm. It is also possible to create your own custom optimization algorithms within this graphical optimization feature.

Conformal mesh
Achieve higher accuracy for a given mesh size with conformal meshing. The conformal meshing technique can resolve interfaces to much higher precision than the standard staircase meshing, making it an ideal method to solve structures with thin layers, curved surfaces and high index contrast materials, such as surface plasmon or silicon on insulator waveguides.

Parameter sweeps
Parameter sweeps are a very common task. Prior to FDTD 7.0, creating parameter sweeps required the scripting language. One of the major new features in FDTD 7 is the ability to do parameter sweeps in a completely graphical way, without the use of the scripting language.

Object library
A library of complex structure groups and analysis objects have been incorporated into the graphical CAD environment. In the past, many of these objects were available via the Online Help, but making them available directly from within the product is much more efficient. The new object library includes complex structure groups like waveguide components, randomized clouds of particles, photonic crystal arrays, etc. It also includes analysis objects like power transmission boxes, cavity Q calculators, S-parameter monitors, etc.

Mac OS X support
Mac OS X v10.5 Leopard and above has been added to the list of supported systems.

Windows 7 support
Windows 7 has been added to the list of supported systems.

2003 - 2012 Lumerical Solutions, Inc

New Features

17

Simplified installation and licensing


The Portable and Floating license options have been merged into a single licensing option. It is no longer necessary to install the stand-alone Lumerical License Manager. All licensing information (quotas, expiry dates, etc) can now be stored directly on the USB hardware key. The behavior of the key (portable or floating) can be changed at any time without assistance from Lumerical.

More flexible PML configuration options


PML boundaries are intended to absorb all incident light, with zero reflection. In practice, there is always some reflection. This reflection can be minimized by using more PML layers, although this makes the simulation run slower. It is now possible to specify the desired PML reflection directly, rather than having to specify the number of PML layers. PML boundaries perform best when the surrounding structures extend completely through the boundary condition region. Many users are unaware of this issue, making it a common setup mistake. In FDTD 7, the default behavior is to automatically extend the material properties through the PML boundaries, even if they were not drawn that way. This should result in better PML performance (absorption) for these users.

Improved GDSII import


The GDSII file import 77 functionality has been improved. GDSII operation scale, rotate, flip are now supported. Path types 0 and 2 are now supported.

Analytic material model


The analytic material model allows the user to enter an equation for the real and imaginary part of the permittivity or refractive index which can depend on the predefined variables listed below. However, it is important to remember that the specified equations are not used directly in the simulation. An FDTD material model must still be generated, much like the Sampled data material model. It's important to check the FDTD model with the Material Explorer before running a simulation.

Other new script commands


The following script functions were added in FDTD Solutions 7.0. For more information, see the function description in the scripting section of the Reference Guide. eval 230 , getglobalsource 298 , getglobalmonitor 298 , setglobalsource 294 , setglobalmonitor 293 , groupscope 284 , getsweepdata 348 , clearanalysis 352 , addgroup 264 , polar 255 , meshgrid4d 188 , substring 231 , findstring 232 , replace 232 , replacestring 233 , polyarea 239 , centroid 240 , polyintersect 240 , inpoly 241 , polygrow 241 , polyand 242 , polyor 242 , polyxor 244 , lineintersect 244 , linecross 245

2003 - 2012 Lumerical Solutions, Inc

18

Reference Guide

1.4

New features for version 6.5


Structure groups
The ability to group structures is one of the main new features in FDTD 6.5. Groups can be moved, rotated and copied as a single object. In addition to simple grouping, it is possible to create parameterized group-objects by adding script code to the group. For example, it is possible to create a Photonic Crystal Array group with a Pitch input parameter. When the Pitch parameter is changed, all objects in the group will automatically move to the appropriate position. For an example of how to create and use a group see the pc micro cavity tutorial in the getting started section.

Analysis (monitor) groups


The ability to group monitors into Analysis groups is one of the main new features in FDTD 6.5. Groups can be moved and copied as a single object. In addition to simple grouping, it is possible to create parameterized group-objects by adding script code to the group. For example, it is possible to create a Scattering Cross-section Analysis group. The group is composed of 4 monitors that form a box around the structure. One associated script adjusts the monitor positions as defined by the input parameters. A second script calculates the scattering cross-section from the monitor data. This analysis group is set up in the monitors section of the Getting Started nanowire resonance tutorial. A second analysis group example can be found in the pc micro cavity tutorial.

Object tree browser


The object tree browser provides an alternate view of objects within a simulation. It is especially useful for complicated simulations with many overlapping objects. In such cases, it is much easier to select objects from the tree view than directly in the graphical view ports. It also makes selecting objects within groups possible. For more information, see the layout editor tabs and object tree section of the Layout editor chapter.

Built in script file editor


The Script file editor allows you to create, edit, and run script files directly from within FDTD Solutions, rather than using another text editor like Notepad. Syntax highlighting makes it easier to read, write and debug script files. The Run Script button makes running the script quick and easy. For more information, see the script prompt and script file editor 63 page in the Layout editor section.

Script syntax highlighting


The Script File Editor and Script Prompt have syntax highlighting to make the commands easier to read, write and debug. Comments are green, strings are red, and loop/control statements are blue.

Copy and Paste


FDTD Solutions now supports Copy and Paste operations. This allows you to copy (Ctrl-C)

2003 - 2012 Lumerical Solutions, Inc

New Features a group of objects from one simulation and paste (Ctrl-V) a copy of those objects into a different simulation. This is especially useful with the new structure and analysis groups.

19

Dipole radiated power calculation


The dipolepower 328 script command returns the actual power radiated by a dipole source. This greatly simplifies calculations that require knowledge of the radiated power, such as enhancement and efficiency measurements.

New MODE Source script commands


The updatesourcemode 306 script command automatically updates the mode profile of the MODE source. This makes it much easier to automate some types of parameter sweeps. The get 294 script command now returns the mode profile stored in the MODE source, in addition to the other object properties. The clearsourcedata 307 script command clears the mode profile from the MODE Source.

Other new script commands


The following script functions were added in FDTD Solutions 6.5. For more information, see the function description in the scripting section of the Reference Guide. system 166 , almostequal 196 , not 201 , square brackets 184 , single quotes 203 , format 173 , updatesourcemode 306 , clearsourcedata 307 , addstructuregroup 265 , addanalysisgroup 265 , adduserprop 291 , addtogroup 290 , getmaterial 387 , havedata 351 , layoutmode 264 , sourceintensity 333 , sourceintensity_avg 333 , sourceintensity_pavg 334 , dipolepower 328 , runanalysis 350 , runwizard 395 , wizardgetdata 396 , setplot 260 .

Online Help search bar


The Online Help search toolbar provides easy access to the FDTD Solutions Online Help website. The toolbar will open your default web browser and search the Online Help for the requested term. This is particularly useful when searching for script function syntax. For more information, see the toolbars 52 page in the layout editor section.

Simplified installation
Simplified licensing: The USB hardware keys now contain much of the licensing information (expiry dates, quotas). In many cases, license files are no longer required. Matlab script integration: FDTD Solutions automatically detects MATLAB. The MATLAB script integration step of the FDTD installation has been removed.

2003 - 2012 Lumerical Solutions, Inc

20

Reference Guide MATLAB is a registered trademark of The Mathworks, Inc.

Improved material fits


The fitting functions used to generate material models from Sampled data materials have been improved to give more control over the fits that can be generated. For example, you can specify a custom wavelength range or force the fit to give priority to the real or imaginary part of the permittivity.

1.5

New features for version 6.0


Multi coefficient material model
In the past, FDTD Solutions supported single Plasma, Lorentz, Debye or combinations of these dispersive models. FDTD Solutions 6 has a new generalized multi-coefficient model that allows more complicated data to be fit. The accuracy of the model can be controlled with the number of coefficients. More coefficients will give a better fit to experimental data, but at the expense of more memory and longer simulation times. This model is only available when using the Sampled data material definition. The coefficients are automatically calculated from the sampled material data over the source bandwidth. See the chapter on the Material Database for details.

Auto fitting of experimental data


The Sampled data material definition (for importing experimental data) uses an automatic fitting routine to calculate broadband model parameters from experimental data. This makes importing experimental data much easier, since manually calculating model parameters can be very difficult. See Material Database for more information.

Improved material database GUI


The Material Database interface has been completely redesigned and simplified. The Database provides an interface to modify the properties of existing materials and to add new materials. The Material Explorer is used to view the index/permittivity profile of material in the database. See the Material Database 116 chapter for more information.

Expanded list of material data


The number of materials included in the Material Database has been increased. Co, Cr, Cu, Ge, In, Ni, Pt, Ti, W, AlN, GaAs, H20 are some of the new materials. The frequency range of the data has also been expanded. Most materials have data at least from deep UV to far infrared.

Spectral averaging
The Spectral averaging feature of Power and Profile monitors calculates the incoherent spectral average of the electromagnetic fields or the Poynting vector as the simulation runs.

2003 - 2012 Lumerical Solutions, Inc

New Features

21

The technique is much more efficient than measuring many frequencies and averaging after the simulation. Two types of averaging are available. Total spectral averaging uses the source input spectrum as the weighting function. This is most useful when the source spectrum of the simulation matches the actual illumination conditions. Partial spectral averaging uses a Lorentzian weighting function multiplied by the source spectrum. Partial spectral averaging is useful to extract the average response of the system to a variety of different illumination conditions from a single simulation. See the Spectral averaging section of the Units and Normalization chapter for more details.

More far field analysis


A number of new far field projection and grating script functions have been added. Three of the new functions are described here. For more information, see the far field function section of the Reference Guide: Near to far field projections 358 . The farfield3dintegrate 371 function makes integrating portions of the far field much easier. The farfieldspherical 370 function converts direction cosine units (returned from the far field projection functions) into more familiar spherical coordinates. The gratingvector 381 function can be used to study the polarization of grating orders of periodic structures.

GUI upgrade
The entire Graphical User Interface has been updated. It is now possible to undock individual sub-windows from the main application. This can be very helpful when trying to make one sub-window very large. Another new feature is the ability to show/hide and rearrange toolbars.

User defined source signals


The source time signal is normally generated by FDTD Solutions based on the frequency range specified by the user. While the automatically generated pulse is usually appropriate, there are some simulations where a custom source time signal is desirable. FDTD Solutions 6.0 now supports user defined source time signals. See the script command setsourcesignal 305 for more information.

Shorter source pulses


FDTD Solutions 6.0 uses a new algorithm to generate the source time pulse from the frequency range specified by the user. The new algorithm generates a much shorter time pulse, while still ensuring that most of the pulse energy is contained within the frequencies of interest.

2003 - 2012 Lumerical Solutions, Inc

22

Reference Guide The total simulation time of many simulations is dominated by the source pulse length. These simulations will experience a significant speedup because of the shorter pulse. Simulations with resonant structures, where the total simulation time is not dominated by the source pulse length, will not experience this speedup.

Unicode characters
FDTD Solutions now supports Unicode file names and file paths. This allows users to work in directories and save simulation files with names that include characters from Japanese, Chinese, or other languages that are supported by the Unicode format.

2003 - 2012 Lumerical Solutions, Inc

Solver physics

23

Solver physics
This chapter describes the basic physics and algorithms used in Lumerical's various 'Physics' based solvers:

FDTD Solutions

23

The Finite-Difference Time-Domain method, which is the method behind both FDTD Solutions and MODE Solutions' Propagator

MODE Solutions Eigenmode Solver

26

The method behind MODE Solutions' Eigenmode Solver and FDTD Solutions' Integrated MODE Solver

MODE Solutions Propagator 28


The method behind MODE Solutions' omnidirectional propagator for planar integrated systems.

INTERCONNECT DEVICE

31

The method behind Lumerical's INTERCONNECT circuit simulator


32

The method behind Lumerical's DEVICE electronic device simulator

2.1

FDTD
The finite-difference time-domain (FDTD) method1,2,3 is a state-of-the-art method for solving Maxwell's equations in complex geometries. Being a direct time and space solution, it offers the user a unique insight into all types of problems in electromagnetics and photonics. In addition, FDTD can also obtain the frequency solution by exploiting Fourier transforms, thus a full range of useful quantities can be calculated, such as the complex Poynting vector and the transmission / reflection of light. This section will introduce the basic mathematical and physics formalism behind the FDTD algorithm used in FDTD Solutions and MODE Solutions' propagator, starting from the linear Maxwell's equations. The simulator can be used for advanced research and development or as an ideal teaching and learning environment in photonics, optics, and electromagnetics.

1 Dennis M. Sullivan, Electromagnetic simulation using the FDTD method. New York: IEEE Press Series, (2000). 2 Allen Taflove, Computational Electromagnetics: The Finite-Difference Time-Domain Method. Boston: Artech House, (2005).

2003 - 2012 Lumerical Solutions, Inc

24

Reference Guide 3 Stephen D. Gedney, Introduction to the Finite-Difference Time-Domain (FDTD) Method for Electromagnetics. Morgan & Claypool publishers, (2011).

2.1.1 FDTD and Maxwell's equations


FDTD solves Maxwell's curl equations in non-magnetic materials:

D t

H
0 r

D( )

( )E( )

H t
( )

1
0

where H, E, and D are the magnetic, electric, and displacement fields, respectively, while
r

is the complex relative dielectric constant (

( )

n2

, where n is the refractive

index). In three dimensions, Maxwell equations have six electromagnetic field components: Ex , Ey , Ez and Hx , Hy , and Hz. If we assume that the structure is infinite in the z dimension and that the fields are independent of z, specifically that
r

( , x, y , z )

( , x, y )

E z

H z

then Maxwell's equations split into two independent sets of equations composed of three vector quantities each which can be solved in the x-y plane only. These are termed the TE (transverse electric), and TM (transverse magnetic) equations. We can solve both sets of equations with the following components: TE: Ex , Ey , Hz TM: Hx , Hy , Ez For example, in the TM case, Maxwell's equations reduce to:

Dz t
Dz ( )

Hy x
0 r

Hx y
( ) Ez ( )

2003 - 2012 Lumerical Solutions, Inc

Solver physics

25

Hx t

1
0

Ez y

Hy t

1
0

Ez x

FDTD Solutions can solve the two and three dimensional Maxwell's equations in dispersive media and some simple non-linear media, where the user can specify arbitrary geometric structures and various input excitation sources. The two dimensional FDTD simulator solves the TE and/or TM Maxwell equations. FDTD is a time domain technique, meaning that the electromagnetic fields are solved as a function of time. In general, FDTD Solutions is used to calculate the electromagnetic fields as a function of frequency or wavelength by performing Fourier transforms during the simulation. This allows it to obtain complex-valued fields and other derived quantities such as the complex Poynting vector, normalized transmission, and far field projections as a function of frequency or wavelength. The field information can be returned in two different normalization states, please see the section on frequency domain normalization for more details. Dispersive materials with tabulated refractive index (n,k) data as a function of wavelength can be solved using the multi-coefficient models with auto-fitting. Alternatively, specific theoretical models such as Plasma (Drude), Debye or Lorentz can be used. See the chapter on the Material Database 116 for details. Boundary conditions are very important in electromagnetics and simulation techniques. FDTD Solutions/propagator supports a range of boundary conditions, such as PML, periodic, and Bloch. See the boundary conditions 86 section here for the complete list. Sources are another important component of a simulation. FDTD Solutions/propagator supports a number of different types of sources such as point dipoles, beams, plane waves, a total-field scattered-field (TFSF) source, a guided-mode source for integrated optical components, and an imported source to interface with external photonic design softwares. Detailed information about each of these sources is contained in the Radiation sources 91 section. Unless otherwise specified, all quantities in FDTD Solutions/propagator are calculated in SI units. Please see Units and Normalization for more information. The online User Guide at http://docs.lumerical.com/en/fdtd/knowledge_base.html has many more details about the physics of FDTD and how to obtain advanced results. Please see, for example, the sections on coherence, and far field calculations in the online User Guide.

2003 - 2012 Lumerical Solutions, Inc

26

Reference Guide

2.1.2 Meshing in FDTD


FDTD Solutions uses a rectangular, Cartesian style mesh, like the one shown in the following screenshot. It's important to understand that of the fundamental simulation quantities (material properties and geometrical information, electric and magnetic fields) are calculated at each mesh point. Obviously, using a smaller mesh allows for a more accurate representation of the device, but at a substantial cost. As the mesh becomes smaller, the simulation time and memory requirements will increase. FDTD Solutions provides a number of features, including the conformal mesh algorithm, that allow you to obtain accurate results, even when using a relatively coarse mesh. By default, the simulation mesh is automatically generated. To maintain accuracy, the meshing algorithm will create a smaller mesh in high index (to maintain a constant number of mesh points per wavelength) and highly absorbing (resolve penetration depths) materials. In some cases, it is also necessary to manually add additional meshing constraints. Usually, this involves forcing the mesh to be smaller near complex structures (often metal) where the fields are changing very rapidly.

2.2

Eigenmode Solver
The Eigenmode Solver (Eigensolver) solves for optical modes in a cross-section of an arbitrary waveguide geometry. The waveguide mode as a transverse field distribution that propagates along the waveguide without changing shape.

In the z-normal eigenmode solver simulation example shown in the figure above, we have the vector fields: and where is the angular frequency and is the propagation constant. The modal effective

E ( x, y )e ( i

z)

H ( x, y )e ( i

z)

2003 - 2012 Lumerical Solutions, Inc

Solver physics

27

neff
index is then defined as

c
.

MODE Solutions find these modes by solving Maxwell's equations on a cross-sectional mesh of the waveguide. The finite difference algorithm is the current method used for meshing the waveguide geometry, and has the ability to accommodate arbitrary waveguide structure. Once the structure is meshed, Maxwell's equations are then formulated into a matrix eigenvalue problem and solved using sparse matrix techniques to obtain the effective index and mode profiles of the waveguide modes. This method is based on Zhu and Brown1 , with proprietary modifications and extensions.

Z. Zhu and T. G. Brown, Full-vectorial finite-difference analysis of microstructured optical fibers, Opt. Express 10, 853864 (2002), http://www.opticsexpress.org/abstract.cfm? URI=OPEX-10-17-853

2.2.1 Meshing in the Eigenmode solver


The MODE Solutions Eigenmode Solver uses a rectangular, Cartesian style mesh, like the one shown in the following screenshot. It's important to understand that of the fundamental simulation quantities (material properties and geometrical information, electric and magnetic fields) are calculated at each mesh point. Obviously, using a smaller mesh allows for a more accurate representation of the device, but at a substantial cost. As the mesh becomes smaller, the simulation time and memory requirements will increase. MODE Solutions provides a number of features, including the conformal mesh algorithm, that allow you to obtain accurate results, even when using a relatively coarse mesh.

2003 - 2012 Lumerical Solutions, Inc

28

Reference Guide By default, the simulation will use a uniform mesh. You simply set the number of mesh points along each axis. In some cases, it is necessary to add additional meshing constraints. Usually, this involves forcing the mesh to be smaller near complex structures where the fields are changing very rapidly. Note: In FDTD-based simulations, it's important to use a smaller mesh in high index materials, and to maintain a minimum number of mesh points per wavelength. This constraint does not exist for the Eigenmode solver.

2.3

Propagator
MODE Solutions currently supports 2 methods of propagating fields. 1) The variational FDTD 28 (varFDTD) propagator. This propagator accurately describes the propagation of light in planar integrated optical systems, from ridge waveguide-based systems to more complex geometries such as photonic crystals. The propagator allows for planar (omni-directional) propagation without any assumptions about an optical axis, which allows for structures like ring resonators and photonic crystal cavities to be efficiently modeled devices that have been traditionally treated with 3D FDTD. The propagator can model devices on the scale of hundreds of microns quickly. 2) The eigenmode expansion 30 propagator. This script based, unidirectional eigenmode expansion propagator allows you to decompose one input or waveguide mode onto the modes of another waveguide section and propagate the modes an arbitrary distance. It is useful for waveguide couplers, long tapers and other devices where the propagation can be assumed to be essentially unidirectional.

2.3.1 Variational FDTD


The variational FDTD propagator is based on collapsing a 3D geometry into a 2D set of effective indices that can be solved with 2D FDTD 23 . This works best with waveguides made from planar structures. The main assumption of this method is that there is little coupling between different supported slab modes. For many devices, such as SOI based slab waveguide structures, that only support 2 vertical modes with different polarizations, this is an excellent assumption. The calculation steps involve: 1. Identification of the vertical slab modes of the core waveguide structure, over a desired

2003 - 2012 Lumerical Solutions, Inc

Solver physics range of wavelengths. 2. Meshing of the structure and collapse of the 3rd dimension by calculation of the corresponding effective 2D indices (taking into account the vertical slab mode profile). There are currently two approaches to doing this in the Propagator:

29

Variational A variational procedure based on Hammer and Ivanova1. Here, the effective permittivities of the TE and TM-like modes have the form:
2 TE eff

( x, y , z )
z

( z , ) M ( z , ) dz
2

( x, y , )

k
z

M ( z , ) dz

1
2 TM eff

| M | dz
z

1
r

( x, y , )

k
z

1 | M |2 dz ( x, y , z )

k2
z

1 M dz ( x, y , z ) z 1 2 M dz ( x, y , z )

where r, M and r are the 1-D reference permittivity profile, the associated guided slab mode and the propagation constant. Reciprocity Based This is a procedure based on the reciprocity theorem, as described in Snyder and Love2:
1 2

( x, y , z )
z

r ( z , ) E ( z , ) dz

neff ( x, y, )

0 0

P ndz
z

Note that in both cases, the generated effective materials are also dispersive, where the dispersion comes both from the original material properties (material dispersion) and the slab waveguide geometry (waveguide dispersion). These new materials are then fitted using Lumerical Solutions' multi-coefficient model into a time-domain form that can be used in the 2D FDTD simulation in step 3. Note that the effective index treatment may lead to generated materials that have properties that are unphysical (for example, having an artificial negative imaginary index). In this case, one has the option of restricting the range of generated indices to the min/max values defined by the physical material properties of the original materials. All of these settings can be found under the Effective index tab of the Propagator simulation region. 3. Simulation of the structure in 2D by FDTD 23 . 4. If desired, re-expansion of the fields into 3D.

2003 - 2012 Lumerical Solutions, Inc

30

Reference Guide

The Ring resonator getting started example contains step-by-step instructions and discussions on how to carry out a propagator simulation using the variational FDTD method. 1 Manfred Hammer and Olena V. Ivanova, MESA Institute for Nanotechnology, University of Twente, Enschede, The Netherlands "Effective index approximation of photonic crystal slabs: a 2-to-1-D assessment", Optical and Quantum Electronics ,Volume 41, Number 4, 267-283, DOI: 10.1007/s11082-009-93493 2 Allan W. Snyder and John D. Love, Optical Waveguide Theory. Chapman & Hall, London, England, 1983.

2.3.2 Eigenmode expansion


This unidirectional eigenmode expansion method is implemented in the propagate 341 command. The propagate command calculates the resulting mode profile of an arbitrary mode after it has propagated through a waveguide for some distance. This is done by decomposing the mode into modes supported by the waveguide (ie. the currently calculated modes) using overlap integrals 339 . Each supported mode is then propagated through the waveguide. The resulting modes are then added coherently to give the final mode profile. This technical is useful for waveguide couplers, long tapers and other devices where the propagation can be assumed to be essentially uni-directional. Please see MODE Solutions' applications library for some use case examples: Evanescent waveguide couplers Tapered waveguides Polarization rotator

2.3.3 Meshing in the propagator


The MODE Solutions Propagator uses a rectangular, Cartesian style mesh, like the one shown in the following screenshot. It's important to understand that of the fundamental simulation quantities (material properties and geometrical information, electric and magnetic fields) are calculated at each mesh point. Obviously, using a smaller mesh allows for a more accurate representation of the device, but at a substantial cost. As the mesh becomes smaller, the simulation time and memory requirements will increase. MODE Solutions provides a number of features, including the conformal mesh algorithm, that allow you to obtain accurate results, even when using a relatively coarse mesh.

2003 - 2012 Lumerical Solutions, Inc

Solver physics By default, the simulation mesh is automatically generated. To maintain accuracy, the meshing algorithm will create a smaller mesh in high index (to maintain a constant number of mesh points per wavelength) and highly absorbing (resolve penetration depths) materials. In some cases, it is also necessary to manually add additional meshing constraints. Usually, this involves forcing the mesh to be smaller near complex structures (often metal) where the fields are changing very rapidly. Note: meshing time The general meshing algorithm can take a reasonable amount of time compared to the simulation because the mesh must be effectively completed in 3D. It is possible for the user to specify if the structure is composed of purely extruded structures - that is structures that are extruded along z with perfectly vertical sidewalls. In this case, the meshing can be accomplished much faster.

31

2.4

INTERCONNECT
INTERCONNECT is a circuit simulator that can support mixed signal representation of optical single and multi-mode signals as well as electrical signals. The signals can propagate fully bidirectionally through the circuit topology for both Time Domain 31 and Frequency Domain 32 simulations.

Users can choose elements from an extensive list of pre-defined PIC elements, as well as create custom elements from pre-defined primitives or via Lumericals powerful script language. In addition, elements can also be characterized accurately using results directly from Lumerical's electromagnetic simulators (FDTD Solutions and MODE Solutions).

2.4.1 Time Domain Simulator


Time domain simulation is performed using a data flow system simulator, allowing for more flexibility than using traditional discrete time or time-driven simulators. The simulator scheduler calculates each element in order to generate time domain waveform samples and propagate them bidirectionally. Very close coupling between components can be simulated allowing, for example, the analysis of optical resonators.

2003 - 2012 Lumerical Solutions, Inc

32

Reference Guide

2.4.2 Frequency Domain Simulator


Frequency domain simulation is performed using scattering data analysis to calculate the overall circuit response.

The circuit is composed a series of elements connected by an arbitrary number of input/ output (or bidirectional) ports. Users can define all the modes supported by the device and their frequency dependent properties. Once all the ports are defined, INTERCONNECT carries out the scattering data analysis for the entire circuit by solving a sparse matrix that represents the circuit as connected scattering matrices, each one of them representing the frequency response of an individual element.

2.5

DEVICE
DEVICE is an physics-based electrical simulation tool for semiconductors, which selfconsistently solves the system of equations describing the electrostatic potential and density of free charge (electrons and holes). DEVICE solves the drift-diffusion equation to describe the spatial distribution of electrons and holes, and solves the Poisson equation to establish the electrostatic potential. Solving the drift-diffusion (DD) equations is an established and robust method that will produce accurate results for a wide range of semiconductor devices under common operating conditions. This section will introduce the basic mathematical and physics formalism behind the selfconsistent algorithm used in DEVICE, starting from the non-linear Poisson and driftdiffusion equations. The simulator can be used for advanced research and development or as an ideal teaching and learning environment in semiconductor electronics and optoelectronics.

2003 - 2012 Lumerical Solutions, Inc

Solver physics

33

2.5.1 System of Equations


DEVICE solves the drift-diffusion equations for electrons and holes (carriers)

Jn
Jp

q
q

n E qDn n
p E qD p p

where Jn,p is the current density (A/cm2), q is the positive electron charge, n,p is the mobility, E is the electric field, Dn,p is the diffusivity, and n and p are the densities of the electrons and holes, respectively (the subscripts n and p indicate quantities that are specific to the carrier type). Each carrier (electron or hole) moves under the influence of two competing processes: drift due to the applied electric field, and random thermal diffusion due to the gradient in the density. These processes are represented in the drift-diffusion equations as the sum of two terms. The mobility n,p describes the ease with which carriers can move through the semiconductor material, and is related to the diffusivity Dn,p through the Einstein relation

Dn , p

n, p

k BT q

where kB is the Boltzmann constant. The mobility is a key property of the material, and may be modeled as a function of temperature, impurity (doping) concentration, carrier concentration, and electric field. For further details, please see the section on material models. To solve the drift-diffusion equations, the electric field must be known. To determine the electric field, Poisson's equation is solved:

q
(E V)
and the

where is the dielectric permittivity, V the electrostatic potential net charge density,

p n C
which includes the contribution C from the ionized impurity density. Finally, the auxiliary continuity equations are required to account for charge conservation

n t p t

1 q 1 q

Jn Jp

Rn Rp

where Rn,p is the net recombination rate (the difference between the recombination rate

2003 - 2012 Lumerical Solutions, Inc

34

Reference Guide and generation rate). The physical processes associated with the material are assumed to act equivalently when applied to electrons or holes, and as a result, R = Rn = Rp. The recombination and generation processes are important factors in the material-specific calculation of carrier behavior. Multiple recombination and generation processes are modeled, which may depend on temperature, impurity (doping) concentration, carrier concentration, electric field, and current density. For further details, please see the section on material models. DEVICE discretizes and solves the drift-diffusion and Poissons equations on an unstructured finite-element mesh in one and two dimensions. The simulation region is partitioned into multiple domains along boundaries between materials with unique physical descriptions. The materials used in the simulation may be categorized as insulators, semiconductors, or conductors; each type of material has an associated user-specified model or collection of models that describe its behavior. In particular, specialized multicoefficient models are provided for semiconductors that describe the fundamental properties, mobility, and recombination processes inherent to that material. The system of equations solved by DEVICE admits both a steady-state and time-varying result. By enforcing the condition

n t

p t

in the continuity equations, the carrier density and electrostatic potential can be solved at steady-state. Steady-state simulations can be used to examine the systems behavior at a fixed operating point, and are also useful when extracting small-signal parameters for a component (e.g. for frequency response analysis). Alternately, by specifying an initial condition for the carrier density and electrostatic potential, the equations can be solved in a sequence of discrete times. The time-dependent behavior of the component can then be used to directly evaluate its large-signal time-domain response or extract large-signal AC parameters. Boundary conditions are very important in an accurate semiconductor device simulation. Two categories of boundary condition are present in DEVICE: those that relate to the electrostatic potential (Poissons equation) and those that relate to the carrier densities (the drift-diffusion equations). Poissons equation and the drift-diffusion equations are second-order partial differential equations (PDE), and each requires that the solution be explicitly specified for at least one location. This is known as a Dirichlet boundary condition. For the electrostatic potential, the Dirichlet condition takes the form of a boundary (internal or external) with a fixed voltage specified,

V ( x)

V1

as is typical of an electrical contact. For the carrier densities, the majority carrier concentration is set to its equilibrium value at the interface between a contact and the

2003 - 2012 Lumerical Solutions, Inc

Solver physics semiconductor, such that

35

p n C

At internal boundaries between two domains that are not contacts, the boundary conditions are determined from the physical properties of the interface. In the case of the electrostatic potential, the electric flux density must be continuous across the boundary in the absence of a surface charge. For the electron and hole densities, boundary conditions between the semiconductor and adjacent materials may be specified in terms of a surface recombination current density, which will default to zero (no carrier flux across the boundary) for insulators or an infinite recombination velocity (forcing the carrier density to its equilibrium value) for contacts. At the external (open) boundaries of the simulation domain, homogenous Neumann boundary conditions are applied: the electric field normal to the boundary is set to zero as is the surface recombination current density. Physically, this corresponds to an insulating boundary across which no charge can flow. By convention, the length units in semiconductor models are chosen to be centimeters. This is reflected in the semiconductor device literature, and in the parameter coefficients for the material models. Energies are calculated in electron Volts (eV), where the electron energy E is related to the local electrostatic potential (voltage) as E = -qV. All energies (and voltages) are referenced from the (equilibrium) Fermi level of an electrical contact in the system.

2.5.2 Meshing in DEVICE


DEVICE uses an unstructured, finite-element mesh, like the one shown in the following screenshot. The solution to the system of equations used to determine the physical quantities of interest is estimated from the discrete formulation of those equations. Consequently, it's important to understand that of the fundamental simulation quantities (material properties, geometry information, electrostatic potential, and carrier concentrations) are calculated at each mesh vertex.

2003 - 2012 Lumerical Solutions, Inc

36

Reference Guide A finer mesh (with shorter edge lengths and smaller elements) will better approximate the exact solution to the system of equations, but at a substantial cost. As the mesh features become smaller, the simulation time and memory requirements will increase. DEVICE provides a number of tools, including the automatic and guided mesh refinement, that allow you to obtain accurate results, while minimizing computational effort.

2003 - 2012 Lumerical Solutions, Inc

Units and normalization

37

Units and normalization


This chapter contains information on the units and normalization scheme corresponding to the different type of solvers that Lumerical Solutions provides: Time domain solvers 37 : This section applies to FDTD Solutions and MODE Solutions' Propagator Frequency domain solvers 48 : This section applies to MODE Solutions' Eigenmode Solver and FDTD Solutions' Integrated MODE Solver

3.1

Time domain solvers


Unless specified explicitly in a GUI window, SI Units are used at all times. The following table summarizes the units used in time domain solvers (ex. FDTD Solutions and MODE Solutions' Propagator). Please note that some quantities can be returned in either the Continuous Wave Normalization state (cwnorm) or the No Normalization state (nonorm). Please see Frequency domain normalization 39 for details on the different normalization states. For most applications, the default cwnorm state is the best choice. To see the data available in a source or monitor, use the script command ?getdata 349 ("monitorname"); All data can be obtained in scripting, with commands such as getdata 349 , getelectric 353 , getmagnetic 354 and transmission 321 . Quantity E(t) |E(t)|2 H(t) |H(t)|2 p m Description Electric field as function of time Electric field intensity as a function of time Magnetic field as a function Norm state N/A N/A N/A Units V/m (V/m)2 A/m (A/m)2 Cm Am2 Unit description Volts per meter Volts squared per meter squared Amperes per meter Amperes squared per meter squared Coulomb meters Ampere meters squared

Magnetic field intensity as N/A a function of time Electric dipole in 3D Magnetic dipole in 3D N/A N/A

2003 - 2012 Lumerical Solutions, Inc

38

Reference Guide p m f= /2 E( ) |E( )|2 Electric field in 2D Magnetic dipole in 2D Frequency N/A N/A N/A Cm/m Am2/m Hz V/m (V/m)2 Coulomb meters per meter Ampere meters squared per meter Hertz Volts per meter Volts squared per meter squared Amperes per meter

Electric field as a function cwnorm of angular frequency Electric field intensity as a function of angular frequency Magnetic field as a function of angular frequency cwnorm

H( )

cwnorm

A/m

|H( )|2

Magnetic field intensity as cwnorm a function of angular frequency Poynting vector as a function of angular frequency Power as a function of angular frequency cwnorm

(A/m)2

Amperes squared per meter squared Watts per meter squared Watts Watts per meter Volts per meter per Hertz Volts squared per meter squared per Hertz squared Amperes per meter per Hertz Amperes squared per meter squared per Hertz squared Watts per meter squared per Hertz

P( )

W/m2

Power( ) Power( ) E( ) |E( )|2

cwnorm

W W/m V/m/Hz (V/m/Hz)2

2D Power as a function of cwnorm angular frequency Electric field as a function nonorm of angular frequency Electric field intensity as a function of angular frequency Magnetic field as a function of angular frequency nonorm

H( )

nonorm

A/m/Hz

|H( )|2

Magnetic field intensity as nonorm a function of angular frequency Poynting vector as a function of angular nonorm

(A/m/Hz)2

P( )

W/m2/Hz 2

2003 - 2012 Lumerical Solutions, Inc

Units and normalization frequency Power( ) Power( ) Power as a function of angular frequency nonorm W/Hz 2 W/Hz 2/m squared Watts per Hertz squared Watts per Hertz squared per meter

39

2D Power as a function of nonorm angular frequency

3.1.1 Frequency domain normalization


The frequency power and frequency profile monitors record the electric and magnetic fields at a series of user-defined frequencies. These can be returned in either the Continuous Wave Normalization state (cwnorm ), or the No Normalization state (nonorm ). For most applications, the default cwnorm state is the best choice. In the nonorm state, the returned fields are simply the Fourier transform of the simulated time domain fields, and we use the subscript sim to refer to these fields in the table below. In the cwnorm state, the fields are normalized by the Fourier transform of the source pulse, thereby yielding the impulse response of the system, and we use a subscript imp to refer to these fields in the table below. Quantity Esim (w) Hsim (w) Psim (w) Eimp(w) Definition Normalization state

Esim ( ) H sim ( )

exp i t E (t )dt exp i t H (t )dt


* Esim ( ) H sim ( )

nonorm nonorm nonorm cwnorm

Psim ( )

Eimp ( )

1 exp i t E (t )dt s( ) 1 exp i t H (t )dt s( )


* Eimp ( ) H imp ( )

Esim ( ) s( ) H sim ( ) s( )

Himp(w)

cwnorm

H imp ( )

Pimp(w)

Pimp ( )

* Esim ( ) H sim ( ) 2 | s( ) |

cwnorm

2003 - 2012 Lumerical Solutions, Inc

40

Reference Guide s(w)

s( )

1 N

exp i t s j (t )dt
sources
th

N/A , where s j(t) is the

source time signal of the j source and N is the number of active sources in the simulation volume Understanding Continuous Wave Normalization (cwnorm) Impulse response FDTD is a time domain method, ie. the electromagnetic fields are calculated as a function of time. Here, the system being simulated is excited by a dipole, beam, mode or imported source, and the time signal of the source, s(t), is a pulse. For example, this could be

s (t ) sin

(t t0 ) exp

(t t0 ) 2 2( t ) 2

and the Fourier transform of s(t) is s(w)

s( )

exp i t s (t )dt

Ideally, s(t) would be a dirac delta function (in which case s(w) = 1). This would allow us to obtain the response of the system at all frequencies from a single simulation. For a variety of reasons, it is more efficient and numerically accurate to excite the system with a short pulse such that the spectrum, |s(w)|2, has a reasonably large value over all frequencies of interest. In the nonorm state, power and profile monitors return the response of the system to the simulated input pulse s(t):

Esim ( )

exp i t E (t )dt

The simulated electric field as a function of angular frequency, Esim (w), depends on both the source pulse used, s(t), and the system under study. In the default cwnorm state, power and profile monitors return the impulse response of the system.

Eimp ( )

Esim ( ) s( )

The impulse response of the system is a much more useful quantity because it is completely independent of the source pulse used to excite the system. Example

2003 - 2012 Lumerical Solutions, Inc

Units and normalization Consider a beam source injected into free space at z=z 0. The source signal is

41

s (t ) sin

t0 ) exp 0 (t

(t t0 ) 2 2( t ) 2

The electric field at the source injection plane has the following form:

E ( x, y , z 0 , t )

E0 ( x, y, z0 ) s (t )

In the cwnorm state,

E ( x, y , z , )

E 0 ( x, y , z )

In other words, the field returned in the cwnorm state is the field that would exist if a CW source of amplitude E0 had been used at the angular frequency . It removes any frequency dependence due to the finite pulse length of the source, and the units of the returned fields are the same as time domain fields.

3.1.2 Spectral averaging


For some simulations, it is useful to calculate the incoherent spectral average of the electromagnetic fields or the Poynting vector. For example, we might want to calculate

W ( ) Pimp ( )d

where W( ) is a weighting function and Pimp( ) is the Poynting vector returned in the cwnorm state, in other words, the impulse response of the system. (Please see Frequency domain normalization 39 for an explanation of the impulse response.) We could calculate the Pimp( ) at many different angular frequencies and then perform the spectral average after the simulation. FDTD Solutions, however, allows for two methods of more efficient spectral averaging during the simulation which can significantly reduce the memory requirements and increase the speed of the simulation. These methods are called "total spectral averaging" and "partial spectral averaging". The frequency power and frequency profile monitors can record spectral averages of various quantities during the simulation. Like the other quantities calculated by these monitors, these can be returned in the Continuous Wave Normalization state (cwnorm ), or the No Normalization state (nonorm ). For most applications, the default cwnorm state is the best choice. In the tables below, we use the subscripts sim and imp to refer to the quantities returned in the nonorm and cwnorm states respectively. Please refer to Frequency domain normalization 39 for more details on the two normalization states, and obtaining the impulse response of the system. Total spectral averaging FDTD Solutions/Propagator supports a spectral average that uses the source input

2003 - 2012 Lumerical Solutions, Inc

42

Reference Guide spectrum as the weighting function. Total spectral averaging can be useful when the source spectrum of the simulation matches the actual illumination conditions. The following table gives the precise definitions of the quantities available using total spectral averaging. Quantity <|Esim |2> total Definition Normalization state

Esim

2 total 0

Esim ( ) d
nonorm

nonorm

<|Hsim |2> total

H sim

2 total 0

H sim ( ) d
nonorm

<Psim > total

Psim

total

Psim ( )d
0

<|Eimp|2> total

Eimp

2 total

s ( ) Eimp ( ) d
0

cwnorm

s( ) d
0

<|Himp|2> total

H imp

2 total

s ( ) H imp ( ) d
0

cwnorm

s( ) d
0

<Pimp> total

s ( ) Pimp ( )d Pimp
0 total 0

cwnorm

s( ) d

2003 - 2012 Lumerical Solutions, Inc

Units and normalization s(w)

43

s( )

1 exp i t s j (t )dt N sources

N/A , where s j(t) is the

source time signal of the jth source and N is the number of active sources in the simulation volume Total spectral averaging can be turned on by selecting total spectral average as shown in the screenshot below.

To see the data available in a monitor, use the script command ?getdata 349 ("monitorname"); All data can be obtained in scripting, with commands such as getdata 349 and transmission_avg 322 . The available components for total spectral averaging are shown in the following table. Quantity <|Ex sim |2> total <|Ey sim |2> total <|Ez sim |2> total <|Hx sim |2> total <|Hy sim )|2> total <|Hz sim )|2> total Data name E2x_avg E2y_avg E2z_avg H2x_avg H2y_avg H2z_avg Example script command nonorm; E2x = getdata("monitor1","E2x_avg"); nonorm; E2y = getdata("monitor1","E2y_avg"); nonorm; E2z = getdata("monitor1","E2z_avg"); nonorm; H2x = getdata("monitor1","H2x_avg"); nonorm; H2y = getdata("monitor1","H2y_avg"); nonorm; H2z = getdata("monitor1","H2z_avg");

2003 - 2012 Lumerical Solutions, Inc

44

Reference Guide <Px sim > total <Py sim > total <Pz sim > total <|Ex imp|2> total <|Ey imp|2> total <|Ez imp|2> total <|Hx imp|2> total <|Hy imp|2> total <|Hz imp|2> total <Px imp> total <Py imp> total <Pz imp> total Px_avg Py_avg Pz_avg E2x_avg E2y_avg E2z_avg H2x_avg H2y_avg H2z_avg Px_avg Py_avg Pz_avg nonorm; Px = getdata("monitor1","Px_avg"); nonorm; Py = getdata("monitor1","Py_avg"); nonorm; Pz = getdata("monitor1","Pz_avg"); cwnorm; E2x = getdata("monitor1","E2x_avg"); cwnorm; E2y = getdata("monitor1","E2y_avg"); cwnorm; E2z = getdata("monitor1","E2z_avg"); cwnorm; H2x = getdata("monitor1","H2x_avg"); cwnorm; H2y = getdata("monitor1","H2y_avg"); cwnorm; H2z = getdata("monitor1","H2z_avg"); cwnorm; Px = getdata("monitor1","Px_avg"); cwnorm; Py = getdata("monitor1","Py_avg"); cwnorm; Pz = getdata("monitor1","Pz_avg");

Partial spectral averaging FDTD Solutions/Propagator supports a spectral average that uses a Lorentzian weighting function multiplied by the source spectrum. Partial spectral averaging is useful to extract the average response of the system to a variety of different illumination conditions from a single simulation. The following table gives the precise definitions of the quantities available using partial spectral averaging. Quantity Definition Normalization state

2003 - 2012 Lumerical Solutions, Inc

Units and normalization <|Esim (w)|2>


partial

45

Esim ( )

2 partial

h( , ' ) Esim ( ' ) d '


2

nonorm

<|Hsim (w)|2>
partial

H sim ( )
2

2 partial

h( , ' ) H sim ( ' ) d '


nonorm

nonorm

<Psim (w)> partial

Psim ( )

h( , ' ) Psim ( ' )d '


partial

<|Eimp(w)|2>
partial

Eimp ( )

2 partial

h( , ' ) s ( ' ) Eimp ( ' ) d ' h( , ' ) s ( ' ) d '


cwnorm
2 2

cwnorm

<|Himp(w)|2>
partial

H imp ( )

2 partial

h( , ' ) s ( ' ) H imp ( ' ) d ' h( , ' ) s ( ' ) d '


cwnorm
2 2

<Pimp(w)> partial

h( , ' ) s ( ' ) Pimp ( ' )d ' Pimp ( )


partial

h( , ' ) s ( ' ) d '


|h(w,w')|2 N/A

hi ( , ' )
2

' )2 (

)2

h( , ' ) d ' 1
s(w)

s( )

1 exp i t s j (t )dt N sources


th

N/A , where s j(t) is

the source time signal of the j source and N is the

2003 - 2012 Lumerical Solutions, Inc

46

Reference Guide number of active sources in the simulation volume

Partial spectral averaging can be turned on by selecting partial spectral average as shown in the screenshot below.

The FWHM of |h(f,f')|2 is called , and can be modified as shown below.

Please note that when considered as a function of angular frequency, the FWHM of |h(w, w')|2 is 2 rad/seconds To see the data available in a monitor, use the script command ?getdata 349 ("monitorname"); All data can be obtained in scripting, with commands such as getdata 349 and transmission_pavg 323 . The available components for total spectral averaging are shown in the following table. Quantity <|Ex sim (w)|2>
partial

Data name E2x_pavg E2y_pavg E2z_pavg

Example script command nonorm; E2x = getdata("monitor1","E2x_pavg"); nonorm; E2y = getdata("monitor1","E2y_pavg"); nonorm; E2z = getdata("monitor1","E2z_pavg");

<|Ey sim (w)|2>


partial

<|Ez sim (w)|2>


partial

2003 - 2012 Lumerical Solutions, Inc

Units and normalization <|Hx sim (w)|2>


partial

47

H2x_pavg H2y_pavg H2z_pavg Px_pavg Py_pavg Pz_pavg E2x_pavg E2y_pavg E2z_pavg H2x_pavg H2y_pavg H2z_pavg Px_pavg Py_pavg Pz_pavg

nonorm; H2x = getdata("monitor1","H2x_pavg"); nonorm; H2y = getdata("monitor1","H2y_pavg"); nonorm; H2z = getdata("monitor1","H2z_pavg"); nonorm; Px = getdata("monitor1","Px_pavg"); nonorm; Py = getdata("monitor1","Py_pavg"); nonorm; Pz = getdata("monitor1","Pz_pavg"); cwnorm; E2x = getdata("monitor1","E2x_pavg"); cwnorm; E2y = getdata("monitor1","E2y_pavg"); cwnorm; E2z = getdata("monitor1","E2z_pavg"); cwnorm; H2x = getdata("monitor1","H2x_pavg"); cwnorm; H2y = getdata("monitor1","H2y_pavg"); cwnorm; H2z = getdata("monitor1","H2z_pavg"); cwnorm; Px = getdata("monitor1","Px_pavg"); cwnorm; Py = getdata("monitor1","Py_pavg"); cwnorm; Pz = getdata("monitor1","Pz_pavg");

<|Hy sim (w)|2>


partial

<|Hz sim (w)|2>


partial

<Px sim (w)> partial <Py sim (w)> partial <Pz sim (w)> partial <|Ex imp(w)|2>
partial

<|Ey imp(w)|2>
partial

<|Ez imp(w)|2>
partial

<|Hx imp(w)|2>
partial

<|Hy imp(w)|2>
partial

<|Hz imp(w)|2>
partial

<Px imp(w)> partial <Py imp(w)> partial <Pz imp(w)> partial

2003 - 2012 Lumerical Solutions, Inc

48

Reference Guide

3.1.3 Source amplitudes


Dipole sources For dipole sources, amplitude refers to the amplitude of the point source whose units are listed below. Base amplitude refers to the amplitude that will generate a radiated CW power of 10 nW/m in 2D simulations and 1 fW in 3D simulations, and total amplitude refers to the amplitude actually used in the simulations which is the product of the amplitude and the base amplitude. Dipole source amplitudes are Cm for 3D electric dipole sources Am2 for 3D magnetic dipole sources Cm/m for 2D electric dipole sources Am2/m for 2D magnetic dipole sources Other sources When specifying the amplitude for non-dipole sources, the "amplitude" refers to the peak electric field amplitude in units of V/m. For example, if a Gaussian beam has the following electric field distribution in time and space:

E ( x, y , z , t )

E 0 sin

t 0 ) exp 0 (t

(t t 0 ) 2 exp 2( t ) 2

(x2
2 w0

y2)

Then the "amplitude" refers to the value of E0 and has units of V/m.

3.2

Frequency domain solvers


Unless specified explicitly in a GUI window, SI Units are used at all times. Unlike time domain solvers 37 , no sources are used in frequency domain solvers (ex. MODE Solutions' Eigenmode Solver and FDTD Solutions' Integrated MODE Solver). The fields are normalized such that the maximum electric field intensity is 1.

3.3

Calculating and normalizing power in the frequency domain


The complex Poynting vector

E( ) H ( )

can be used to calculate the power flow in a particular direction; the user can also calculate this quantity from the frequency-dependent fields of frequency monitors. The time-averaged power flowing across a surface is given by

2003 - 2012 Lumerical Solutions, Inc

Units and normalization

49

power ( )

1 real ( P) dS 2S

Note that the propagating power is proportional to the real part of the Poynting vector only 1, which is related to the conservation of energy for the time-averaged quantities. The factor of 1/2 is related to the time averaging of the CW fields. The imaginary part of the Poynting vector relates to the non-propagating reactive or stored energy, such as one might find in the evanescent tail of light being reflected by total internal reflection (TIR). As an example, if one simulates a y-propagating source such as a Gaussian bream striking a circular rod in a 2D TM time-domain simulation, then by placing a frequency power or profile monitor on the opposite side of the rod, the normalized transmission, T, as a function of frequency can be calculated with:

T( )

1 real PyMonitor ( ) dx 2 1 real PySource ( ) dx 2

FDTD Solutions/Propagator provide many GUI and scripting functions to make transmission calculations easily at the press of a button or using a single command. The transmission script command will perform this particular calculation.

1 J. D. Jackson, "Classical Electrodynamics, Second Edition", John Wiley & Sons, 1975.

3.4

Integrating over lines, surfaces and volumes


The electric and magnetic fields are recorded on the finite-difference mesh, as shown below for a 2D monitor, where the grey dots represent the positions where the fields are recorded. The thick black outline shows the limits of the surface monitor as seen in the Layout Editor. This monitor has an x-span of 12dx and a y-span of 5dy. This monitor records a total of 13x6 data points.

2003 - 2012 Lumerical Solutions, Inc

50

Reference Guide

A typical calculation with this monitor might be to integrate the total power flow across the surface of the monitor, or

Power ( )

1 real P ( ) dS 2

In order to calculate this quantity, we provide the scripting function integrate. If Pz is a variable of dimension 13x6x1, and x and y are the corresponding position vectors, then the desired quantity is: power = 0.5*integrate(real(Pz),1:2,x,y); The integrate script command can be used to integrate over spatial dimensions even when several frequency points have been recorded. For example, if Pz is a variable of dimension 13x6x1x10, representing 10 frequency points, then the following can be used to integrate over y (ie dimension 2) and then x (ie dimension 1) power = 0.5*integrate(real(Pz),1:2,x,y); power will be a matrix of dimension 10x1.

2003 - 2012 Lumerical Solutions, Inc

CAD layout editor

51

CAD layout editor


The image below shows a typical Lumerical CAD Layout Editor. This tool is used to setup and analyze all simulations, and to run all script files. In this screenshot, different regions of the CAD in Layout mode are highlighted. They include: Main title bar 52 Toolbars 52 View ports 60 Object Tree 60 Optimization and Sweeps 63 Script Prompt 63

The Layout Editor has two modes of operation: Layout mode and Analysis mode. Layout mode is used to setup your simulation. Simulation objects can be added, modified and deleted in this mode. After a simulation runs, the Layout Editor automatically switches to Analysis mode. In analysis mode, it is not possible to edit the simulation objects, since we want the object settings to match the data from the simulation. To edit simulation objects, switch back to layout mode with the button.

FDTD Solutions 8.0 features a new Results View 62 window, which shows all the current results for the simulation object that is currently selected in the Object Tree. When used in conjunction with the Visualizer 139 , it provides a very useful and intuitive way of analyzing and visualizing results through the GUI.

2003 - 2012 Lumerical Solutions, Inc

52

Reference Guide

4.1

Main title bar


The menus on the main title bar are listed below. If any of the options can be selected using a button on a toolbar, the icon is drawn to the left of the name. Similarly, shortcut keys are located to the right. File The file menu includes options to create, save and load simulation files. The Import menu allows users to import structural data stored in GDSII files 77 files. Edit The edit menu allows users to undo/redo their actions, and to copy/paste/edit object in the simulation. View The view menu provides options to control the layout and visibility windows and toolbars. Setting This setting menu contains options to change the unit setting within the graphical interface. These option only apply to the GUI. Scripts always use SI units. Simulation This menu contains settings for configuring resources and running simulations. Help The help menu provides links to local PDF copies of the product documentation and links to the larger set of online documentation, as well as options for checking which version of the software is installed.

4.2

Toolbars
The following sections describe the various toolbars. Toolbars visibility can be controlled in the View - Toolbars menu.

4.2.1 Main
The main toolbar contains buttons to add various Simulation objects, open the Material database 116 and import files, as described below. When available, clicking the arrow to the right of the icon expands a drop-down menu containing related buttons. If one of the related buttons is pressed, it replaces the default button in the toolbar. See the Simulation objects chapter for information about specific objects.

Material Database

2003 - 2012 Lumerical Solutions, Inc

CAD layout editor This button opens material database window. For more information, see the Material database 116 chapter.

53

Structures This button will insert the shown structure primitive into the simulation. Pressing the arrow will show all available primitives.

Attributes This button will insert the shown grid attribute into the simulation. Pressing the arrow will show all available primitives.

Components This button will open the component object library window. Pressing the arrow will show common component categories that the library window can open with.

Groups This button will add an analysis, container or structure group into the simulation. Pressing the arrow will allow selection of which group to add.

Simulation This button will insert simulation or mesh override regions. Pressing the arrow will allow selection of which simulation object to add.

Sources This button will insert different sources into the simulation. Pressing the arrow will allow selection of which source to add.

Monitors This button will insert various monitors into the simulation. Pressing the arrow will allow

2003 - 2012 Lumerical Solutions, Inc

54

Reference Guide selection of which monitor to add.

Analysis This button will open the component object library window. Pressing the arrow will show common analysis categories that the library window can open with.

Import This button will open a window for importing files from other programs. Pressing the arrow will allow selection of which kind of import.

4.2.2 Edit
The edit toolbar contains tools used to copy, delete, or modify settings of simulation objects.. When applicable, the shortcut key used to run the function from the keyboard is given in brackets next to the name of the tool. An object must be selected in order to use these tools.

Edit properties (E) This command opens the edit properties window. See the Simulation objects chapter for information about specific properties for each object. Tip: Group edit of multiple objects The properties of multiple structure objects can be edited together by selecting multiple objects prior to entering edit mode. This option is only available for structure objects, not sources or monitors. Any properties which are identical between all of the selected objects results in the common value being displayed in the edit dialog box.

Duplicate (D) This command makes a duplicate of the currently selected object. The copies that are created are identical to the originals, apart from a one grid cell offset in their x position which allows the user to distinguish between the original and the copy. When multiple objects are selected, all of the selected objects will be copied. When copying sources and monitors, it is important to rename the copies so that each object has a unique name.

Move

2003 - 2012 Lumerical Solutions, Inc

CAD layout editor The move command allows shifting a single or multiple selected objects by a specified distance in each of the x,y,z dimensions. A pop-up window appears with field entries to specify the shift amount.

55

Array The array command allows the user to create an array or arrays of objects. The array edit window that pops up contains several properties : A1 LATTICE: the distance between adjacent elements in the a1 direction A2 LATTICE: the distance between adjacent elements in the a2 direction ANGLE BETWEEN A1 AND X-AXIS: the angle (in degrees) between the a1 direction and the x-axis ANGLE BETWEEN A1 AND A2: the angle (in degrees) between the a1 and the a2 directions. COLUMNS, ROWS: the number of rows and columns that comprise the array. AZ LATTICE: the distance between adjacent elements in the z direction (valid for 3D simulations only) LAYERS: the number of elements in the z direction (valid for 3D simulations only) The parameters in the edit window below produce the resulting array shown in the diagram.

Delete (Del) The delete command removes the currently selected object, or objects, from the simulation.

4.2.3 Mouse mode


The mouse mode allows you to control the behavior of the mouse. Depending on the mode, the user can edit objects, pan or zoom in the view ports or measure the distance from one point to another. When applicable, the shortcut key used to run the function from the keyboard is given in brackets next to the name of the tool. Only one mouse mode may

2003 - 2012 Lumerical Solutions, Inc

56

Reference Guide be selected at a time.

Select (S) This function puts the mouse into the select mode. This allows objects to be selected through the view ports (objects may be selected in the objects tree regardless of whether the mouse is in select mode or not). For reference, the current location of the mouse within the view ports is shown in the field at the bottom right-hand corner of the CAD window (see the image below). The < and > buttons at the right decrease or increase the number of decimal places shown.

Zoom (Z) This function sets the mouse to be in the zoom mode. The default aspect ratio of the XY view and perspective views are locked at 1:1, which means circles always appear round (rather than as ovals). The aspect ratio for the XZ and YZ is not locked. Use the left click to zoom in and the right click to zoom out. To zoom to a particular area, drag diagonally across the desired region. Finally, double clicking either button zooms to extent. To adjust the view, it's easiest to set the XY view first, then adjust the Z view in the XZ or YZ views.

Pan view (P) The pan view mode allows the user to drag the view in the plane of the view port. In the Perspective window, the pan mode is used to rotate the view. Scrolling in the view ports The other method of adjusting the view ports is by using the arrow buttons on your keyboard. Each press of a button results in the view shifting in the direction indicated by the arrow.

Ruler (R) Once the ruler mode is selected, a distance measurement can be made by pressing the left mouse button and then dragging the mouse. A non-permanent triangle is drawn between the locations where the mouse button was pressed (A) and released (B). The distances are given in the lower left-hand corner of the CAD window (see the image below). The dx and dy fields correspond to the horizontal and vertical distance between A and B, and the AB field corresponds to the length of the hypotenuse.

2003 - 2012 Lumerical Solutions, Inc

CAD layout editor

57

4.2.4 View
The view toolbar contains tools to zoom to the extents of objects, edit grid settings and view the mesh used for the simulation. When applicable, the shortcut key used to run the function from the keyboard is given in brackets next to the name of the tool.

Zoom Extent (X) Selecting this tool centers and scales the view ports around the selected simulation objects. For instance, pressing zoom extent while a structure is selected arranges the view such that only the structure are shown, while other simulation objects may appear outside the extent of the view. When no objects are selected, pressing this button zooms to the the largest object in the model. This function is also accessed via double-clicking either the left- or right-hand mouse button while in zoom mode.

Drawing Grid Clicking on the drawing grid brings up a window in which the following options can be edited: SHOW GRID: when checked, the grid will be plotted in the drawing palette SNAP TO GRID: when checked, objects can only be moved so that their centers align with intersection points of the grid A1 LATTICE: the distance between grid lines in the a1 direction A2 LATTICE: the distance between grid lines in the a2 direction AZ LATTICED: the distance between grid lines in the z direction ANGLE BETWEEN A1 AND X-AXIS: the angle (in degrees) between the a1 direction and the x-axis ANGLE BETWEEN A1 AND A2: the angle (in degrees) between the a1 and the a2 directions

View simulation mesh Selecting the "View simulation mesh" button will show the simulation mesh. For visibility of other objects, it is usually turned off. Because recalculating the mesh is somewhat computationally intensive, it is not continuously updated. For example, the mesh will not update immediately if a physical structure is moved. To have FDTD Solutions recalculate the mesh, click the "Recalculate simulation mesh button", located next to the "View simulation mesh" button. The mesh is always recalculated before a simulation starts.

Recalculate simulation mesh (F5)

2003 - 2012 Lumerical Solutions, Inc

58

Reference Guide Mesh generation is too computationally intensive to be done constantly as the simulation setup is modified. If you wish to see the current mesh, use this option to update and recalculate the mesh. The mesh is always recalculated before running a simulation.

4.2.5 Simulation
The simulation tools are:

Resources Opens the resource configuration manager. This window can add/remove and enable/ disable computational resources. It also contains a useful configuration test tool to check the resource setup.

Check memory requirements This function will estimate the memory requirements for the current simulation. The total requirements are broken down into categories such as Simulation fields and Monitor data.

Material Explorer The Materials Explorer can be used to check the material's optical properties that will be used in a simulation. For more information, please see the section on Material Explorer 125 .

Run parallel FDTD Run the current simulation in parallel mode. For more information on how to run simulation, see Running a simulation.

Run FDTD Run the current simulation in single process mode. Run scripts This function will allow the user to run a Lumerical script file (*.lsf) to perform automated commands such as plotting and saving data. This button is located in the CAD environment twice if the script editor is open: once in the simulation toolbar and once at the top of the script editor. Pressing the button on the toolbar brings up an open file dialog. Pressing the button in the script editor runs the script that is selected in the editor window.

Switch to layout editor

2003 - 2012 Lumerical Solutions, Inc

CAD layout editor This function returns the simulation environment from analysis mode back to the layout editor mode. If you switch to layout editor and then save the file, the data from the simulation will be overwritten and lost.

59

4.2.6 Alignment
The alignment toolbar provides options to control the relative alignment of simulation objects.

Alignment toolbar To use the alignment functions, first select a reference object (the rectangle in the screenshot below). The first button on the toolbar is used to select the reference object. Next, select another object and use one of the alignment options to align the second object with respect to the first. In the following screenshot, the top edge of the circular objects were aligned with the top edge of the rectangle.

4.2.7 Search bar


The search toolbar can be used to quickly search for topics in the online product documentation knowledge base. This will bring up the search results in a new tab in your default browser.

Online help toolbar Search the online knowledge base for the specified term. Requires internet connection. If an internet connection is not available, some product documentation is available in the Help - Reference Guide menu.

2003 - 2012 Lumerical Solutions, Inc

60

Reference Guide

4.3

View ports
The view ports show a graphical representation of the simulation from an XY, XZ, YZ and 3D perspective view. Depending on the current mouse mode, the mouse pointer will either have the shape of an arrow (select), a hand (pan), a magnifying glass (zoom) or a ruler (measurement). You can toggle between these options with the mouse mode toolbar. When objects are selected, the vertices are drawn with red squares (also, the object will be highlighted in the Object tree. It is possible to copy and paste selected objects between different CAD windows using the standard Ctrl+C and Ctrl+V shortcut keys.

4.4

Object Tree
As previously discussed, a simulation requires that the user define a set of objects, simulation region, sources and monitors. As a complete setup may contain a large number of objects, the object tree was designed to allow for organization and easy selection. All simulation objects are within the group, model, which represents the current simulation. Within 'model', objects are listed as they are inserted by the user. Press F2 or double-click to change the name.

2003 - 2012 Lumerical Solutions, Inc

CAD layout editor

61

To move the objects up and down the tree as well as into groups, we use the orange arrows at the top of the window. The up and down arrows shift the objects relative to each other, while the left and right arrows move them out of and into groups. To add groups, we use the button called groups in the main toolbar. Structure groups can only contain structures and likewise, analysis groups can only contain monitors. See the online user guide section for more information and examples about Structure groups and Analysis groups. The third group, "Containers" act like folders and can hold any type of object. In the image above, the 'Sources/Monitors' container group has both individual sources and monitors as well as an analysis group. Note that there are buttons with green crosses at the top of the objects tree. These buttons can be used to hide or display certain types of objects. When objects are selected, they are highlighted blue in the objects tree and the vertices are marked with red squares in the view ports. Objects can always be selected by left-clicking on their name in the object tree or edited by right-clicking. Using the tree is the preferred method of selection especially in complicated simulation setups with many overlapping elements. In the image above, the power monitor, above, is selected.

4.4.1 Enable/Disable Simulation Object


User can enable/disable simulation objects by right-clicking on each and selecting "Enable/Disable". Disabled simulation objects will remain in the object tree (and can be re-enabled), they will have no effect on the simulation.

2003 - 2012 Lumerical Solutions, Inc

62

Reference Guide

4.5

Object Library
The object tree and the object library windows help organize and find simulation objects. The object library provides additional simulation objects that can be used in your simulations. The center portion of the window shows the available objects in a tree format. When selected by the mouse, a larger image of the object is displayed at the bottom along with its object tree ID name and a more detailed description. To insert an object into the simulation, simply double-click the object and click the insert button at the bottom of the window. The object library can be opened to specific categories by choosing any option in the components or analysis button in the main toolbar. For users who are not connected to the Internet, the library will switch to Offline mode, which accesses a reduced version of library included with the local installation.At the bottom-right of the window, it will indicate whether you are using the local copy of the library (Offline) or viewing the online version (Online).

CATEGORY: Choose to only display components of a certain category (e.g. extruded polygon, photonic crystals) TYPE: Choose to display the type of simulation object (e.g. structures, analysis groups) KEYWORDS: The object window will only show objects that match your keyword (e.g. hemisphere, waveguide) RESET: Sets the category to display 'all' and deletes any text in the keywords text box SEARCH: Activates the search for objects that match the keywords (the same function as pressing enter while in the text box) INSERT: Pastes the object into the simulation region centered at the current view port settings (same function as double-clicking the object)

4.6

Results View
See the Results View 143 section of the Reference Guide for more information.

2003 - 2012 Lumerical Solutions, Inc

CAD layout editor

63

4.7

Optimization and Sweeps


See the Optimization and parameter sweeps 146 section of the Reference Guide for more information.

4.8

Script Prompt and Script Editor


The scripting language is useful for setting up complex structures and advanced data analysis. See the Scripting chapter for a list of all the script commands, as well as examples on how to use them. By default the script editor is located on the right hand side of the view ports and shares the same frame as the analysis window. When both windows are open, it is possible to toggle between the two through tabs located at the right side of the frame. The script file editor contains buttons to create, open, save and run script files. When multiple script files are open, pressing on the run script button runs the one in the forefront. Note that when entering scripting code in the script file editor, each command must be followed with a semicolon. When running a script file in the a different directory using the GUI, the current working directory is unchanged, but the directory of the script file is added to the scripting path. This way, any files called by that script will be found. However, the search order is the current directory first, then any other folders in the path, and then the directory of the script file. By default the script prompt is located at the bottom of the CAD window. Script commands are executed as soon as the ENTER button is pressed on the command line. If a semicolon is missing at the end of the command line, it is automatically inserted it for you. Multiple lines can be pasted into the script prompt, and will run as in the script editor. In this case though, only the last semicolon can be neglected.

4.9

Script Workspace and Script Favorites


See the Script Workspace and Script Favorites 144 section of the Reference Guide for more information.

2003 - 2012 Lumerical Solutions, Inc

64

Reference Guide

4.10 Changing the CAD layout


There are pre-defined CAD layouts that can be accessed through main title toolbar. Change between the default layouts by selecting the drop-down menu VIEW->SET DEFAULT LAYOUT, and choosing one of them. In addition, have control over hiding and docking location of the the windows and toolbars. The current layout is saved when CAD closes so the next time the program is opened, your previous layout will be used. Hiding/showing windows and toolbars There are two methods to hide or show windows and toolbars 1) In the main title toolbar select VIEW->WINDOWS or VIEW>TOOLBARS. The visible windows/ toolbars have a check mark next to their name; the hidden ones do not. 2) By clicking the right button anywhere on the main title bar or the toolbar, the following pop up menu will show up. As before, check marks indicate when windows and toolbars are visible.

2003 - 2012 Lumerical Solutions, Inc

CAD layout editor Moving and undocking windows Windows can be undocked by double clicking the name with the left mouse button. This is particularly useful when you want to make the script file editor window larger. Non-view-port windows can be docked on top of each other either to the right or to the left of the view ports. If they are placed on top of each other, tabs on the sides allow toggling between them. Tip: To reposition an undock ed window on Linux, hold down the Alt k ey before attempting to move the window. Moving toolbars To move a toolbar, hover the mouse over the top of the toolbar, where the dotted line is. When the mouse cursor becomes a four-headed arrow, press the left mouse button and drag-and-drop the toolbar. If you reach a region where you can place a toolbar, the CAD environment makes room for the toolbar indicated by a blue void.

65

4.11 Converting from 2D to 3D


FDTD Solutions 8.0 and MODE Solutions 5.0 support 3D objects in the CAD. When a simulation type is selected, the corresponding simulation region will cut along the appropriate 1D/2D section of the 3D structures to generate the correct mesh. Mesh override regions are now always specified in 3D, and the simulation region will adjust to the mesh accordingly whenever there is an overlap with override regions. Converting form old 2D files to 3D One can open existing 2D files from previous versions with FDTD Solutions 8.0 and MODE Solutions 5.0. 3D structures will be automatically created by extruding the 2D structures in the z direction. Note that for certain structures, the 2D to 3D conversion is more complicated since these structures do not have a straightforward 3D counterpart. The following lists some special cases: Surface objects The orientation as well as the polynomial coefficient matrix will be updated so that the slice at the default z location is identical to the surface in the original file. Note that the resultant 3D surface is not a perfect extrusion (ie. one can see shadows along the curvature on the outer edges), since such objects cannot be created form a 3D

2003 - 2012 Lumerical Solutions, Inc

66

Reference Guide surface. Structure groups A new property z_span is added in the User properties section with the default setting of 1 unit length. Import surfaces Since import surfaces are now defined as z(x,y) instead of y(x), there will be some changes to the Geometry tab as well as an additional rotation so that the 3D object looks like an extrusion in the z direction. The default option sets the z location at 0 and the z span as 1 unit length. The simulation region will be placed at the center of the object in the z direction and the resultant meshed structure (in the simulation region) will be identical to the original 2D file. New simulation objects are created based on the default values set in Setting->Set default object placement. Note that since 3D objects require more memory to render, it is important not to use too high of a resolution for the graphical rendering, or the CAD may slow down significantly. 2D DRAW MODE One can use the 2D draw mode to enable a layout that looks very similar to that of 2D FDTD Solutions or MODE Solutions 4.0. This option can be selected from View->Set default layout -> 2D -> XY/XZ/YZ, and all but the selected view port will be closed.

2003 - 2012 Lumerical Solutions, Inc

CAD layout editor

67

It is important to note that even though 2D draw mode allows for a 2D CAD view, the underlying simulation objects are still three dimensional, and it is important to verify (either by switching back to the default 3D view or using the Mesh structure setting) that the meshed structure in the region of interest is correct.

2003 - 2012 Lumerical Solutions, Inc

68

Reference Guide

Simulation objects
There are several types of simulation objects in FDTD Solutions, MODE Solutions' propagator, MODE Solutions' Eigenmode Solver and DEVICE. These objects are used to model the physical structure, define the solver region, any sources of light or doping/generation regions as well as monitors to collect data.

The following sections provide detailed descriptions of each simulation object. Each simulation object can be added by clicking on the corresponding icon in the GUI. For example, in the screen shot on the right, clicking on the button would add a circle physical structure object. Once the object is selected, pressing the EDIT button will bring up a window where it is possible to modify the properties of the simulation object. The corresponding window for the circle object is shown below.

TIP: In-field equation interpreter The fields for numeric parameters can be used as a simple calculator. For instance, if you

2003 - 2012 Lumerical Solutions, Inc

Simulation objects wish to set a value to the square root of 3 divided by e, just enter sqrt(3)/exp(1) into the field. For more information, see the Equation interpreter 114 section. Notes: Structure objects support Multi-object editing. If you select multiple objects then click EDIT, you can edit properties that are common to all of the selected objects. Monitors and sources have some global properties that apply to many objects. For example, the global source frequency range can be applied to all sources. The global properties can be edited with the GLOBAL PROPERTIES button.

69

Groups Simulation objects can be organized into various types of groupings.

Container Group A container group is the simplest type and can contain all object types as well as other groups. This object acts like a simple folder allowing the user to collapse and expand its contents in the object tree. Its only user setting is a position offset in x,y,z for all contained objects.

Structure Group Structure groups are one step above container groups in that they allow scripting commands of structures properties. This group contains user-generated variables and scripts that can be utilized to edit and set up parts of the structure. For example, a script can be set up to insert many circles to create a photonic crystal cavity of a certain shape and size. See the Properties tab 82 and Script tab 82 sections for more information. Structure groups can contain other structure groups.

Analysis Group Analysis groups are the most advanced of the three groups. It is a two-part group: setup and analysis. In the setup portion, it acts like a structure group allowing users to insert and edit structures through a script except that it has been extended to include all objects. User can create a script that modifies a simulation region span, source locations and analysis monitor properties. In the analysis portion, it is used to process monitor data and create output data variables once a simulation has been run. It is possible for analysis groups to contain other groups. As an example, the top level object 'model' that represents the entire simulation, is an analysis group. Please see the Online User Guide section on Analysis groups for more information.

2003 - 2012 Lumerical Solutions, Inc

70

Reference Guide

The purpose of this section of the Reference Guide is to describe all of the available simulation objects and their properties. This section is organized as follows. There are five subsections. The first four subsections correspond to the four types of object categories. Each of these sections begins with a brief overview of the simulation objects followed by a description of their property settings. The properties are organized according to the tab that they are located in when the EDIT button is pressed. The last of the five subsections describes the syntax for the equation interpreter.

5.1

Structures
Structures in a simulation interact with light/electrical sources to produce interesting effects. They are split into 3 groups:

Structures (Primitives) These are the primitive shapes that make up all structure setups.

Attributes These are the additional attributes that can be associated with any structure.

Components These are preset structures and more complicated structure groups that are commonly used in a variety of research areas. Components are built using the group script and have user settable parameters. They form a collection of samples from which to build your own structure groups.

Imports These options open windows that can be used to import structure data from other sources such as pictures or text files.

2003 - 2012 Lumerical Solutions, Inc

Simulation objects

71

5.1.1 Primitives

The

button includes options to to add the following primitive structures:

Triangle Triangular objects denote physical objects that appear triangular from above. For 2D simulations, these objects represent triangles while in 3D these objects are extruded in the z direction to a specific height. They are actually polygon objects, with the number of vertices set to 3.

Rectangle Rectangular regions denote physical objects that appear rectangular from above. For 2D simulations, these objects represent rectangles while in 3D these objects are extruded to a specific height.

Polygon Polygons allow the user to define a custom object with a variable number of vertices. The location of each vertex can be independently positioned within a plane, and the vertices are connected with straight lines. For 3D simulations, the object is extruded in the z dimension.

Circle Circles denote physical objects which appear circular or ellipsoid from above. They are either circles/ellipses in 2D, or circular/ellipsoid cylinders in 3D.

Ring Ring regions represent physical objects that consist of full or partial rings when viewed from above. Rings in 3D simulations are extruded in the z direction to a specific height.

Custom Primitives Custom primitives can be used to create customized surfaces, specified via parametric equations. The resulting surfaces can either exist on one or more faces of the object, or can be used to define a cylindrically-symmetric surface of revolution.

2003 - 2012 Lumerical Solutions, Inc

72

Reference Guide

Surface Surface primitives can be used to define complex material volumes that exist above or below analytically defined surfaces. In 3D simulations, a surface (S) is defined as a function of variables u and v, i.e. S = S(u,v). The variables (u,v) can represent (x,y), (x,z) or (y,z) depending on the surface orientation. Similarly, in 2D simulations, a surface is defined as a function of u (S = S(u)) where u can represent x or y.

Sphere In 3D simulations, users can define spherical regions of constant refractive index through the spherical physical object. Spherical objects only exist in 3D simulations.

Pyramid Pyramids can be configured to half flat tops and/or flat bottoms, and either narrow or expand in the vertical z direction. Pyramids are only available for 3D simulations.

5.1.2 Attributes

The

button includes options to add the following attributes:

Permittivity rotation The permittivity rotation grid attribute allows users to add an arbitrary Euler rotation to the dielectric tensor. The main parameters are the "angle convention" and the Euler angles theta/phi/psi.

LC orientation The LC orientation grid attribute allows users to specify arbitrary orientations for the Liquid Crystal director. The main parameters are the angles theta/pi (specifying the LC orientation), and the dielectric tensor will be set accordingly.

Matrix transform The matrix transform grid attribute allows users to add an arbitrary unitary matrix to the dielectric tensor. The main parameter is the unitary matrix U. For examples on how to use the grid attributes listed above, see the Anisotropy and Magneto-Optics section of the Applications Library.

2003 - 2012 Lumerical Solutions, Inc

Simulation objects

73

5.1.3 Components

The button includes options to open the object library with a few preset categories. Components are more complicated structures that are built from one or several primitives. Common parameters are available to be adjusted. These pre-built structure groups enable users to quickly setup common (but often difficult to construct), simulation environments. The preset categories are:

Extruded polygons Polygons allow the user to define a custom object with a variable number of vertices. The location of each vertex can be independently positioned within a plane, and the vertices are connected with straight lines. These shapes are extruded in the z dimension.

Integrated optics This category includes various shapes of waveguide paths. For 3D simulations, the sidewalls can be vertical or angled.

Photonic crystals Photonic crystals are optical nanostructures that are either rectangular or hexagonal periodic. This category includes PC waveguides and PC cavities.

Gratings Gratings are a regularly spaced set of elements which can have polarizing, reflecting, or coupling effects.

Surface This category contains examples of surface objects defined by equations.

More choices There are many more categories of components available that are constantly being updated.

2003 - 2012 Lumerical Solutions, Inc

74

Reference Guide

5.1.4 Geometry tab


The geometry tab contains options to change the size and location of the structure.

5.1.5 Material tab


The material options are as follows: MATERIAL: This field can be set to any material included in the material database. It is possible to include new materials in the database, or edit the materials already included. See the material database section for more information. If <Object defined dielectric> is selected, then the index property must be set. INDEX: The refractive index of the structure, when the material type is <Object defined dielectric>. The index must be greater than one, and can be specified as an equation in terms of x, y, z(defined in the Equation interpreter 114 section). If specifying an anisotropic material, use a semicolon to separate the x,y,z indices. Eg. 1;1.5;1 INDEX UNITS: The field specifies the units of the spatial variables only when the index is specified with a formula (the origin is the center of the object). The units will affect the interpretation of l0 and k0. OVERRIDE MESH ORDER FROM MATERIAL DATABASE: Select to override the mesh order from the material database and manually set a mesh order. The mesh order is used by the simulation engine to select which material to use when two materials overlap. See the mesh order 127 section for more details. MESH ORDER: Set the mesh order in this field if the OVERRIDE MESH ORDER FROM MATERIAL DATABASE option is selected. If the option is not selected, the field displays the material's default mesh order from the database. For example, a material of mesh order 1 will take precedence over a material of mesh order 2.

5.1.6 Rotations tab


Rotate objects by setting the following variables: FIRST, SECOND, THIRD AXES: 3D simulation only. Select rotation axis. Up to three different rotations can be applied. ROTATION 1,2,3: The rotation of the object in a clockwise direction about each axis, measured in degrees. In 2D simulation, only one angle (rotated around z axis) is available.

5.1.7 Graphical Rendering tab


The graphical rendering tab is used to change how objects are drawn in the layout editor. The options are: RENDER TYPE: The options for drawing the objects are detailed or wireframe. Detailed

2003 - 2012 Lumerical Solutions, Inc

Simulation objects

75

objects are shaded and their transparency can be set using OVERRIDE COLOR OPACITY FROM MATERIAL DATABASE. DETAIL: This is a slider which takes values between 0 and 1. By default it is set to 0.5. Higher detail shows more detail, but increases the time required to draw objects. This setting has no effect on the simulation. OVERRIDE COLOR OPACITY FROM MATERIAL DATABASE: When unselected the opacity is determined from the material database. When selected, you can specify a value for ALPHA between 0 (transparent) and 1 (opaque) for the object, depending on how transparent you want the object to be.

5.1.8 Custom tab


The custom tab is only available for custom primitives. Custom primitives are objects that are defined by equations describing the boundaries of the physical object. The custom primitive defaults to a rectangular region upon creation, and is shaped via entry of one or more equations in the edit window. The custom object allows you to define the y position of the object as a function of the x position. The z position is obtained via extrusion or revolution of the y edge. (X,Y)=(0,0) corresponds to the center of the object. EQUATION 1: The equation, expressed as a function of x, which defines the upper y edge of the physical object. The origin of equation is the center of the object. Suitable syntax for the equations is shown in the Equation interpreter 114 section. MAKE NONSYMMETRIC: Uncheck this if you want to define the lower edge with a different equation. EQUATION 2: The equation, expressed as a function of x, which defines the lower edge of the physical object. EQUATION UNITS: The default units in which x and y are expressed in equation 1 and 2. For example, a setting of microns means that both x and y are expressed in microns. CREATE 3D OBJECT BY: Options include "extrusion", and "revolution". Extrusion results in an object that is extruded along the z-axis (i.e. invariant in z). The revolution object is created by revolving the equation around the x-axis, resulting in a surface of revolution. Equation 1 and 2 are bound such that they are only defined over specific regions. Equations which result in undefined values (1/0) result in a zero height; any equation left blank results in a custom primitive of zero height everywhere. Equations that go larger than the span of the object will be clipped at the edge of the object. Equations that go negative will be clipped at zero. In the following figure, notice how the equations are clipped at the edge of the object.

2003 - 2012 Lumerical Solutions, Inc

76

Reference Guide

5.1.9 Import Data tab

The

button includes options to import from a variety of formats:

GDSII This file format is commonly used to store 2-dimensional geometric data. For details, see GDSII Import 77 .

Surfaces For example, this tool is useful for importing data from an atomic force microscope (AFM). In two dimensional simulations, the data must be defined as y = f(x). In three dimensional simulations, it must be defined as z = f(x,y). Both upper and lower surfaces can be imported.

Images In either JPG or PNG format. For example, this tool is useful for importing from a scanning electron microscope (SEM) image. In three dimensions, the imported data is extruded along the z axis.

(n,k) material The REFRACTIVE INDEX (N AND K) as a function of space, for example, to represent doped material where the doping concentrations and optical loss are calculated in another software package. In two dimensions, the data is defined as n(x,y), k(x,y) and in three dimensions as n(x,y,z), k(x,y,z). Please note that the value of k is translated into a conductive (or plasma) model and is only valid at a the center frequency of the simulation. It

2003 - 2012 Lumerical Solutions, Inc

Simulation objects should therefore only be used with single frequency simulations.

77

5.1.9.1 GDSII Import

The GDSII import function allows you to import structures from a GDSII file into the layout editor. The GDSII file format is commonly used to store 2-dimensional geometric data. This data can be directly imported into a 2D layout environment, or it can be used to import 3D objects into a 3D layout environment by extruding the 2D data in the Z dimension.

Characteristics of the GDSII file


Lumerical products support most, but not all features of the GDSII file format. Unsupported features should not prevent the file from being imported, however, the results may not be as expected. The following table details the supported and unsupported features. Features General Multiple cells in GDSII library file Layer numbers for drawing objects Yes Yes Supported

Primitives/Objects Box/Rectangle Polygon Path (see note below) Node Text Symbolic cell reference Array cell reference Yes Yes Yes No No Yes Yes

Advanced Cell references in external library/file Magnifications in array and symbolic No Yes

2003 - 2012 Lumerical Solutions, Inc

78

Reference Guide references Rotations and mirroring in array and symbolic references Yes

Note: Path corners Path objects in GDSII files are piecewise linear lines plus a width and optionally some information on how to handle corners and ends. In general, GDSII files support several types of corner style options (squared, rounded, extended squared, etc). Our import function supports type 0 (squared ends flush to the end-point) and will default to type 2 (square ends with 1/2 the width added to the end-point) for all other types. Note: Flattened GDSII files While we do include scale, rotate, flip, and automatic flattening of references, not all features of GDSII are currently supported. If you run into any problems, you may have better results by flattening the file first.

GDSII Import
GDSII import is initiated by accessing the IMPORT->GDSII option from the FILE menu, or by pressing the Import GDS button located on the main toolbar. This will bring up a standard file browser, which will allow you to select a file with the extension .gds or .db. Selecting a GDSII file will bring up the Single layer GDSII Import window as shown below.

The following 3 input parameters control how the GDSII data is imported: Cell Name: This selection menu contains the valid cells available in the GDSII library. Select the cell you wish to import. Layer number: This selection menu contains all of the layer number present in the GDSII file. Only structures with the selected layer number will be imported by this operation. Material: This selection menu contains a list of the valid materials in your current simulation environment. This material will be assigned to the imported structures.

2003 - 2012 Lumerical Solutions, Inc

Simulation objects

79

Selecting the Import layer button imports all the structures with the selected layer number in the selected cell into the layout environment. These structures are automatically inserted into a structure group. The material is set as an input parameter for the structure code, and the script in the structure group sets all the objects to the desired material. The name of the structure group includes the original number of layers. For 3D simulations, the structure group contains a variable "z span". This used to set the width of the layer in the z direction. The origin of the structures, as well as their orientation, can be changed by changing the properties of the structure group.
5.1.9.2 nk material import window

Options in the (n,k) material import window include: SELECT FILE: let the user specify the data file to be imported. X0, Y0, Z0: the data origin in the global coordinates of the Graphical Layout Editor. X SPAN, Y SPAN, Z SPAN: This defines the size of volume that you are importing. These fields are inactive and help to determine that the file units have been properly chosen. FILE UNITS: Select units for the data in your file. IMPORT AS Mji INSTEAD OF Mij: 2D simulation only. It is often easy to cycle through the array indices in the wrong order when exporting the file, and this check button allows you to reverse the order easily. Typically, it is very easy to see in the figure window when you have the order incorrect. IMPORT AS Mkji INSTEAD OF Mijk: 3D simulation only. It is often easy to cycle through the array indices in the wrong order when exporting the file, and this check button allows you to reverse the order easily. Typically, it is very easy to see in the figure window when you have the order incorrect. PLOT PLANE: You can image the data in either the x-y plane, the x-z plane or the y-z plane to be sure that it is correctly imported. Use this menu chooser to switch between planes. Z (or X or Y): Depending on the PLOT PLANE chosen, you can view cross sections at any depth into the structure. Use this slider or the value input field to choose the depth of cross section. IMAGE N, IMAGE K: Choose to view n or k in the figure window. For detailed information and example text import files, as well as script files that generate the example files, see the Import object spatial (n,k) data page in the User Guide section of the Online help.

2003 - 2012 Lumerical Solutions, Inc

80

Reference Guide

5.1.9.3 Surface import window

Options in the surface import window include: SELECT FILE: let the user specify the data file to be imported. X0, Y0, Z0: the data origin in the global coordinates of the Graphical Layout Editor. X SPAN: This defines the length of surface that you are importing. If the x data was contained in the file (file format type 1), then this field is inactive. If the x data was not in the file, then this field is active and should be set to the desired data span. YSPAN: 3D simulation only. This defines the size of surface area that you are importing. INVERT X AND Y AXIS: It is often easy to invert the x and y axis when exporting the file. Selecting this checkbox means that the x and y axes are automatically reversed. UPPER SURFACE, LOWER SURFACE: Choose which surface is being imported. FILE UNITS: Select units for the data in your file. For detailed information and example text import files, as well as script files that generate the example files, see the Import object surfaces page in the User Guide section of the Online help.

5.1.10 Surface tab


The diagrams below show how the surface is used to create a volume of desired material.

The surface equation can contain up to three terms, conic, polynomial and custom which are added together to create the total surface. Not all terms have to be included.

S conic

S polynomial S custom

Conic term:

2003 - 2012 Lumerical Solutions, Inc

Simulation objects

81

S conic

cr 2 1 1 ( 1)c 2 r 2

c = 1/R, c is the inverse of the radius of curvature of the surface at r = 0. k is the conic constant. When k=-1 we have a parabolic surface. When k=0 we have a spherical surface. r2 = u2 + v2 in 3D simulations and r = u in 2D simulations. Polynomial term:
5

M iu i S polynomial
i 0 5

2d 3d

M ij u i v j
i, j 0

There are 6 M coefficients in 2D simulations and 36 in 3D simulations

Custom term:

S custom

f (u , v)

You can choose any analytic function of u in 2D simulations and (u,v) in 3D simulations. The syntax and functions available to specify the index are found in the Equation interpreter 114 section. For example, you could use

S custom

sin( u

v)

The surface tab contains the options: ORIENTATION: The surface determines if S is a function of (x,y), (x,z) or (y,z) in 3D simulations and (x) or (y) in 2D simulations. ZERO PLANE: This determines if surface is measured from the lower edge of the rectangular volume or the upper edge. See diagrams above. MATERIAL POSITION: This determines if the material fills the regions above the surface or below the surface. See diagrams above. SET UNDEFINED TERMS TO: It is possible that the surface equation becomes undefined. For example, it could be sqrt(-1) for some values of (u,v). In this case, the surface function will become either zero or the maximum value allowed by the rectangular volume encompassing the surface object. U0, V0: The origin of the (u,v) coordinate system, If U0, V0 are zero, then (u,v) = (0,0) will

2003 - 2012 Lumerical Solutions, Inc

82

Reference Guide correspond to the center of the surface object. Setting these values to non-zero will offset the origin by a desired amount. SURFACE UNITS: All quantities defining the surface must be measured in the same units. You can choose these units with this menu. CONIC: Check this option to include the conic term in the surface equation. If this is checked, then set RADIUS OF CURVATURE: curvature of the surface at the origin. This is equal to the inverse of the parameter c described in the definition of Sconic . CONIC CONSTANT: The constant. CUSTOM: Check this option to include the custom term in the surface equation EQUATION: The equation as a function of u in 2D simulations or u and v in 3D simulations. POLYNOMIAL: Check this option to include a polynomial term in the surface equation. If this option is checked, the M coefficients as explained above can be entered into a table.

5.1.11 Properties tab


The properties tab is only available for structure groups. The properties tab is used to set the origin of the group, and to create the custom properties of the group that are the inputs of the group script. Custom user property variables may be added with the ADD button, and removed with the REMOVE button. Each user property has a name and a type (number, frequency ect). The user properties can be set manually in the edit GUI or through script commands. For more information and examples, see the Structure groups page of the User Guide section of the Online Help.

5.1.12 Script tab


The script tab is only available for structure groups. The script tab can contain script commands that are used to set up a structure or edit the properties of structures located within the structure group. The structure group has access to the user variables defined in the PROPERTIES tab, and can change properties of any objects that are contained in the group. The script does not have access to objects which are not located in the group, and does not share the same variable space as the script prompt. The script is run every time the TEST or OK button is pressed, or when one of the user properties is changed with a script command. The following buttons and regions are available in the script tab: SCRIPT: This is where the script commands are written. To find a list of script commands, see the Scripting Language 155 section of the Reference Guide. TEST/SCRIPT OUTPUT: Press the TEST button to run the script. If there are no syntax errors in the script the SCRIPT OUTPUT will read <script complete>. For more information and examples, see the Structure groups page of the User Guide

2003 - 2012 Lumerical Solutions, Inc

Simulation objects section of the Online Help.

83

5.2

Simulation
Simulation objects are used to define simulation parameters like boundary conditions and mesh size.

Simulation region The simulation region defines most simulation parameters including the size and mesh size.

Mesh override region The mesh override region is used to override the default mesh size in some part of the simulation region. Normally the meshing parameters are set in the Simulation region. However, if some specific meshing conditions are required in part of the simulation region, a mesh override region can be specified. For example, some simulations with metals are very sensitive to meshing, and a mesh override region may be required at the metal surface. Note that only one simulation region per simulation is supported, but multiple mesh override regions may be used.

TIP: Objects which lie outside the simulation region. Any simulation objects contained or partly contained within the simulation region are included in the simulation, while any objects which fall completely outside of the simulation region are not included in the simulation. Those physical structures (and portions thereof) lying within the simulation region are included in the simulation (i.e. the simulation is performed on that portion of the physical structure lying within the simulation region). Physical monitors and sources are treated in a similar fashion, such that any portion of a monitor or source lying within a simulation region will be used. The user is warned when at least one source or monitor falls completely outside the simulation region.

5.2.1 General tab


The options in the general tab depend on whether the item being edited is a simulation region or a mesh refinement region.

Simulation region The simulation region contains three settings:

2003 - 2012 Lumerical Solutions, Inc

84

Reference Guide DIMENSION: The dimension of the simulation region (2D or 3D). BACKGROUND INDEX: The refractive index of the surrounding, background medium in the simulation region. SIMULATION TIME: The maximum duration of the simulation to be performed. The actual simulation may be shorter if the autoshutoff criteria are satisfied before this maximum simulation time is exceeded. For more information about how to choose the simulation time see set the simulation region section of the introduction in the Getting Started guide. Mesh override region For the mesh override region the general tab includes options to override the mesh in different directions, and enter the desired maximum mesh spacing. Alternatively, since the mesh spacing is usually determined by the refractive index of the materials in the simulation, it is possible to set an EQUIVALENT INDEX that will be used to determine the mesh spacing. A higher index will lead to a finer mesh.

5.2.2 Geometry tab


The geometry tab contains options to change the size and location of the simulation or mesh refinement region.

5.2.3 Mesh settings tab


The mesh settings tab includes settings that control the mesh geometry and the discretization of time when relevant. There are three different types of meshes. The options for each are described in more detail below. Then, the time step options are discussed for FDTD Solutions/Propagator simulations. Auto non-uniform The default setting. A non-uniform mesh is automatically generated based on the mesh accuracy slider bar and the material properties. Areas with a high index will have a smaller mesh step size. The MESH ACCURACY parameter is an integer from 1-8, where 1 is low accuracy, and 8 is high accuracy. It is strongly recommended that you start with a low accuracy setting so your simulation is fast. Once the simulation is setup properly, you should perform some convergence testing with different mesh sizes to ensure your result is consistent. The higher the accuracy, the more mesh cells are used per wavelength. The actual number the FDTD algorithm uses depends on lambda(lambda_0/n), the source wavelength inside the current material of index (n), and the division factor listed below. This formula works for dielectrics, but metals are meshed a bit finer.

2003 - 2012 Lumerical Solutions, Inc

Simulation objects

85

Step-size lambda/6 lambda/10 lambda/14 : lambda/34

Accuracy 1 2 3 : 8

Custom non-uniform This setting allows the user to fully customize how the non-uniform mesh is generated. If setting the mesh cells using wavelength, the default setting of 10 is sufficient in general, but may be reduced to 6-8 for coarse simulations. The grading factor determines the maximum rate at which the mesh can be modified. For example, if dx(i+1) = *dx(i), then 1/(GRADING FACTOR) <= <= GRADING FACTOR. The grading factor should be between 1 and 2. The default setting is sqrt(2). Uniform A uniform mesh is applied to the entire simulation volume, regardless of any material properties. This is the only mesh option available for an eigenmode solver simulation region in MODE Solutions. Mesh Refinement Mesh refinement can give sub-cell accuracy for a simulation. See the Mesh refinement options page for more information. Time Step Options DT STABILITY FACTOR: A setting which determines the size of the time step used during the simulation, defined as a fraction of the Courant numerical stability limit. A larger number will result in faster simulation times, and a smaller number will result in slower simulation times. The Courant stability condition requires that this setting must be less than 1 for the FDTD algorithm to remain numerically stable. DT: The time step of the FDTD/Propagator simulation. This is determined by the values of the spatial grid to ensure numerical stability and cannot be directly set by the user. Min Mesh Step The MIN MESH STEP sets the absolute minimum mesh size for the entire solver region. This setting will override all other settings, including the mesh size specified in a mesh override region.

2003 - 2012 Lumerical Solutions, Inc

86

Reference Guide

5.2.4 Boundary conditions tab


The boundary conditions that are supported by FDTD/MODE Solutions are listed below with an image showing how that particular boundary condition is drawn in the CAD window.

PML Many simulations employ absorbing boundary conditions that allow radiation to propagate out of the computational area without interfering with the fields inside. Perfectly matched layer (PML)1 boundaries absorb electromagnetic energy incident upon them. PML is most effective when absorbing radiation at normal incidence, but can have significant reflection at grazing incidence. In FDTD Solutions/Propagator simulation regions, the user can specify a desired PML reflection value, as seen in the image above, which will automatically set the number of PML layers independently for each side. (In Eigenmode solver simulation regions, the number of PML layers is set under the Advanced options tab 89 .) The number of layers depends on the mesh size at the particular boundary. (Note that more layers will cause the simulation to use more memory.) Furthermore, PML boundaries perform best when the surrounding structures extend completely through the boundary condition region. This will be the default behavior of structures whether or not they were drawn to end inside or outside the PML region. 1 J. P. Berenger, J. Comput. Phys. 114, 185 (1994)

2003 - 2012 Lumerical Solutions, Inc

Simulation objects

87

Metal Metal boundary conditions are used to specify boundaries which are perfectly reflecting, allowing no energy to escape the simulation volume along that boundary.

Periodic Periodic BC should be used when both the structures and EM fields are periodic. Periodic boundary conditions can be used in one or more directions (i.e. only in the x direction) to simulate a structure which is periodic in one direction but not necessarily other directions.

Bloch (FDTD Solutions/Propagator) Bloch BC should be used when the structures and the EM fields are periodic, but a phase shift exists between each period. Bloch boundary conditions are used in FDTD Solutions and propagator simulations predominantly for the following two simulations: Launching a plane wave at an angle to a periodic structure in this situation, accurate reflection and transmission data can be measured at a single frequency point for a given simulation. Calculating the bandstructure of a periodic object in this situation, a broadband pulse is injected via a dipole source into a periodic structure.

Symmetric Symmetric boundary conditions are used when the user is interested in a problem that exhibits one or more planes of symmetry. Both the structure and source must be symmetric. Symmetric boundaries are mirrors for the electric field, and anti-mirrors for the magnetic field. A visual explanation of a symmetric boundary condition is shown in the figure below. Careful consideration must be given to whether symmetric or asymmetric boundary conditions are required, given the vector symmetry of the desired solution. For meaningful results, the sources used must have the same symmetry as the boundary conditions. Further information about symmetric and asymmetric boundary conditions can be found in the online help in the section User guide - simulation - Choosing between symmetric and anti-symmetric BCs.

2003 - 2012 Lumerical Solutions, Inc

88

Reference Guide

Asymmetric Asymmetric boundary conditions are used when the user is interested in a problem that exhibits one or more planes of symmetry. Asymmetric boundaries are anti-mirrors for the electric field, and mirrors for the magnetic field. Boundary condition tab options XMIN, XMAX, YMIN, YMAX, ZMIN, ZMAX BOUNDARIES: These fields describe the boundary conditions to be applied along the perimeter of the simulation region. Symmetric and asymmetric boundary conditions should be applied to the lower boundary conditions. ALLOW SYMMETRY ON ALL BOUNDARIES: By default, symmetric and anti-symmetric conditions can only be used on the lower boundaries (x min, y min and z min). This box allows you to also use symmetry and anti-symmetric conditions on the upper boundaries in order to simulate periodic structures that exhibit symmetry. SET BASED ON SOURCE ANGLE: Bloch boundary conditions are often used to inject plane waves on angles into periodic structures. This option will determine the values kx, ky and kz for you based on the source in your current simulation. Note that if more than one source is defined, all sources must require consistent Bloch settings. By default, this box is checked. If you uncheck the box, you should set kx, ky and kz directly. BLOCH UNITS: Two types of units are allowed for specifying the values of kx, ky and kz: o bandstructure: In these units kx,y,z are defined in units of (2 /ax,y ,z) where ax,y ,z is the x,y or z span of the FDTD simulation region. These units are very convenient for bandstructure calculations. o SI: In SI units, k x,y ,z are defined in units of m-1. This is generally more convenient for injection of plane waves on angles.

2003 - 2012 Lumerical Solutions, Inc

Simulation objects

89

KX, KY, KZ: The wavevector setting in the x, y and z direction for the Bloch boundary in the units specified above.

5.2.5 Advanced options tab


WARNING: This tab includes options which should only be changed if you are quite familiar with the meshing algorithm and techniques used .

FDTD Solutions and MODE Solutions Propagator: FORCE SYMMETRIC X, Y, Z MESH: This will force a symmetric mesh about the x, y or z axis. When this option is enabled, the meshing algorithm ONLY considers objects in the positive half of the simulation region. The mesh in the negative half is simply a copy of the positive half mesh. All physical structures and mesh override regions in the negative half will not be considered by the meshing algorithm. This option also forces a mesh point at the center of the simulation region. Forcing a symmetric mesh ensures that the mesh does not change when going from a simulation with symmetry to a simulation without symmetry. OVERRIDE SIMULATION BANDWIDTH FOR MESH GENERATION: This option allows the simulation mesh to be generated following a custom wavelength or frequency range. By default, the mesh is generated based on the source properties. SNAP PEC TO YEE CELL BOUNDARY: This option forces any structures defined as PEC to have interfaces that are aligned with the Yee cell boundaries. This ensures that all electric field components at the PEC interface are tangential to the interface. This setting avoids complications that can result in some circumstances if normal electric field components are set to 0 at a PEC interface. To achieve this, the specified PEC interface may be shifted by as much as dx/2 when creating the simulation mesh, where dx is the size of the Yee cell. For more information, please contact support@lumerical.com ALWAYS USE COMPLEX FIELDS: This checkbox forces the algorithm to use complex fields during simulation. This will result in slower simulation times and increased memory requirements and should only be used when necessary. Without this, complex fields are only used when there are Bloch boundary conditions. USE EARLY SHUTOFF: This will automatically end the simulation when most of the energy has left the simulation volume. AUTO SHUTOFF MIN: The simulation will end when the total energy in the simulation volume drops to this fraction of the maximum energy injected. The simulation data will automatically save. USE DIVERGENCE CHECKING: This will automatically end the simulation when the total energy in the simulation volume is this many times larger than maximum energy injected. AUTO SHUTOFF MAX: The simulation will end when the total energy in the simulation volume rises to this many times the maximum energy injected. The simulation data will automatically save. DOWN SAMPLE TIME: Check the auto shutoff conditions every down sample time number

2003 - 2012 Lumerical Solutions, Inc

90

Reference Guide of dT time steps PML KAPPA: The normalized imaginary electric and magnetic conductivity used in the PML boundaries. PML SIGMA: The maximum normalized electric and magnetic conductivity used in the PML boundaries. MINIMUM PML LAYERS: The minimum number of cells which are used for PML boundary conditions. Increasing PML layers will reduce the back-reflection arising from the boundaries but will also increase time and memory requirements for simulations. Defaults to a setting of 12. MAXIMUM PML LAYERS: The maximum number of cells which are used for PML boundary conditions. Increasing PML layers will reduce the back-reflection arising from the boundaries but will also increase time and memory requirements for simulations. Defaults to a setting of 64. PML POLYNOMIAL: The polynomial power which determines how rapidly the electric and magnetic conductivity increases as radiation propagates at normal incidence into the PML. The default setting of 3 denotes a cubic increase of electric and magnetic conductivity with increasing depth into the PML. TYPE OF PML: The type of PML used can be STANDARD or STABILIZED. In some cases, STABILIZED PML provides more numerical stability, although the performance is slightly reduced. EXTEND STRUCTURE THROUGH PML: In most cases, we want the structures to extend through the PML so that fields exiting the simulation region are completely absorbed, otherwise there could be some unwanted back reflection. This option automatically extends structures through the region even if they were not drawn as such in the CAD. MAX SOURCE TIME SIGNAL LENGTH: This is the maximum length of data used by sources to store the time and time_signal properties of sources. If a large number of sources are used and the simulation time is on the order of 100ps (which is very rare), advanced users may want to reduce this to save memory. However, since the time and time_signal properties of sources are important for calculating the sourcepower, sourcenorm, and the normalization for the transmission functions, care must be taken with source normalization. In particular, in most cases, nonorm option should be used. SET PROCESS GRID: The division of of the simulation volume into sub-regions, which are then run as a separate processes, can be manually set for more efficient computation. Better performance will be achieved when the regions are square e.g. for 20 regions, 5x2x2 is more efficient than 20x1x1. NX, NY, NZ: The process layout for parallel simulations. SET DEFAULTS: Can be used to reset the settings back to their original default settings.

2003 - 2012 Lumerical Solutions, Inc

Simulation objects

91

5.3

Sources
The following types of sources are available in FDTD Solutions and MODE Solutions' Propagator:

Point sources (dipole) Oscillating dipoles act as sources in Maxwell's equation to produce electromagnetic fields. Their position and direction are specified in terms of the center position (x, y, and z for 3D simulations) and their orientation through angles phi (measured in the x-y plane with respect to the x-axis) and theta (measured from the z-axis). They can be placed at one or more points anywhere in the simulation area. For two-dimensional simulations, the behavior of point sources depends on whether you are performing a TE or a TM simulation. For a TE simulation, a magnetic dipole is oriented in the z-direction, while an electric dipole is oriented in the x-y plane by the ANGLE argument, which specifies the angle measured with respect to the x-axis. For a TM simulation, an electric dipole is oriented in the z-direction, while a magnetic dipole is oriented in the x-y plane with the same ANGLE argument describing the direction of the dipole vector.

Gaussian and thin lens sources A Gaussian source defines a beam of electromagnetic radiation propagating in a specific direction, with the amplitude defined by a Gaussian cross-section of a given width. By default, the Gaussian sources use a scalar beam approximation for the electric field which is valid as long as the waist beam diameter is much larger than the diffraction limit. The scalar approximation assumes that the the fields in the direction of propagation are zero. For a highly focused beam, there is also a thin lens source that will inject a fully vectorial beam. The cross section of this beam will be a Gaussian if the lens is not filled, and will be a sinc function if the lens is filled. In each case, the beams are injected along a line perpendicular to the propagation direction, and are clipped at the edges of the source. Note: References for the thin lens source The field profiles generated by the thin lens source are described in the following references. For uniform illumination (filled lens), the field distribution is precisely the same as in the papers. For non-uniform illumination at very high NA (numerical aperture), there are some subtle differences. This is due to a slightly different interpretation of whether the incident beam is a Gaussian in real space or in k-space. This difference is rarely of any practical importance because other factors such as the non-ideal lens properties become important at these very high NA systems. M. Mansuripur, "Distribution of light at and near the focus of high-numerical-aperture

2003 - 2012 Lumerical Solutions, Inc

92

Reference Guide objectives," J. Opt. Soc. Am. A 3,2086-2093 (1986). M. Mansuripur, "Certain computational aspects of vector diffraction problems," J. Opt. Soc. Am. A 6, 786-805 (1989). M. Mansuripur, "Distribution of light at and near the focus of high-numerical-aperture objectives: erratum, Certain computational aspects of vector diffraction problems: erratum" J. Opt. Soc. Am. A 10, 382-383 (1993).

Plane wave sources Plane wave sources are used to inject laterally-uniform electromagnetic energy from one side of the source region. In two-dimensional simulations, the plane wave source injects along a line, while in three-dimensional simulations the plane wave source injects along a plane. It is also possible to inject a plane wave at an angle. The plane wave source is actually the same object as the Gaussian source, with the only difference being the SOURCE SHAPE setting.

Total-field scattered-field sources Total-field scattered-field sources are used to separate the computation region into two distinct regions one contains the total field (i.e. the sum of the incident field and the scattered field), while the second region contains only the scattered field. The incident field is a plane wave with a wavevector normal to injection surface. This source type is particularly useful to study the scattering behavior of objects, as the scattered field can be isolated from the incident field. In 2D, the TFSF source injects along one edge of a rectangle as specified by the user. The other three boundaries subtract the incident field (allowing for the wave propagation). Everything inside the TFSF boundary is total field (i.e. incident + scattered field), while everything outside is only scattered field. In the absence of any objects, the wave propagates within the TFSF region and is subtracted out at the other end; this, of course, results in there being no scattered field. However, if one places an object in the path of the TFSF wave, this introduces scattered fields that then propagate outside of the total field area. Consequently, one can then measure the total or scattered transmission, by placing monitors inside or outside the total field region, respectively. Currently, only normal incidence plane waves are supported as the source field. TIP: Using TFSF sources TFSF sources can be used when: the source can completely surround the scattering objects in a homogeneous material (including materials with complex index). the scattering object is on or in a multilayer slab that is illuminated from above. Certain boundaries of the TFSF can be dragged outside the simulation area boundaries,

2003 - 2012 Lumerical Solutions, Inc

Simulation objects

93

for example, when symmetric or anti-symmetric boundary conditions are used in the simulation. For advanced use of TFSF sources, please consult an application example or technical support at support@lumerical.com. Some care is needed when using the TFSF source. The concept of total/scattered field is complex and can lead to misinterpretation of results, particularly with regards to energy conservation.

Mode sources The mode source is used to inject a guided mode into the simulation region. The geometry of the mode source (i.e. center location, and span) is used to compute the guided modes for the structure. In three-dimensional simulations, the modes are computed across a plane, while in two-dimensions they are computed across a line. From a list of possible modes, a single mode is selected for injection into the simulation region. For additional details on the operation of the mode solver, consult the integrated mode source 100 section.

Import sources (FDTD Solutions only) The import source allows the user to specify a custom field profile for the source injection plane. The custom field profile can be calculated from an analytic formula, imported from another FDTD simulation, or imported from other simulation tools such as Breault Research Organizations ASAP ray tracer. Imported sources are only available in 3D FDTD simulations.

Global source options The global source options window adjusts default frequency-domain parameters. These settings can be used by any of the frequency domain sources by unchecking the 'override global source settings' checkbox in the source's Frequency/Wavelength tab.

5.3.1 General tab


The information located on the general tab depends on the type of monitor chosen. Note that the POLARIZATION option is disabled for propagator simulations, where the actual polarization of the source is determined in the propagator simulation region, under the effective index tab. Otherwise, sources in propagator simulations are the same as sources in FDTD Solutions. Dipole sources DIPOLE TYPE: A pull-down menu in which the point source can be configured as an electric dipole or a magnetic dipole.

2003 - 2012 Lumerical Solutions, Inc

94

Reference Guide AMPLITUDE: The amplitude of the point source. The units of the source depend on the dipole type, as explained in the Units and normalization 37 section. BASE AMPLITUDE: This is the amplitude that will generate a radiated CW power of 10 nW/m in 2D simulations and 1 fW in 3D simulations. TOTAL AMPLITUDE: This is the amplitude actually used in the simulations, it is the product of the AMPLITUDE and the BASE AMPLITUDE. PHASE: The phase of the point source, measured in units of degrees. Only useful for setting relative phase delays between multiple radiation sources. THETA: The angle with respect to the z axis of the dipole vector PHI: Angle with respect to positive x axis of the dipole vector. Gaussian, plane wave and TFSF sources (Some of the options below are not available for the TFSF source.) SOURCE SHAPE: The shape of the beam. This setting defaults to Gaussian, but for convenience can be changed to that of a Cauchy/Lorentzian, or a plane wave. AMPLITUDE: The amplitude of the source as explained in the Units and normalization 37 section. PHASE: The phase of the point source, measured in units of degrees. Only useful for setting relative phase delays between multiple radiation sources. INJECTION AXIS: Sets the axis along which the radiation propagates. DIRECTION: This field specifies the direction in which the radiation propagates. FORWARD corresponds to propagation in the positive direction, while BACKWARD corresponds to propagation in the negative direction. ANGLE THETA: The angle of propagation, measured in degrees, with respect to the injection axis defined above. ANGLE PHI: The angle of propagation, in degrees, rotated about the injection axis in a right-hand context. POLARIZATION ANGLE: The polarization angle defines the orientation of the injected electric field, and is measured with respect to the plane formed by the direction of propagation and the normal to the injection plane. A polarization angle of zero degrees defines P-polarized radiation, regardless of direction of propagation while a polarization angle of 90 degrees defines S-polarized radiation. THETA VS WAVELENGTH PLOT: This plot shows the actual injection angle theta for each source wavelength as used in the simulation. Mode and imported sources (Note that imported sources are only supported in FDTD Solutions.) INJECTION AXIS: Sets the axis along which the mode source will propagate. DIRECTION: This field specifies the direction in which the TFSF source propagates. FORWARD corresponds to propagation in the positive direction, while BACKWARD corresponds to propagation in the negative direction. AMPLITUDE: The amplitude of the mode source as explained in the Units and normalization 37 section.

2003 - 2012 Lumerical Solutions, Inc

Simulation objects

95

PHASE: The phase of the point source, measured in units of degrees. Only useful for setting relative phase delays between multiple radiation sources. SELECT MODE: Mode source only. Launches the mode solver and allows the user to select the desired mode for injection. For more information on using the mode source, consult the integrated mode solver 100 section of the reference guide. THETA: The angle of propagation, measured in degrees, with respect to the injection axis defined above. PHI: The angle of propagation, in degrees, rotated about the injection axis in a right-hand context. OFFSET: Allows users to set an offset to the plane where the mode is calculated. This is useful for ensuring that mode sources at an angle do not intersect with structures that are not part of the waveguide/fiber. CLEAR SOURCE DATA: Clears the selected mode for mode sources, or clears the imported data for imported sources PLOT: This menu allows you to choose which component of the field profile you would like to plot. PLOT CURRENT MODE/FIELD: This button will plot the field profile selected in the PLOT pull down menu for the currently selected mode. PLOT IN NEW WINDOW: This is the same as PLOT CURRENT MODE/FIELD but opens a new window for the graphics that stays open even after property edit window is closed. Also for imported sources the following Imported source settings are available X0, Y0, Z0: Displays the location in the imported source where the field was recorded. IMPORTED INDEX: The refractive index of the background medium where the imported field was recorded. IMPORTED POWER: The power of the source recorded in imported. IMPORTED WAVELENGTH: The wavelength of the imported source data. IMPORT SOURCE: load an interface file (*.fld).

5.3.2 Geometry tab


The geometry tab contains options to change the size and location of the sources.

5.3.3 Frequency/Wavelength tab


The Frequency/Wavelength tab is shown below. This tab can be accessed through the individual source properties, or the global source properties. Note that the plots on the right-hand side of the window update as the parameters are updated, so that you can easily observe the wavelength (top figure), frequency (middle figure) and temporal (bottom figure) content of the source settings.

2003 - 2012 Lumerical Solutions, Inc

96

Reference Guide

At the top-left of the tab, it is possible to chose to either SET FREQUENCY / WAVELENGTH or SET TIME-DOMAIN. If you choose to set the frequency or wavelength ranges to define your sources, then FDTD Solutions/Propagator tries to find the optimum time domain settings that will cover the desired frequency/wavelength range without compromising accuracy. If you choose to directly modify the time domain settings, please keep the following points in mind: Pulse durations : Choose a pulse duration that can accurately span your frequency or wavelength range of interest. However, very short pulses contain many frequency components and therefore disperse quickly. As a result, short pulses require more points per wavelength for accurate simulation. Pulse offset: This parameter defines the temporal separation between the start of the simulation and the center of the input pulse. To ensure that the input pulse is not truncated, the pulse offset should be at least 2 times the pulse duration. This will ensure that the frequency distribution around the center frequency of the source is close to symmetrical, and the initial fields are close to zero at the beginning of the simulation. Source type: In general, you can choose between standard and broadband source types. Standard sources consist of a Gaussian pulse at a fixed optical carrier, while the broadband sources consist of a Gaussian pulse with an optical carrier which varies across the pulse envelope. Broadband sources can be used to perform simulations in which wideband frequency data is required for instance, from 200 to 1000 THz. This type of frequency range cannot be accurately simulated using the standard source type.

2003 - 2012 Lumerical Solutions, Inc

Simulation objects Set frequency wavelength If the SET FREQUENCY / WAVELENGTH option was chosen, this section makes it possible to either set the frequency or the wavelength and choose to either set the center and span or the minimum and maximum frequencies of the source.

97

Set time domain The options in the time domain section are: SOURCE TYPE: This setting is used to specify whether the source is a standard source or a broadband source. The standard source consists of an optical carrier with a fixed frequency and a Gaussian envelope. The broadband source, which contains a much wider spectrum, consists of a chirped optical carrier with a Gaussian envelope. When the user uses the script function setsourcesignal, this field will be set as "user input". FREQUENCY: The center frequency of the optical carrier. PULSELENGTH: The full-width at half-maximum (FWHM) power temporal duration of the pulse. OFFSET: The time at which the source reaches its peak amplitude, measured relative to the start of the simulation. An offset of N seconds corresponds to a source which reaches its peak amplitude N seconds after the start of the simulation. BANDWIDTH: The FWHM frequency width of the time-domain pulse. Advanced ELIMINATE DISCONTINUITY: Ensures the function has a continuous derivative (smooth transitions from/to zero) at the start and end of a user defined source time signal. By default, this option is enabled.

5.3.4 Beam options tab


This tab is only available for Gaussian sources. In the general tab, set the source shape option to the desired shape (Gaussian, plane wave or Cauchy/Lorentzian) before entering data in the beam options tab because the beam options that are available will change depending on the source shape. Beam options for all source shapes CURRENT INDEX: This field shows the refractive index at the x,y (and z) position of the beam. BEAM PROFILE, PLOT: This menu allows you to choose which component of the field profile you would like to plot. SHOW/REFRESH: This button will update the current plot and the current index. The plot is not automatically updated because the thin lens calculations can be long. PLOT IN NEW WINDOW: This is the same as SHOW/REFRESH but opens a new window for the graphics that will persist after you close the property edit window. Beam options for Gaussian and Cauchy/Lorentizian sources USE SCALAR APPROXIMATION / USE THIN LENS: These checkboxes allow the user to

2003 - 2012 Lumerical Solutions, Inc

98

Reference Guide choose whether to use the scalar approximation for the electric field or the thin lens calculation. Gaussian sources can be defined using either the scalar approximation or thin lens calculation, whereas Cauchy/Lorentzian sources can only be defined using the scalar approximation. Scalar approximation BEAM PARAMETERS: This menu is used to choose to define the scalar beam by the WAIST SIZE AND POSITION or the BEAM SIZE AND DIVERGENCE ANGLE. If WAIST SIZE AND POSITION is chosen, the options are: WAIST RADIUS: 1/e field (1/e2 power) radius of the beam for a Gaussian beam, or a halfwidth half-maximum (HWHM) for the Cauchy/Lorentzian beam. DISTANCE FROM WAIST: The distance, d, as shown in the figure below. A positive distance corresponds to a diverging beam, and a negative sign corresponds to a converging beam. If BEAM SIZE AND DIVERGENCE ANGLE is chosen, the options are: BEAM RADIUS: 1/e field (1/e2 power) radius of the beam for a Gaussian beam, or a halfwidth half-maximum (HWHM) for the Cauchy/Lorentzian beam. DIVERGENCE ANGLE: Angle of the radiation spread as measured in the far field, as shown in the figure below. A positive angle corresponds to a diverging beam and a negative angle corresponds to a converging beam. Thin Lens References for the thin lens approximation are listed on the Sources 91 page. NA: This is nsin( ) where n is the refractive index of the medium in which the source is found and is the half angle as shown in the figure below. Please note that the index will not be correctly defined in dispersive media and lenses should only be used in nondispersive media. The refractive index for the source is determined at X, Y (and Z). DISTANCE FROM FOCUS: The distance d from focus as shown in the figure below. A negative distance indicates a converging beam and a positive distance indicates a diverging beam. FILL LENS: Checking this box indicates that the lens is illuminated with a plane wave which is clipped at the lens edge. If FILL LENS is unchecked, then it is possible to set the diameter of the thin lens (LENS DIAMETER) and the beam diameter prior to striking the lens (BEAM DIAMETER), as shown in the figure below. A beam diameter much larger than the lens diameter is equivalent to a filled lens. NUMBER OF PLANE WAVES: This is the number of plane waves used to construct the beam. The beam profile is more accurate as this number increases but the calculation takes longer. The default value in 2D is 1000.

The figure below shows the beam parameter definitions for the scalar approximation beam.

2003 - 2012 Lumerical Solutions, Inc

Simulation objects

99

The figure below shows the beam parameter definitions for the thin lens, fully-vectorial beam.

TIP: Setting Gaussian source parameters Gaussian spot size: The beam spot size can be set independently of the source span. The source span should be chosen to be larger than the beam spot size. If there is significant intensity at the edges of the source, as shown in this figure, the beam will scatter on injection. If the spot size is larger than the simulation region, the beam profile will be truncated at the simulation boundary.

5.3.5 Advanced tab


This tab only appears for the dipole source. The tab contains a RECORD LOCAL FIELD checkbox. When checked, the fields around the dipole are saved; this box must be checked in order to use the dipolepower script function.

2003 - 2012 Lumerical Solutions, Inc

100

Reference Guide

5.3.6 Integrated mode source


This section describes the operation of the integrated mode solver to inject guided waves into FDTD simulations or the Propagator in MODE Solutions. The mode solver itself uses the same discretization mesh as the FDTD/propagator algorithm, so the profile of the guided modes as computed with the mode solver naturally interface with the underlying FDTD/propagator mesh. Overall, this facilitates the injection of guided modes with minimal back-reflection. This section describes the operation of the integrated mode solver once the physical structure and the simulation region defining the structure of interest have been defined within the layout editor. The mode source is launched by pressing the SELECT MODE button within the mode source edit window. Following this, the mode source window appears with different tabs. The following sections detail each tab within the mode solver window, and the information which it contains.

5.3.6.1 Mode analysis

The MODE ANALYSIS window is shown in the screenshot below. The upper portion of the window contains the MODE LIST where the mode number, effective index, propagation loss, and polarization (percentage of the mode polarized TE; not valid for 3D simulations) are shown. The lower left-hand corner shows the calculation parameters; upon launch, the lower left-hand portion of the window shows the default calculation parameters to be used to simulate the structure. The right-hand portion of the window contains the PLOT AREA where the simulation data is plotted, and the two drop-down boxes at the top of the plot area are used to specify which data to plot in the plot window, while the region at the bottom right can be used to modify the current mode plot options. Upon launch, the plot area shows the refractive index profile of the structure being analyzed.

2003 - 2012 Lumerical Solutions, Inc

Simulation objects

101

Modal analysis The modal analysis portion of the window displays simulation data relevant to the different modes calculated for the structure of interest. This portion of the window shows the modes, arranged from top to bottom in terms of the highest effective index and numbered sequentially. For each mode, this portion of the window shows the effective index of the mode, the calculated loss (measured in dB per millimeter of propagation; only valid for lossy materials), and the TE or TM fraction corresponding to the definition of TE and TM in 2D FDTD. For 3D FDTD simulations, the TE or TM fraction is not displayed. Note that there are small differences between FDTD Solutions and the Propagator in MODE Solutions, please see Mode List and Deck page in the MODE Solutions Knowledge Base for the latter case. See the following section for more information about the analysis and plot sections. Select Mode Pressing this button (located on the lower right corner of the window) will initialize the mode source with the current mode selected within the mode table in the upper left-hand portion of the window.

2003 - 2012 Lumerical Solutions, Inc

102

Reference Guide Advanced Options The ADVANCED OPTIONS button (located on the left right corner of the window) brings up the "Mode Advanced Options" window with the following parameters: CONVERGENCE TOLERANCE: the convergence tolerance used for the calculations. The default value corresponds to 1e-12 but can be increased by the user to speed convergence or decreased to improve accuracy. MAXIMUM NUMBER OF MODES TO STORE: When searching for modes in a range of effective indices from n1 to n2, it is possible to fill your available memory if too many modes are found. For this reason, the maximum number of modes is limited and the calculation will stop when this number of modes is exceeded. USE SINGLE PRECISION: this can be used to save some memory during the calculation of the modes but the results are less accurate.

5.3.6.1.1 Plot and Analysis Options

The plot and analysis windows are shown in the screenshot below.

The left portion of the window displays the calculation parameters: FREQUENCY: the frequency at which the modes are solved for. WAVELENGTH: the wavelength at which the modes are solved for. NUMBER OF TRIAL MODES: the number of modes to be calculated. SEARCH: this pull-down allows the user to specify which option to search for modes in, the available options are: o NEAR N: Allows you to look for modes near a desired effective index. - USE MAX INDEX: Search for modes near the maximum index found in the meshed cross section. - N: Choose the effective index to search for.

2003 - 2012 Lumerical Solutions, Inc

Simulation objects

103

o IN RANGE: Allows you to search for modes in a desired range of indices. - N1, N2: Define the range of indices to search over. BENT WAVEGUIDE: Allows the user to specify a current radius of curvature for the mode and solver for the modes of a bent waveguide. o BEND RADIUS: the bend radius of the waveguide measured from the center of the mode solver region o BEND ORIENTATION: the orientation of the radius of curvature. CALCULATE MODE: by clicking this button the mode solver will start the calculation for the waveguide modes given the criteria above. RESTORE LAST SETTINGS: restores the calculation parameters to the current simulation parameters corresponding to the modes that have been calculated. Figure window The plot itself where the data appears is automatically labeled and scaled to fit the simulation data. As with the layout editor, the plot can be zoomed using the standard mouse actions. Note, however, that the mouse is automatically in the zoom state when over the plotted data and therefore the keyboard shortcut Z is not necessary. Mode plot options The MODE PLOT OPTIONS can be set in the bottom right of the MODE ANALYSIS window, the options are PLOT: This pull-down allows the user specifies what simulation data should be plotted within the plot area. Box 1 specifies what general class of data to plot: o MODAL FIELDS: allows the user to select various field quantities such as electric and magnetic field amplitudes and intensities and Poynting vectors using the COMPONENT pull-down o MATERIAL PROPERTIES: allows the user to select various physical quantities such as refractive index, permittivity, and conductivity using the COMPONENT pull-down Box 2 specifies which part of complex-valued simulation data is to plot: o AMPLITUDE o PHASE o REAL PART o IMAGINARY PART COMPONENT: This pull-down allows the user to specify which specific component is to be plotted within the plot area. The available options depend on the setting of the PLOT pull-down. COORDINATES: currently supports only the CARTESIAN coordinate system. LINEAR/LOG SCALE: determines whether the simulation data is plotted on a linear or a log plot SUPERIMPOSE STRUCTURE: toggles whether a black outline showing the physical structure is superimposed on the simulation data

2003 - 2012 Lumerical Solutions, Inc

104

Reference Guide

5.4

Monitors
The following types of monitors are available in FDTD Solutions and MODE Solutions' Propagator:

Index monitors Index monitors records the n and k value as a function of frequency/wavelength in a simulation. Index monitors are only available in two or three dimensions; there is no option for linear or point index monitors. In the future, the index monitor will be able to capture the time-evolution of the physical properties profile for nonlinear media.

Time-domain monitors These monitors provide time-domain information for field components over the course of the simulation. Time-domain monitors can consist of point, line, or area monitors to capture this information over different spatial extents within the FDTD simulation region. For the purposes of extracting line widths of resonant structures through Fourier analysis, point time monitors with a down sample time of 1 are sufficient. TIP: Using time monitors Check the memory requirements when using 1D, 2D or 3D time monitors, since they will generate large amounts of data. Consider using the temporal or spatial down-sampling options.

Movie monitors Movie monitors capture a desired field component over the region spanned by the monitor for the duration of the simulation. Movie monitors are only available in the two dimensional variety (and only z-normal for propagator simulations). The resultant movies are saved with the same name as the monitor in the current working directory. TIP: CW Movies It is possible to create a CW movie from profile or power monitor data. For more information, see the User Guide - Data Analysis section of the online Knowledge Base.

Frequency-domain profile monitors Frequency-domain profile monitors collect the field profile in the frequency domain from simulation results across some spatial region within the simulation. Individual field components, Poynting vector, and power flow can be collected as a function of frequency and position. These monitors will record field profiles exactly where they are positioned.

2003 - 2012 Lumerical Solutions, Inc

Simulation objects

105

Profile monitors are ideally used to collect field data for visualization and customized analysis. If highly accurate power measurements are required, power monitors should be used, rather than profile monitors. Tip: Using frequency monitors Beware that frequency-domain field-profile monitors are computationally-intensive and they can increase the simulation time considerably. When possible, try to use 1D or 2D rather than than 3D monitors; if it is necessary to use the latter, try to restrict the number of frequency points. We suggest experimenting with the spatial downsample value(s) before doing long simulations and watch how long your simulation takes. If you are only interested in the power flux, you can select only OUTPUT POWER in the Data to record tab.

Frequency-domain power monitors Frequency-domain power monitors collect high-accuracy power flow information in the frequency domain from simulation results across some spatial region within the simulation. These monitors are identical to Frequency-domain profile monitors except that they automatically snap to the nearest FDTD mesh cell boundary when the simulation runs due to a different default setting of the SPATIAL INTERPOLATION property in the advanced option. This is important when accurate power flow calculations are required. Less interpolation is required in this case, which results in slightly more accurate power measurements. Unfortunately, this also means that the exact position where the data is recorded will change whenever the mesh changes. If it is more important to measure the field at a particular position, profile monitors should be used. The precise location of where the monitor measures data during the simulation is recorded with the monitor data in the x, y and z vectors. Tip: When to use profile and power monitors Profile monitors: when it is most important to measure the fields at a very specific point in space. Power monitors: when it is most important to get the most accurate power measurements. TIP: Switching between power monitor and profile monitor You can switch between frequency-domain power monitors and frequency-domain profile monitors by changing the SPATIAL INTERPOLATION setting in the Advanced Options tab. When the SPATIAL INTERPOLATION is set to NEAREST MESH CELL or NONE, the monitor becomes a frequency-domain power monitor.

2003 - 2012 Lumerical Solutions, Inc

106

Reference Guide

Mode Expansion Monitors Mode Expansion Monitors use overlap analysis to calculate the forward/backward propagating components of any mode of a waveguide or fiber at an arbitrary location in the simulation region. The Mode Expansion monitor facilitates the interoperability between FDTD Solutions and INTERCONNECT as it returns the S parameters, which can be imported into INTERCONNECT directly.

Global Monitor Properties The global monitor options window is where the user can specify the range and resolution with which to measure frequency-domain information. These settings can be used by any of the frequency domain monitors by unchecking the 'override global monitor settings' checkbox in the monitor's General tab.

5.4.1 Frequency Power/Profile tab


This tab only appears for the global monitor settings, but includes the same options as the general tab does for frequency domain power and profile monitors. USE LINEAR WAVELENGTH SPACING: By default, data is recorded at linearly spaced points with respect to frequency. Selecting this option spaces data at linearly spaced points with respect to wavelength. USE SOURCE LIMITS: When checked these monitors use the source limits. When unchecked, the frequencies/wavelengths at which to record data can be set using the pull down menus and boxes below them. FREQUENCY POINTS: Set to choose the number of frequency points at which to record data.

5.4.2 Frequency Power/Profile Advanced tab


This tab only appears for the global monitor settings. It contains advanced global settings for frequency-domain monitors. Only the MIN SAMPLING PER CYCLE can be modified by the user. MIN SAMPLING PER CYCLE: This parameter determines the minimum amount of sampling per optical cycle that can be used. By default, it is set at 2 (the Nyquist limit) for optimum efficiency. DESIRED SAMPLING: This converts the minimum points per optical cycle into an actual sampling rate in Hz. NYQUIST LIMIT: The Nyquist sampling limit is calculated based on the maximum frequencies that may be present in the simulation volume. ACTUAL SAMPLING: The actual sampling rate is the rate that will actually be used for the discrete fourier transforms (DFTs), taking into account the desired sampling rate, the Nyquist limit and the time step, dt.

2003 - 2012 Lumerical Solutions, Inc

Simulation objects DOWN SAMPLE TIME: This is the time step downsampling.

107

5.4.3 General tab


The information located on the general tab depends on the type of monitor chosen. There are three different possibilities, which are outlined below. Movie monitor HORIZONTAL RESOLUTION: The horizontal width of the final movie, in pixels. VERTICAL RESOLUTION: The vertical height of the final movie, in pixels. SCALE: A dimensionless variable which defines how to scale the capture of the field data, with the tendency that a scale factor too small will result in saturation of the movie, while a scale factor too large will result in very faint radiation patterns. This parameter may not be less than zero. Tip: for Gaussian pulses, this is best set to unity. For dipole sources, it is typically on the order of 0.01 to 0.05. The monitor outputs its maximum intensity at the end of the simulation in the variable Monitor Name_maxI. Setting the scale factor to Monitor Name_maxI and rerunning the simulation will result in a perfectly scaled movie. DRAW STRUCTURE OUTLINE: A toggle which allows the user to superimpose an outline of the refractive index profile on top of the movie. This can be used to aid in visualization of where the radiation is located within the dielectric structure. TM, TE FIELD COMPONENT: 2D simulations. The field component to be captured in the movie. The choices depend on whether a TE or TM simulation is being performed, as set out in the FDTD simulation region. If a TM simulation is being performed, the TM field component is captured to the movie, whereas if a TE simulation is being performed, the TE field component is captured. Can also be ELECTRIC FIELD INTENSITY (|E|2) or MAGNETIC FIELD INTENSITY (|H|2). FIELD COMPONENT: 3D simulations. The field component to be captured in the movie. Can also be ELECTRIC FIELD INTENSITY (|E|2) or MAGNETIC FIELD INTENSITY (|H|2). Time-domain monitor The general tab for the time domain monitor includes options to edit the amount of data, and time period over which data is collected. Index, frequency domain profile and frequency domain power monitors OVERRIDE GLOBAL MONITOR SETTINGS: A toggle to override the global monitor settings. If checked, the user can specify the frequency range and number of points at which frequency-domain information will be recorded (using the options described below). If unchecked the options below are set from the global monitor settings. USE LINEAR WAVELENGTH SPACING: By default, data is recorded at linearly spaced points with respect to frequency. Selecting this option spaces data at linearly spaced points with respect to wavelength. USE SOURCE LIMITS: When checked these monitors use the source limits. When unchecked, the frequencies/wavelengths at which to record data can be set using the

2003 - 2012 Lumerical Solutions, Inc

108

Reference Guide pull down menus and boxes below them. FREQUENCY POINTS: Set to choose the number of frequency points at which to record data.

5.4.4 Data to record tab


STANDARD FOURIER TRANSFORM: The monitor outputs data at specific frequencies. PARTIAL SPECTRAL AVERAGE:The monitor outputs the partial spectral average power through a monitor surface, normalized to the partial spectral average of the source. TOTAL SPECTRAL AVERAGE: The monitor outputs the total spectral average power through a monitor surface, normalized to the total spectral average of the source. OUTPUT EX, EY, EZ, HX, HY, HZ, PX, PY, PZ: A set of fields with which the user can select what field components (EX, EY, EZ, HX, HY, HZ) or Poynting vector (PX, PY, PZ) to measure. In 2D simulations, only some components are non-zero (i.e. only EX, EY, and HZ are applicable for TE simulations). All the field quantities remain active to facilitate easy change between TE and TM simulations. OUTPUT POWER: For surface monitors (3D) and line monitors (2D) only. You can calculate the integrated power over the monitor surface. This requires much less memory after the simulation is completed and is particularly suitable for large parallel simulations where only the integrated power across a surface is required.

5.4.5 Geometry tab


The geometry tab contains options to change the size and location of the monitors. The DOWNSAMPLE X, Y, Z option is used to set the spatial averaging performed on the data. A down sample value of N corresponds to averaging over N grid points. Setting the down sample value to 1 gives the most detailed spatial information (i.e. information at each grid point).

5.4.6 Spectral averaging and apodization tab


PARTIAL SPECTRAL AVERAGING, DELTA: FWHM of the Lorentzian weighting function. APODIZATION: Specifies the window function of the apodization. Options include none, start (i.e. beginning of time signature apodized), end (i.e. end of time signature apodized, or full (i.e. both start and end). Note that apodization will, in general, invalidate any source normalization performed and is therefore not suitable for accurate power measurements. APODIZATION CENTER, TIME WIDTH, FREQ WIDTH: See the diagram below for the definition of these terms. The FREQ WIDTH corresponds to the effective bandwidth of the full apodization window, as described under APODIZATION. Note: Apodization functions

2003 - 2012 Lumerical Solutions, Inc

Simulation objects

109

FULL apodization involves windowing the time-domain data on both the start and end side. The resulting windowed data is then processed to produce frequency-domain information. START apodization involves windowing the front side of the time-domain data. This can be useful to exclude the initial source excitation from the frequency-domain data. END apodization involves windowing the last part of the simulation. This can be useful for ramping down the time-domain signal in devices where the radiation lives a long time, like cavities.

5.4.7 Advanced tab


Time-domain monitors SPATIAL INTERPOLATION: In FDTD generally, the electromagnetic field components are not recorded at the same point in space. Instead each component of the vectorial electric and magnetic fields are recorded at different locations in the Yee cell. In order to properly calculate the Poynting vector and electromagnetic energy density, the fields are interpolated to the same location in the Yee cell. This setting controls how the fields are interpolated. Currently, the supported options for time monitors are NEAREST MESH CELL and NONE. With NEAREST MESH CELL, the fields are interpolated to the nearest FDTD mesh cell boundary. With NONE, no interpolation is performed and each electromagnetic field component is recorded at a different position within the Yee cell. MIN SAMPLING PER CYCLE: This parameter determines the minimum amount of sampling per optical cycle that can be used. By default, it is set at 10. SAMPLING RATE: The actual sampling rate in Hz. DOWN SAMPLE TIME: This is the time step downsampling. Frequency domain profile and power monitors SPATIAL INTERPOLATION: This option is as described above for time domain monitors OVERRIDE ADVANCED GLOBAL MONITOR SETTINGS: When this option is selected MIN SAMPLING PER CYCLE can be set. The other options cannot be altered, they are there to display settings. For further details, see the descriptions in Frequency Power/ Profile Advanced tab 106 . Movie monitors MIN SAMPLING PER CYCLE: This parameter determines the desired amount of

2003 - 2012 Lumerical Solutions, Inc

110

Reference Guide sampling per optical cycle. SAMPLING RATE: This converts the minimum points per optical cycle into an actual sampling rate in Hz. DOWN SAMPLE TIME: This is the time step downsampling. FRAME RATE: The speed at which frames are displayed on the screen, in units of frames per second. The default is 30. Index monitors: SPATIAL INTERPOLATION: There are three options for index monitors. The default option, SPECIFIED POSITION returns the index that that the field sees at the location where the monitor is placed. The next two options. NEAREST MESH CELL and NONE are as described for time-domain monitors. In simulations with mesh refinement turned on, the default option does not show the averaging of the indices, but the other options do.

5.4.8 Setup tab


The setup tab is only available for analysis groups. The setup tab contains two further tabs: the variables tab, and the script tab. The variables tab is identical to the properties tab 82 for structure groups and the script tab is identical to the script tab 82 for structure groups. For more information and examples, see the Analysis groups page of the User Guide section of the Online Help.

5.4.9 Analysis tab


The analysis tab is only available for analysis groups. The analysis tab contains two further tabs, the variables and the script tab. The variables tab is used to define the input and output parameters of the script, and the script command contains script that can be used to process the monitor data. Variables tab PARAMETERS: These are input parameters to the analysis script. RESULTS: The output parameters are defined here. The analysis script must calculate these quantities. Once the analysis script has been run, the results become monitor data, that can be accessed using script commands in the same manner that monitor data is accessed for simple monitors. Script tab The script has access to the input parameters defined in the variables tab, and can get data from any of the monitors located in the group. However, it cannot get data from monitors or sources not located inside that group. The script in the analysis groups does not use the global variable space from the script prompt and script file editor. The results from the script can be obtained in the script prompt by setting up output parameters in the variables tab.

2003 - 2012 Lumerical Solutions, Inc

Simulation objects

111

The following buttons and regions are available in the script tab: ANALYSIS SCRIPT: This is where the script commands are written. To find a list of script commands, see the Scripting Language 155 section of the Reference Guide. ANALYSIS SCRIPT OUTPUT: Press the RUN ANALYSIS button to run the script. If there are no syntax errors in the script the SCRIPT OUTPUT will read <script complete>. In addition, the analysis script output will contain any results from the "?" script command. RUN ANALYSIS: Pressing the run analysis prompt runs the analysis script and saves the results. This button can only be pressed when the simulation is in analysis mode. SAVE ANALYSIS: Pressing this button saves changed made to the analysis script (even when in analysis mode). For more information and examples, see the Analysis groups page of the User Guide section of the Online Help.

2003 - 2012 Lumerical Solutions, Inc

112

Reference Guide

5.4.10 Mode expansion tab


This tab only appears for the Mode Expansion monitors.

The Mode Expansion tab contains two main sections. The "Mode calculation" section allows users to select a mode (or a set of modes) to expand the monitor data with. The "Monitors for expansion" section allows users to choose a field profile from an arbitrary monitor in the simulation to expand. For more information on this expansion calculation, and the results that are returned, see Overlap analysis.

Mode Calculation
MODE SELECTION: Allows users to select the modes to use for the mode expansion calculation. The "user select" option allows users to select multiple modes.

2003 - 2012 Lumerical Solutions, Inc

Simulation objects

113

Following the "mode selection" combo box is a frame for choosing the frequencies to calculate the modes for. Note that this does not have to correspond to the frequency points for the monitors in the "Monitors for expansion" table. The mode expansion monitor will automatically perform the necessary interpolation between different frequency points. OVERRIDE GLOBAL MONITOR SETTINGS: A toggle to override the global monitor settings. If checked, the user can specify the frequency range and number of points at which the modes will be calculated at (using the options described below). If unchecked, the options below are set from the global monitor settings. USE LINEAR WAVELENGTH SPACING: By default, modes are calculated at linearly spaced points with respect to frequency. Selecting this option spaces the points with respect to wavelength. USE SOURCE LIMITS: When checked these monitors use the source limits. When unchecked, the frequencies/wavelengths at which to record data can be set using the pull down menus and boxes below them. FREQUENCY POINTS: Set to choose the number of frequency points at which to calculate the modes. SELECT MODE: If the "user selected" option has been chosen, this will bring up the Mode analysis tab 100 for the user select from a calculated list of modes. VISUALIZE MODE DATA: This will bring up the Visualizer, showing all the profiles for the selected modes. CLEAR MODE DATA: Clears all the mode data. Rotations This frame allows user to apply an arbitrary rotation to the calculate modes. THETA: The angle of propagation, measured in degrees, with respect to the normal axis. PHI: The angle of propagation, in degrees, rotated about the normal axis in a right-hand context. OFFSET: Allows users to set an offset to the plane where the modes are calculated. This is useful for ensuring that monitors at an angle do not intersect with unwanted structures. Advanced AUTO UPDATE BEFORE ANALYSIS: If selected, the monitor will automatically update the chosen modes when necessary.

Monitors for expansion


After the modes have been selected, the next step is to choose the monitor with the input field profile. The "Add" and "Remove" buttons on the side can be used to add/remove monitors, and users can choose the desired monitor from the monitor drop down list.

2003 - 2012 Lumerical Solutions, Inc

114

Reference Guide

5.5

Equation interpreter
The fields for numeric parameters can be used as a simple calculator. For instance, if you wish to set a value to the square root of 3 divided by e, just enter sqrt(3)/exp(1) into the field. The expression will be automatically evaluated when you press Enter or click on a different field. Equations which become undefined (i.e. 1/0) should be avoided. The following table provides a list of available operators and constants. Category Algebraic operators Trigonometric operators Syntax +, -, *, / sin, cos, tan, asin, acos, atan, atan2, sinh, cosh, tanh ^ or **, exp, log10, log, sqrt >, <, >=, <=, ==, != abs, mod c - Speed of light in m/s pi - The value of Pi

Power operators Logical operators Other operators Constants

Examples 2^10 sqrt(3)/exp(1) sin(45*pi/180)

Index profile for <Object defined dielectric>


In addition to the above parameters, users can user position variables when specifying the index profile of the <Object defined dielectric> material definition. Examples sin(x)^2 exp(-x^2-y^2) x>0 Note: Formulas The position variables here are relative to object space. (x,y,z) = (0,0,0) refers to the center of the object, not the origin of world space.

2003 - 2012 Lumerical Solutions, Inc

Simulation objects

115

Material database variables


The following table describes variables or constants supported by many fields in the material database, most of which do not support position variables. Variable or predefined constant f Description The simulation center frequency f = (fmin+fmax)/2 The simulation center angular frequency w = 2*pi*f The free space wavelength l0 = c/f The free space wavenumber k0 = 2*pi/I0 Units Hz

Hz

l0

Length units as defined by user The inverse of the length units defined by the user

k0

2003 - 2012 Lumerical Solutions, Inc

116

Reference Guide

Material database
This chapter explains the Material Database. See the following pages for details. Material database 116 The Materials Database allows for the definition of complex materials using experimental data or parametrized models. It can be accessed by clicking the material database button on the Structures tab. The Material Database stores the material data to be used in the simulation. It also provides an interface to change material properties like color, mesh order, and model parameters. Experimental data can also be loaded into the database. To view the resulting index profile, use the Material Explorer. Permittivity models 117 See this section for information on the available material models, such as Sampled data, plasma, lorentz, etc. Material explorer 125 The Material Explorer is used to check the material fits that will be used in the simulation. It is most important to check the fits when using the Sampled data material type, but the Material Explorer can be used to check the fits for any material type. The Material Explorer can be accessed through the Simulation menu. Mesh order 127 See this section for information on the mesh order property, which defines the meshing behavior (priority) for overlapping objects.

6.1

Material database
The Materials Database allows you to manage (create, modify, delete) the materials that are available for use in your simulations. A copy of the database is stored in each simulation file. A change to the database in one file does not automatically change the materials in any other files. To modify the default materials that appear when you create a new simulation, edit the simulation file in the Defaults subdirectory of the installation directory.

2003 - 2012 Lumerical Solutions, Inc

Material database

117

Import / Export
The import and export buttons allow you to transfer material data between simulation files via Material Database Files (.mdf) files.

Material list
The material list shows the materials stored in the material database. A number of materials are provide with the product installation. To create additional materials, use the Add button. You can also modify some of the material properties (name, color, mesh order, etc) in the list view. Default materials provided with the product installation are write protected, and can not be directly modified. To modify the properties of a default material, simply use the Copy button to duplicate the material. The copy will be unlocked. The first column of the list shows which materials are write protected. Materials currently used in the simulation can not be deleted. The second column of the list shows which materials are in use. To delete these materials, first modify the simulation so they are not used.

Material Properties
Use the Material properties window to view and edit the material model parameters. For model parameter definitions, see the material models section.

6.2

Permittivity models
This section describes the permittivity (or refractive index) material models supported by the Material Database. Model parameters can be edited in the Material property panel of the Material Database window.

Sampled data
The Sampled data model is used to import experimental material data. The experimental data can be imported from a text file with the Import data button. The Sampled data material definition uses an automatic fitting routine to generate a multicoefficient material model of the experimental data over the frequency range specified by the source.The fitting routine can use one of the models described below, or a more generalized model. The fits can be check ed and adjusted in the Material Explorer. Tolerance - The desired RMS error between the permittivity of the experimental data and the material fit. The fitting routine will use the least number of coefficients that produce a fit with an RMS error less than the tolerance. Max coefficients - The maximum number of coefficients allowed to be used in the material fit. More coefficients can produce a more accurate fit, but will make the simulation slower.

2003 - 2012 Lumerical Solutions, Inc

118

Reference Guide The following advanced options can be set in the Material Explorer: Mak e Fit Passive - Set to be true to prevent the fit from having gain at any frequency. By default this is true in order to prevent diverging simulations. Improve Stability - If this setting is true, the fitting routine restricts the range of coefficients in the fit in order to reduce numerical instabilities which cause simulations to diverge. Imaginary Weight - Increasing the weight increases the importance of the imaginary part of the permittivity when calculating a fit. A weight of 1 gives equal weight to the imaginary and real parts of the permittivity. Specify Fit Range - Set to true to decouple the bandwidth used to generate the material fit and the source bandwidth. This option is used in parameter sweeps where the source frequency is changed, and where it is important to keep the material parameters constant over the whole parameter sweep. The fit range should cover the simulation bandwidth. Bandwidth range - Bandwidth to be used for the fit when Specify Fit Range is true.

Dielectric
The Dielectric model is used to create a material with a constant real index. This material will have the specified index at all frequencies (non-dispersive). Refractive index - The refractive index of the material. Must be >= 1.

(n,k) material
The (n,k) material model is used to create a material with a specific value of n and k at a single frequency. Refractive index - Real part of the index at the center frequency of the simulation. Must be > 0. Imaginary refractive index - Imaginary part of the index at the center frequency of the simulation. Positive values correspond to loss, negative values will produce gain. NOTE: Single frequency simulations only! This type of material model should only be used for single frequency simulations. The implementation of the (n,k) material model is such that the material properties will only be correct at the center frequency of the simulation.

Conductive
The Conductive model is used to create a material defined by the following formula.
total

(f)

Plasma (drude)

2003 - 2012 Lumerical Solutions, Inc

Material database The Plasma model is used to create a material defined by the following formula.
total ( f ) 2 P

119

f i

Debye
The Debye model is used to create a material defined by the following formula.
total

(f)
C

debye

i2

Lorentz
The Lorentz model is used to create a material defined by the following formula ( > 1).
total

(f)

lorentz 2 O

2 O

2i

(2

f )2

NOTE: Lorentz model reference: Kurt Oughstun and Natalie Cartwright, "On the Lorentz-Lorenz formula and the Lorentz model of dielectric dispersion," Opt. Express 11, 1541-1546 (2003)

Sellmeier
The Sellmeier model is used to create a material defined by the following formula. The C coefficients have dimensions of micrometers squared ( m2).
total ( ) 2 2 2

A1

B1
2

B2
2

B3
2

C1

C2

C3

NOTE: Single frequency simulations only! This type of material model should only be used for single frequency simulations. The implementation of the Sellmeier model is such that the material properties will only be correct at the center frequency of the simulation.

PEC
A Perfect Electrical Conductor (PEC). This material sets the fields to 0. There are no parameters for this model.

Analytic material
The analytic material model allows the user to enter an equation for the real and imaginary part of the permittivity or refractive index which can depend on the predefined variables

2003 - 2012 Lumerical Solutions, Inc

120

Reference Guide listed below. The predefined variables that can be used in the equations for "real" and "imaginary" are: - f: the frequency in the specified frequency units - l0: the free space wavelength in the specified length units - w: 2*pi*f in the specified units - k0: 2*pi/l0 where l0 is in the specified length units - pi: the number pi - c: the speed of light in a vacuum, ALWAYS in SI units, ie, always equal to 3e8 - x1,...,x10: numeric values that represent a parameter of interest

Kerr nonlinear
In the Kerr nonlinear model, the electric polarization field P will depend on the electric field E in the following manner.
(1) 0 ( 3)

P (t ) D(t )

| E (t ) |2 E (t )

Solving for the displacement field D gives


( 3) 0 r

| E (t ) |2 E (t
( 3)

The relative permittivity and

values must be specified by the user.

Chi2
( 2)

This nonlinear model allow users to define the value for the term directly. An arbitrary dispersive base material can also be specified, in which case the added polarization will be
(1)

in addition to the polarization of any base material that is selected. If the (default), the polarization will be added to the vacuum.

term is 0

Chi3/Chi2
The usage for the Chi3/Chi2 material is the same as the Chi2 material, but with the addition of the Chi3 term. Note that higher orders terms can also be modeled via the User-defined models 122 .

Paramagnetic
The paramagnetic material model allows the user to specify both the permittivity and permeability of the material to simulate magnetic materials.

2003 - 2012 Lumerical Solutions, Inc

Material database

121

6.2.1 Anisotropic materials


In general, anisotropic materials can be represented by a 9 element permittivity tensor such that the electric and displacement fields are related by
ij

Di

ij

Ej

where summation over j is implied on the right hand side. The full anisotropy tensor can be written as
11 21 31 12 22 32 13 23 33

The input of anisotropic materials is simple when the permittivity tensor is diagonal
x

0
y

0 0

0 0
z

To define an anisotropic material, set the Anisotropy field in the Material database to Diagonal. The Material property editor will then have a property field for each direction. When using the Material Explorer, you can select the component (x,y,z) of the permittivity or index to plot. If you have a more general form of anisotropy, you must first diagonalize the anisotropy (use the eig script command) and find both the eigenvalues and the unitary transformation that makes the permittivity diagonal. Once you can write
D

U U

where U is a unitary matrix, U=U-1 is the complex conjugate transpose of U and eD is diagonal, then the diagonal values of eD should be entered into the materials database and a matrix transform grid attribute should be added with the transform U. The relevant objects should associated with both the material and the matrix transform grid attribute. Note: When you rotate a geometric primitive, the permittivity tensor is not rotated. In order to do this, you must define a rotation grid attribute that has the same rotation as the object and associate the object with that grid attribute.

2003 - 2012 Lumerical Solutions, Inc

122

Reference Guide

6.3

User-defined models
Users can define their own plugin material models written in C++. These material models can be compiled as a plugin and added to the materials database.

Basic concept
To create a new material, you must write a method in C++ that solves the following equation for for En

U n E n Pn V n
where En is the electric field at time n t, Pn is the desired polarization at time n t and Un and Vn are input values that we provide. The polarization that is added will be in addition to the polarization of any base material that is selected. If no base material is selected, the polarization will be added to the vacuum (ie. the default relative permittivity or permeability is 1.) The same approach is used to create new magnetic materials. Simple example Suppose you want to implement a simple linear, non-dispersive polarization that is added to Lumerical's default multi-coeffiient model (MCM) for Silicon from Palik. The polarization that we want to add is simply

In FDTD, this means that for each component of E in this material, you want to have

Pn U nEn

En En Vn

and therefore you need to solve

for En by implementing a method that returns

En

Vn Un

Once this material plugin has been created, you simply add this material to the database and select Silicon as the base material. You will now have a material with a total permittivity of

( )

MCM

( )

2003 - 2012 Lumerical Solutions, Inc

Material database where


MCM

123

( ) is the dispersive MCM model for Si from our database, and

is the

additional non-dispersive susceptibility.

FAQ
Can I solve dispersive media that include auxilliary fields? Yes, you can tell us how many storage fields you need and we will allocate the memory and allow you to update the storage fields. Can I solve for non-linear media? Yes, this is one of the examples we provide. In fact the (2) medium that comes with the software is actually created as a plugin. Can I solve advanced material models that might involve coupling to multi-level electron systems? Yes, as long as you can define a polarization in the manner described above, you can introduce materials that involve extremely complicated material models, including gain media. Can I solve for anisotropic media? Yes, the method is setup to handle diagonal anisotropic media. For non-diagonal anisotropy this can often be handled by applying local transformations of the reference frame using matrix transform grid attributes. In the future, we may implement additional plugin models that allow the user to see the other field components directly if that becomes important.

How to use material plugins in the software


Once a plugin *.dll or *.so file has been created and is saved into the correct installation folder. The new material will appear automatically in the materials database, and can be added as shown below for the Chi2 material that was created as a plugin.

The input parameters that are specified as part of the plugin implementation will appear either in isotropic or diagonal anisotropic modes, as shown below:

2003 - 2012 Lumerical Solutions, Inc

124

Reference Guide

Implementation
If you want to implement a new material we recommend that you discuss it with us first. In many cases, it may be easier for us to create a plugin and installer package for you based on the equations that you want to solve. In other cases, we can help set you up to write, compile and use your plugins. It is still likely easiest eventually to have us compile your final code so that a plugin and plugin installer can be built on all operating systems in a way that is easy to distribute and install on other computers. Finally, we are always interested in collaborating with groups that can provide sophisticated material models that we can redistribute to other users, with appropriate references and web links. Please contact us at support@lumerical.com for more information.

2003 - 2012 Lumerical Solutions, Inc

Material database To see the interface class, and 2 simple examples, please look at the following files:

125

imaterialplugin.h is the interface that must be implemented. chi2.h and chi2.cpp is an example of the header and implementation of the plugin for a chi2 material. paramagnetic.h and paramagnetic.cpp is an example of the header and implementation of the plugin for a paramagnetic material. The above 2 examples are compiled and distributed with the standard installation package.

6.4

Material explorer
The Material Explorer is used to check the material fits that will be used in the simulation. This is most important when using the Sampled data material type, although it can be used to check material properties for all material types. If the fit for a Sampled data material is not good enough, the Tolerance and Max coefficient properties and the wavelength range of the source can be edited in the Material Explorer.

Plot windows
The two figure windows at the top of the Material Explorer window show the real and imaginary parts of the material index.

Material settings
Property Material Description Select the material to check.

2003 - 2012 Lumerical Solutions, Inc

126

Reference Guide Axis Fit Tolerance Max Coefficients Show/Hide Advanced Imaginary weight If the material is anisotropic, select the axis to check. The Tolerance setting of the material. Only applies to fitted materials. The Max coefficients setting of the material. Only applies to fitted materials. Show or hide the advanced options. Increasing the weight increases the importance of the imaginary part of the permittivity when calculating a fit. A weight of 1 gives equal weight to the imaginary and real parts of the permittivity. Check to prevent the material fit from having gain at any frequency. By default this is checked in order to prevent diverging simulations. Check to restrict the range of coefficients in the material fit in order to reduce numerical instabilities which cause simulations to diverge. Decouple the bandwidth used to generate the material fit and the source bandwidth. The frequency/wavelength range used for the fit if specify fit range is selected. The bandwidth of the fit should cover the simulation bandwidth. Update the Material Database with the new Tolerance and Max coefficients values.

Make fit passive

Improve stability

Specify fit range Bandwidth range of fit

Save fit parameters

Simulation bandwidth settings


Property Bandwidth units Bandwidth range Save source bandwidth Description Specify range in units of wavelength or frequency. Specify range by Min/Max or Center/Span. The frequency/wavelength range of interest. By default, this is the source limits. Update the source limits with these values.

View settings
Property Vertical axis Description Plot permittivity or index

2003 - 2012 Lumerical Solutions, Inc

Material database Show material data Standard view Extended view range Specify view range Plot in new window Show the experimental data on the plot windows Plot the fit over the specified bandwidth range Plot the fit over a wider bandwidth range Specify the range to plot the fit Plots fit and data in a new window

127

Fit and plot buttons


Property Plot in new window Fit and Plot Description Plot data in a new window Calculate and plot the material fit

Fit analysis
Property RMS error Description The RMS error of the fit. The fitting algorithm will use the minimum number of coefficients required to achieve an RMS error less than the value specified by the Tolerance property of that material. The number of coefficients used in the fit.

Number of coefficients

6.5

Mesh order
The mesh order property governs how overlapping objects are meshed in the simulation. It serves no role for objects which do not overlap. The mesh order can be set at the material level (in the material database), or the object object level (in the object properties). Materials with a lower mesh order take priority over materials with a higher priority number (i.e. order 1 takes priority over 2). Areas which overlap are assigned the material properties of the higher priority material (see the following figure).

2003 - 2012 Lumerical Solutions, Inc

128

Reference Guide In the figure to the left, there are two objects that partially overlap. Depending on their mesh orders, the object that is actually being simulated will be different.

In the event that both overlapping materials have the same order, the mesh order will be inferred from the Object tree. Objects at the bottom of the tree will take priority over objects at the top of the tree. To ensure your simulation is well defined, it is recommended that you avoid situations where two different overlapping structure have the same mesh order. For simulations using the conformal mesh, the mesh order property defines the material properties in the mesh cells where materials fully overlap one another. In the mesh cells which contain boundaries between two materials, the conformal mesh algorithm solves Maxwell's integral equations near these boundaries. Tip: Use an index monitor to confirm that the structures are meshed as intended. Note: The etch material in the default Material database By default, most materials in the material database have a mesh order of 2. The only exception is the etch material, which has a mesh order of 1. The lower mesh order means that an object using the etch material will override other objects of a different material type. The etch material has a refractive index of n=1. If you are using a different background index, you should modify the etch material to match the background index of your simulation.

2003 - 2012 Lumerical Solutions, Inc

Running simulations and analysis

129

Running simulations and analysis


This section describes the general operations of running a simulation and performing an analysis. Information on how to set up optimization and parameter sweep projects is also described here. The contents are organization into the following chapters: Resource Manager 129 Running a simulation 132 Analysis tools 133 Visualizer 139 Results View 142 Optimization and parameter sweeps 146

7.1

Resource Manager
Before running any simulations, the computing resources must be configured. This is done through the resource manager. It can be easily accessed by pressing the resources button

in the main toolbar. Usually, this only needs to be set once per machine. This is different from earlier versions of the program, when all resource/parallel configuration options were saved in each simulation file. These settings are now saved on each machine.

Resource Configuration

2003 - 2012 Lumerical Solutions, Inc

130

Reference Guide USERS WITH A SINGLE LICENSE Resources This section allows the number of processes for localhost to be changed as well as the name. For advanced configuration options, see Resources Advanced Options 131 . Configuration test Run tests to make sure MPI username and password are set correctly. It also performs other checks such as engine path verification. If the tests pass, then we can be sure that the current simulation will run. USERS WITH EXTRA ENGINE LICENSES Resources If you have extra engine licenses and Lumerical software installed on other computers on the network, they can be added as additional computation resources to perform multiple simulations in parallel. This is especially useful for parameter sweeps and optimization projects where many iterations need to be performed. The resources can easily be turned on and off depending on whether they are free to compute at the time. Requirements of each additional resource: Must be the same operating system as localhost Must be the same system type as localhost (cannot mix 32-bit with 64-bit) Must have the same version of Lumerical software as localhost Must have the same version of MPI as localhost Must have a user account with the same login and password as localhost Must have access to the simulation files via a network drive To add a new resource: 1. Click the add button. 2. Set 'active' if you plan to use the resource right away or 'inactive' if you plan to enable it later 3. Set a name for that resource 4. Specify the IP address of the hostname that the computer uses on the network 5. Set the number of cores that you would like it to use 6. Set any advanced options. If many resources have advanced options that need to be changed, the 'Duplicate' button will be useful. Configuration test This section of the window is used to test the communication to the additional resources. It runs a series of tests and will report any warnings or errors that may prevent a distributed simulation from running such as mismatched software versions, user credentials or communication problems.

2003 - 2012 Lumerical Solutions, Inc

Running simulations and analysis

131

7.1.1 Resources Advanced Options


Advanced Options Each resource can have customized settings if required.

Resource advanced options MPICH OPTIONS JOB LAUNCHING: Whether or not to tell mpiexec to spawn processes in local session or via remote job launcher. The default setting is "Bypass mpich daemon on localhost", which will add the localonly command line option and skip the host command line options (only if the host name is localhost). The setting "Standard", adds the argument -host <IP/ Hostname>. The last setting "Bypass mpich on localhost" will exclude mpich entirely. USE PROCESSOR BINDING: Tells mpiexec to specify which CPU each process will run on, when mpiexec supports it. On Windows, it adds the binding option with the value computed through the lumnuma class. EXTRA MPIEXEC OPTIONS: Allows the user to specify advanced options to mpiexec. If set, the specified mpiexec path is used instead of the default mpiexec co-packaged with the software. SUPPRESS ANY DEFAULT MPIEXEC OPTIONS: removes the default arguments in the mpiexec command SET MPIEXEC ENGINE PATH: Allows the user to specify the path to their mpi executable. PRODUCT OPTIONS CREATE LOG FOR ALL PROCESSES: Each parallel process will create a log file. Adds the logall command line option.

2003 - 2012 Lumerical Solutions, Inc

132

Reference Guide EXTRA COMMAND LINE OPTIONS: Allows the user to specify advanced options to engine. Appends the text immediately after the engine command. SET ENGINE PATH: Allows the user to specify path to product engine. If set, the specified path is used instead of the default path which is relative to the executable binary. The bottom window displays the final command which will be used to run the simulation.

7.2

Running a simulation
When the simulation setup is complete and the resource setup passes the configuration

tests, it is time to run the simulation. Clicking on the RUN button in the toolbar will launch the job monitor window with the simulation already running. If you have not already saved your simulation, you will be prompted to do so. The simulation project file must be saved in order to run after which the data can then be analyzed. The job monitor window allows you to see the status of your jobs, as well as allowing you to pause or quit the jobs. Errors that occur during the simulations are displayed here.

Job Manager The elements of the job monitor window are as follows: ENGINE: Shows which computational resource is being used. The name is specified by the user. STATUS: Shows the state of the job. e.g. running, paused, finished PROJECT FILE: Shows the location of the file that is being simulated. MAX TIME REMAINING: Indicates the maximum REAL time, in hours, minutes and seconds, that you have remaining. It is based on the time taken thus far and the simulation time (in fs) set in the simulation object. AUTOSHUTOFF LEVEL: Shows the total energy left in the simulation region and is useful for monitoring how close the simulation is to reaching the auto-shutoff MAX value (set in the simulation object). PROGRESS: Shows the percentage of the time taken so far as compared to the maximum time remaining. QUIT & SAVE: Stops the simulations and saves the data obtained up to that point. The program will be in Analysis mode.

2003 - 2012 Lumerical Solutions, Inc

Running simulations and analysis

133

QUIT & DON'T SAVE: Stops the simulations and does not save any data. The program will be in Layout mode. FORCE QUIT: Closes the job monitor window and forcefully terminates all simulations. This option should ONLY be used when the other Quit options don't work properly. When simulations are stopped with Force Quit, they may not check-in their license, which means you may have to wait several minutes before another simulation can be run. No simulation data will be saved. TOTAL PROGRESS BAR: The progress bar indicates how much of ALL the simulations are complete, with the length of the progress bar is determined by the sum of the maximum simulation times. To access actions for each job, right-clicking anywhere on the row will bring up a context menu with the following options: PAUSE: the engine is signaled to go into a wait mode (it will stay running, but not consume CPU) CONTINUE: restarts a paused job QUIT AND SAVE: The engine will stop the current simulation job and attempt to save the data created so far. QUIT AND DON'T SAVE: The engine will stop the current simulation job and does not save any data. FORCE QUIT: Forcefully terminates the current simulation job and does not save any data. This options should ONLY be used when other Quit options don't work properly. When simulations are stopped with Force Quit, they may not check-in their license, which means you may have to wait several minutes before another simulation can be run. VIEW JOB DETAILS: Opens up a modal dialog that contains the standard output messages from the engine processes. Note: More information For more information about running Lumerical simulations, including running on clusters, using a job scheduler, preparing batch files, and using extra engine licenses, see the Online Help section User Guide - Running Simulations.

7.3

Analysis tools
This section describes the way in which the integrated analysis routines are used to visualize and analyze simulation data. The manner in which the analysis routine interacts with the overall simulation environment is described in the next section: Analysis tools and the simulation environment 134 . This is followed by sections to familiarize the user with the operation of the analysis routines. The first section entitled Analysis groups 134 describes the analysis tab of an analysis object. In the second section, the two general ways in which data can be visualized and

2003 - 2012 Lumerical Solutions, Inc

134

Reference Guide analyzed is detailed. The plotting functions, a central component to the overall analysis routines, are described in Figure windows 136 section. The section entitled Data export 138 describes data can be exported to plot in other software packages for further analysis or formal presentation. Finally, the Visualizer 139 and Results View 142 tools are explained. Together, they provide a very useful and intuitive way of analyzing and visualizing results through the GUI. More advanced analysis can be performed with the extensive scripting language, as described in the Scripting language 155 section.

7.3.1 Analysis tools and the simulation environment


Before describing how the analysis routines are used for data visualization, it is important to understand the way in which the integrated analysis tool interacts with the simulation environment. Following the completion of a simulation, the simulation data is written into the simulation project file; even premature termination of a simulation results in a partial dataset being written to the file. When the simulation completes and the EXIT button is pressed, or the simulation is prematurely terminated by pressing the EXIT button, the project file will be in Analysis mode, meaning that any modification of the data will require switching back to the layout mode. In Analysis mode, simulation object properties can be viewed, but not edited. This ensures that at any given time, the simulation data results corresponds to the configuration of the simulation project. Once in the analysis tool, the user continues to analyze the simulation data until they either wish to close the application, or they decide they would like to alter the simulation objects and re-perform the simulation. By exiting the analysis routines and returning to the layout editor, existing simulation data will be erased.

7.3.2 Analysis groups


Analysis groups are container objects that can contain any simulation object and associated script functions which can be used to create customize data analysis. For example, an absorption monitor group can be created with a power monitor, an index monitor, and the script function that calculates absorption from these objects. One can also automate an optimization/parameter sweep procedure using an analysis group made of structures/simulation regions/sources/monitors, and use the script function to update each parameter accordingly. An example of the edit window for an analysis group is shown in the screenshot below.

2003 - 2012 Lumerical Solutions, Inc

Running simulations and analysis

135

As can be seen above, there is a SETUP tab and an ANALYSIS tab. The SETUP tab contains all the information needed to edit and set up monitors that are located in the analysis group. The functionality of the SETUP tab is very similar to the Structure groups object. It is only possible to edit information in the SETUP tab in layout mode, but information in the SCRIPT tab can be edited both in layout and analysis mode (see the note at the top of the window which is highlighted in yellow). The ANALYSIS tab contains all the information used to analyze the monitor data. It is divided into two sub-tabs. The VARIABLES tab contains all input parameters in the top half, and the output parameters (named results) in the bottom half. Parameters can be added and removed using the respective buttons. Any changes to the variables can be saved using the SAVE ANALYSIS button at the bottom of the tab. The RUN ANALYSIS button runs the analysis script located in the SCRIPT tab. Once an analysis routine has run, the results (output parameters) become monitor data, which can be accessed from the script prompt or a script file in the same manner that monitor data is accessed for simple monitors.

2003 - 2012 Lumerical Solutions, Inc

136

Reference Guide A screenshot of the contents of the SCRIPT tab is given below. There is a section of the window that contains the analysis script and a section that contains the results of the analysis script once the RUN ANALYSIS button has been pressed. Note that the script below computes the output parameter. Since the script contains the script command to print the results to the screen, i.e. "?", the value computed for the output parameter is printed in the Analysis Script Output portion of the window.

More information concerning Analysis groups is available in the User Guide section of the Online Help.

7.3.3 Figure windows for plots and images


Simulation results can be visualized from the Object tree or Results viewer. The scripting language can also be used to visualize simulation results and other data. Plot Image

2003 - 2012 Lumerical Solutions, Inc

Running simulations and analysis

137

All of the figure windows support the same zoom functionality as in the layout editor. The left button zooms in by a factor of two, the right button zooms out by a factor of two, pressing and holding the left-hand mouse button results in a zoom window, and doubleclicking either mouse button scales the plot to show all of the data. The figure window also has functions that are accessible from the top menu, which contains the FILE and SETTING. The FILE submenu contains the following items: EXPORT TO JPEG: Opens a file browser and to select a filename for a jpeg copy of the current view of the figure. A window will pop up asking for the figure resolution. The SETTING submenu contains the following items: Common for Plot and Image: AXIS: Allows the following axes properties to be set o SET AXIS LIMITS(Ctrl+A): Opens a GUI window that allows the min and max values to be set for both the x and y axes. The initial values correspond to the current view of the figure. o INVERT AXIS(Ctrl+V): A check box that allows the axis to be inverted: the vertical axis is drawn on the horizontal and vice versa. COLOR MAP: Allows you to choose between a color image (Ctrl+C)or a grey-scale figure (Ctrl+G). SET TITLE(Ctrl+T): allows you to set the x label, y label, and the title of the plot. Plot specific SET LEGEND(Ctrl+L): Allows you to set the legend and its position. Image specific COLOR BAR: o SET COLOR BAR LIMITS (Ctrl+B): Opens a GUI window that allows the min and max values to be set for both the color bar. The initial values correspond to the current view of the figure. Any data values larger than the maximum are displayed at the color (or grey-scale) of the maximum, and similarly for the minimum. This allows for over-

2003 - 2012 Lumerical Solutions, Inc

138

Reference Guide saturation of the colors to emphasize certain regions of the image, or for more accurate comparison between two images. o RESET DEFAULT LIMITS(Ctrl+D): Resets the original limits. This corresponds to the minimum and maximum values of the data being imaged.

7.3.4 Data export


In some cases, the user may wish to export the simulation data to take advantage of the advanced plotting and data analysis tools not available in Lumerical's products. Data export can be done in a number of ways, but in general the use of the scripting language will be required. The user can use scripting commands as described in the Scripting language 155 section to write data into text format, or alternatively use Matlab by directly calling Matlab functions in Lumerical or by exporting data to .mat files. Export to text files The data subset export facility in the analysis view allows the user to save to a specified filename, a subset of the total simulation data for quick plotting in other software packages. For x-y plots, the data subset export facility generates a two-column ASCII data file, with a header which specifies where the data was taken from and the column headings with units. For image plots, the data subset consists of two columns which specify the x and y positions in the units specified within the CAD layout editor, and a matrix of data which consists of the field quantities being exported. The user may also write a script file and utilize the write 175 script function to custom create a text file. Matlab MATLAB has a number of specialized plotting functions useful for visualizing simulation data. For example, contour plot or vector plot, which are not available in the Lumerical solutions products but found in MATLAB, are suitable for visualizing the electric field or power flow. Lumerical products provide two interfaces for users wishing to use MATLAB in their analysis: 1. The first option allows MATLAB commands to be called directly from within the scripting environment. Data can be moved between the Lumerical workspace and MATLAB workspace, so the user can take advantage of the combined functionality provided by both programs. This is accomplished by using the script commands, matlab 179 , matlabput 181 , and matlabget 181 . To use this option, both the Lumerical product and MATLAB must be installed on the same computer. 2. The second option allows simulation data to be exported to MATLAB .mat files for subsequent data analysis in MATLAB. For more information, see the matlabsave 179 command. The Lumerical Solutions Online Help provides an example of how each option can be used. See the User Guide - Scripting language section. MATLAB is a registered trademark of The Mathworks, Inc.

2003 - 2012 Lumerical Solutions, Inc

Running simulations and analysis

139

7.3.5 Visualizer
The Visualizer is a tool for analyzing data. Any object that contains data (ex. monitors, parameter sweeps, analysis groups ... etc) can have its contents sent to an existing Visualizer or a new Visualizer. Data that gets added to the Visualizer is retained until it is removed (ie. with the "Remove" button or by pressing "X" on the top right corner of the window). This is useful for comparing results across different data sets. The upper portion of the window is the plot area, which displays the current data defined by the settings in the lower portion of the window. The following sections describe the many options available for controlling what data will be displayed in the plot area. These sections can be minimized if more area for plotting is required. Visualizer settings 140 Visualizer attributes 141 Visualizer parameters 141

Visualizer

2003 - 2012 Lumerical Solutions, Inc

140

Reference Guide

7.3.5.1 Visualizer settings

The settings control the overall type of plot and the labels applied to it.

1D Line plot: plot data as a line or curve 2D Image plot: plot data on a 2D plane with a color bar representing the value of the data Plot: refresh the plot window with the current settings Auto Plot: automatically update the plot window as the settings change Title: add a title to displayed on the plot Y Label: add a vertically oriented label to the y-axis Export JPEG: saves the current plot to a jpg image Log 10: plot data on a log scale Legend: display the legend in the specified position. The legend labels are defined in the table of attributes Plot in new window: creates a new window with a snapshot of the current plot View data: allows users to view the data in a table format as shown below

2003 - 2012 Lumerical Solutions, Inc

Running simulations and analysis

141

In this table format, users can select any portion of the data and "Copy" or "Export" it into a text file. Alternatively, users can also send any portion of the data into the Script Workspace 144 .
7.3.5.2 Visualizer attributes

An attribute is a set of information derived from a particular data set. One data set can have multiple attributes, and conversely, multiple data sets can have the same attributes. While in the table, entries can be duplicated and applied with different operations and properties. They will remain in the table until they are removed. Changing a simulation from analysis back to layout does not delete existing entries.

When we select a result of an object to visualize (by right-clicking), the result is added to the data set list with the chosen attributes. Also, multiple selected objects can be sent to a Visualizer at the same time as shown in the screenshot below. DATA SET: the collection of data from the monitors, frequency sweeps, and other objects ATTRIBUTE: information derived from a particular data set e.g. (a frequency monitor data set can have E, H, and transmission as attributes) VECTOR OPERATION: selects a particular component of a vector attribute e.g. (Ex, Ey, | E|^2) SCALAR OPERATION: selects a particular component of a scalar attribute e.g. (real, imag, abs, angle) SCALE: multiplier for the data being plotted LEGEND: this name will be shown in the legend of the plot NOTES: additional information added by the user about the attribute
7.3.5.3 Visualizer parameters

In addition to the attributes, data sets also contain plotting parameters. The parameters control which portion or 'slice' of the attributes is displayed as well as the numerical range of the axis. It allows control over the x-axis for line plots and both x and y axes for image plots.

2003 - 2012 Lumerical Solutions, Inc

142

Reference Guide

ATTRIBUTES: the attribute that the parameter belongs to PARAMETERS: name of the parameter that will be used to plot the attribute ACTION: describes how the parameter affects the plot. If an action exists, then a panel to the right will display the various options associated with that action VALUE: displays the value if it is a singular value or is blank if there is a vector of values Plotting multi-dimensional matrices

When the available axes are already assigned to certain parameters, additional parameters are assigned the action 'slice'. When selected, this panel to the right shows a slider and information about the position of the slider. Moving the slider will update the plot in real time (if the auto-plot option is checked) and can be used to step through slices of the matrix data.

7.3.6 Results Manager


The Results Manager is a tool for analyzing simulation data. The Results View 143 window shows all the results for the simulation object that is currently selected in the Object Tree. The Script Workspace and Script Favorites 144 windows work in conjunction with the scripting environment to provide additional GUI-based functionalities. When used in conjunction with the Visualizer 139 , the Results Manager provides a very useful and intuitive way of analyzing and visualizing variables and results through the GUI.

2003 - 2012 Lumerical Solutions, Inc

Running simulations and analysis


7.3.6.1 Results View

143

The Results View 143 window shows all the results for the simulation object that is currently selected in the Object Tree. Any simulation object that have results will be displayed with a symbol on the bottom-right corner.

The name of the available results, and the corresponding dimensions or are displayed. One can right click on any of the results to display them in the Visualizer 139 , or to send the to the Script Workspace 144 for further post-processing. FDTD Solutions 8.0 introduces the use of datasets, allowing one to package raw data into meaningful results that can be easily parameterized and visualized. The results for all the standard monitors in FDTD Solutions can be retrieved in the original raw, un-parameterized matrix form (using getdata, as in FDTD 7.5), or in dataset form (using getresult). For example, in the Results View figure above, the results listed under rawdata can be obtained using the getdata command. The results listed under "results" are datasets, and can be obtained using the getresult command (these calculations will only be carried out when they are visualized). The icons associated with each result reflect the type of result: Matrix : this is a simple matrix result, with no associated parameters Matrix dataset: this is a parameterized matrix results that contains at least an attribute (result), and a associated parameter

2003 - 2012 Lumerical Solutions, Inc

144

Reference Guide Rectilinear dataset: this is a parameterized matrix result that is associated with a rectilinear grid String For more detail on how to work with datasets in the scripting environment, please see Accessing simulation data in the User Guide. Analysis group objects from the Object library have been updated to return datasets. For an example of how to define dataset results in an analysis group, please see Using analysis groups. The raw data results are all un-parameterized, simple matrix results. To create parameterized matrix datasets from matrices, use the "Send to script" option to copy the variable into the Script Workspace, and follow the instructions here 144 .

7.3.6.2 Script Workspace and Script Favorites

The Script Workspace shows all the variables in the current scripting environment. The variables' current values as well as the corresponding dimensions are shown in a list format. Users can use the Visualizer 139 to visualize any variable listed in the Script Workspace by right-clicking on the variable and selecting "Visualize".

The icons in the script workspace above shows that while "sigmaabs" and "sigmascat" are parameterized matrix datasets (since they were the results returned directly by the cross section analysis groups), "sigmaext" is a result that we defined in the script, and is therefore a simple un-parameterized matrix. For example, simply right-clicking on sigmaext and selecting "Visualize" will generate the following plot in the Visualizer:

2003 - 2012 Lumerical Solutions, Inc

Running simulations and analysis

145

Here, the extinction cross section is plotted as a function of the index value. To associate it with the corresponding frequency array, select the "Create visualization" option, which will open the "Visualization Creator" dialog window:

This window allows users to set the name of the parameterized variable (sigmaext_vs_f) and its parameters (f). Once this is defined, the visualization creator will generate the commands necessary for creating the parameterized dataset in the Script Favorites window. When this command is ran, it will send the new parameterized variable to the Visualizer, which will plot the variable as a function of the user specified parameter. Generated Command Generated Figure

2003 - 2012 Lumerical Solutions, Inc

146

Reference Guide

In addition to the commands generated by the visualization creator, the Script Favorites window also allows users to define their own favorite commands by selecting "New command" and "Edit".

7.4

Optimization and parameter sweeps


This section describes the way in which the optimization and parameter sweeping projects are set up. This is a powerful feature of Lumerical Solutions software and allows users to automate the process of finding desirable parameter values by running a large number of simulations. Prior to the current version, the majority of these procedures could only be carried out through the scripting environment. While these scripting options will still be available in the current version, users now have the additional option of automating the entire process through the GUI. An example Optimization and Sweeps tab is shown in the screenshot below:

2003 - 2012 Lumerical Solutions, Inc

Running simulations and analysis At the top of the window is a toolbar containing the following buttons: Creates a parameter sweeping project. Creates an optimization project. Opens an edit window for the selected project where one can modify its properties. Deletes the selected project. Runs the selected sweep or optimization with the resources currently set in the resource manager.

147

The Animate function allows you to view the structures that will be simulated in a parameter sweep or optimization in the CAD before you run the project:

2003 - 2012 Lumerical Solutions, Inc

148

Reference Guide

7.4.1 Optimization
An example Edit Optimization window is shown in the screen shot below:

The optimization project allows users to use built-in algorithms as well as define their own optimization algorithms. For examples on how to set up and run an optimization project, please see Optimize a design. As can be seen from the screenshot above, there is a SETUP tab as well as an ADVANCED tab. Setup Tab There are three sections in the setup tab: OPTIMIZATION CONFIGURATION: This section contains the choice of algorithm as well as all the input parameters that are needed to set up an optimization project using a built-in algorithm: ALGORITHM: The optimization algorithm used for this project PARTICLE SWARM: The built-in particle swarm algorithm (see Particle Swarm Optimization 150 for more details on the algorithm). USER DEFINED: The user-defined algorithm specified in the ADVANCED TAB. TYPE: Choice of maximizing or minimizing the figure of merit MAXIMUM GENERATIONS: The maximum number of generations for this optimization project. GENERATION SIZE: The generation size (number of child per generation) for this

2003 - 2012 Lumerical Solutions, Inc

Running simulations and analysis

149

optimization project. RESET RANDOM GENERATOR: If this option is selected, the random generator is reset to the same initial condition. Otherwise a new initial condition is chosen every time this optimization project is run. TOLERANCE: The convergence criteria for the optimization to terminate. If set to 0, the optimization will run until the maximum number of generations has been reached. PARAMETERS: This section contains the optimization parameters and the range of values used for this project. One can ADD/REMOVE parameters via the buttons on the right. The parameters can be chosen from the simulation model by double-clicking on the selected parameter field. The types, min/max values and units of the selected parameters can also be set in a similar fashion. FIGURE OF MERIT: This section contains the figure(s) of merit (FOM) used for this project. One can ADD/ REMOVE FOMs via the respective buttons. FOMs are typically defined as output variables of monitors or analysis groups, which can be selected from the simulation model by double-clicking on the selected FOM field. Once the FOMs have been defined, one can select the FOM to be used in this project by clicking SELECT TO OPTIMIZE (note that all other FOMs will be ignored in this optimization). Advanced Tab The ADVANCED tab is shown in the screen shot below:

2003 - 2012 Lumerical Solutions, Inc

150

Reference Guide

This tab allows users to define their own optimization algorithm, and is only editable if the USER DEFINED option is selected in the SETUP tab. The Advanced tab is divided into two sub-tabs: USER DEFINED ALGORITHM: This tab contains the scripts which define the customized optimization algorithm (by specifying the first and next generation scripts). The SCRIPT OUTPUT shows the output of a test which runs the user defined algorithm with an analytical function. If there are no syntax errors in the script, you will see the line <script complete> in the script output, otherwise the location of the error will be given. This test is conducted every time the TEST button is pressed, and a window showing the Optimization Status is displayed. FIGURE OF MERIT SCRIPT: This tab contains the script which defines the custom FOM. To enable this window, select the USER FIGURE OF MERIT SCRIPT checkbox. The only variables that can be used in this script are the ones that are defined in the FOM section of the SETUP tab. For an example that uses a user-defined optimization algorithm, see User Guide.

7.4.2 Particle Swarm Optimization


Particle Swarm Optimization (PSO) is a population based stochastic optimization technique, inspired by the social behavior of flocks of birds or schools of fish [1,2], and has widely been used for various kinds of design optimization problems [2] including nanophotonic design [3-7]. In PSO, the potential solutions, called particles, are initialized at random positions, and then move within the parameter search space. The particles are subject to three forces as they move: 1. Spring force towards the personal best position, p, ever achieved by that individual particle 2. Spring force towards the global best position, g, ever achieved by any particle. 3. A frictional force, proportional to the velocity. The algorithm then follows these steps 1. Set the number of particles N and initialize the positions x 2. Evaluate figures of merit (FOM) and find p and g 3. Calculate the new velocities v for each particle based on the forces applied to the particle

vt

vt

c1

pt

xt xt

c2 xt

gt

xt

1 vt

(1)

4. Update the positions x of each particle based on the velocity


1

vt

(2)

5. Repeat from step 2 until convergence is achieved

2003 - 2012 Lumerical Solutions, Inc

Running simulations and analysis In Eq. (1), t is the iteration counter; c 1 and c 2 are the cognitive and social factors,

151

respectively; is called the inertial weight; and 1 and 2 are random number between 0 and 1. Lumerical's PSO implementation uses default values of c 1, c 2 and that have shown to converge well in many test optimization problems for photonic design problems. A detailed description of the algorithm and the difference coefficients can be found in Refs. [1] or [2]. J. Robinson and Y. Rahmat-Samii, "Particle swarm optimization in Electromagnetics," IEEE Trans. Antennas and Propagat. 52, pp.397 - 407 (2004). 1. K. E. Parsopoulo and M N. Vrahatis, Particle swarm optimization and intelligence : advances and applications, Information Science Reference, 2010. 2. J. Pond and M. Kawano, Virtual prototyping and optimization of novel solar cell designs, Proc. SPIE 7750, 775028 (2010), DOI:10.1117/12.873114 3. M. Kawano and J. Pond, "Design Optimization of Photonic Crystal Organic Solar Cells using the FDTD method in Combination with Particle Swarm Optimization," 7th International Conference on Optics-photonics Design & Fabrication, Yokohama, Japan, 19S1-14, 2010. 4. J. G. Mutitu, S. Shi, C. Chen, T. Creazzo, A. Barnett, C. Honsberg and D. W. Prather, "Thin film silicon solar cell design based on photonic crystal and diffractive grating structures", Opt. Express 16, 5238, 2008 5. M.Shokooh-Saremi and R. Magnusson, "Leaky-mode resonant reflectors with extreme bandwidths," Opt. Lett. 35, 1121, 2010. 6. R. Magnusson, M. Shokooh-Saremi,and E. G. Johnson, Guided-mode resonant wave plates, Opt. Lett. 35, 2472, 2010.

2003 - 2012 Lumerical Solutions, Inc

152

Reference Guide

7.4.3 Parameter Sweeps


An example Edit Parameter Sweep window is shown in the screen shot below:

For examples on how to set up and run a parameter sweep project, please see Run a parameter sweep. There are two sections in the Edit Parameter Sweep window: PARAMETERS: This section contains all the input parameters that are needed to set up a parameter sweep project. There are two ways to specify the inputs to the parameter sweep. If RANGES is selected, the table above is shown. One can ADD/REMOVE parameters via the respective button on the right. The parameters can be chosen from the simulation model by doubleclicking on the selected parameter field, and the types, min/max values and units of the selected parameters can be set in a similar fashion. If VALUES is selected, the following table is shown:

2003 - 2012 Lumerical Solutions, Inc

Running simulations and analysis

153

The behaviour is similar to the description for the RANGES option above, except here every value of the parameter is shown explicitly and can be edited one-by-one. Pressing the SET IN MODEL button automatically sets the parameters in the simulation model to have the same value as the selected one. NOTE: If two or more parameters are specified, they must have the same dimensions. Each sweep step will update all parameters values one column at a time (ie. this is not the same as nested parameter sweeps). For information on how to set up nested parameter sweeps, please see Nested Sweeps 153 . RESULTS: This section contains all the outputs from the parameter sweep.

7.4.4 Nested Sweeps


It is also possible to use nested parameter sweeping. To add, simply right click on the current optimization or sweep and select "Insert parameter sweep". Examples can be found in the User Guide as well as in the application examples.

2003 - 2012 Lumerical Solutions, Inc

154

Reference Guide

2003 - 2012 Lumerical Solutions, Inc

Scripting Language

155

Scripting Language
Lumerical provides a powerful scripting language to manipulate simulation objects, launch simulations and analyze results. Script commands can be entered directly into a script prompt, be run from a saved script file, or entered into a group object. Group objects run setup scripts every time they are edited, and scripts when these are called. This section of the Reference Guide contains the syntax for all the script commands. There is also a Scripting section in the User Guide in the online help which contains an introduction to the scripting language, some examples showing how to export to other file formats and tips for plotting in MATLAB. The script functions have been organized into the following sections. Section System 156 Manipulating variables 182 Operators 192 Functions 205 Loop and conditional statements 251 Plotting commands 252 Adding Objects 261 Manipulating objects 282 Running simulations 316 Measurement and optimization data 347 FDTD Measurements and Normalization 320 Near to far field projections 358 Grating projections 376 Material database functions 385 User defined GUIs 392

2003 - 2012 Lumerical Solutions, Inc

156

Reference Guide Creating your own script commands 398 The online help version of the Scripting Language section includes examples for many of the script functions.

8.1

System
System commands for interacting with the OS file system, running script files, etc. System commands Command new2d 159 new3d 159 newmode 160 save 161 load 161 del 162 rm 162 ls 163 dir 162 cd 163 pwd 164 cp 164 mv 165 exit 165 system 166 fileexists 166 currentfilename 167 filebasename 167 filedirectory 168 fileextension 168 List of script commands Description Creates a new 2D FDTD layout environment. Creates a new 3D FDTD layout environment. Creates a new MODE layout environment. Saves an fsp file or lms file. Loads an fsp file or lms file. Deletes a file. Lists the files in a directory. Changes the working directory. Returns the current working directory. Copy a file. Move a file Exit the application. Run command prompts. Check if a file exists. Get the current filename. Get the file base name from a string. Get the file directory from a string. Get the file extension from a string.

2003 - 2012 Lumerical Solutions, Inc

Scripting Language Command getcommands 169 Starting and stopping scripts Command running a script 169 getpath 170 addpath 170 which 171 pause 171 break 172 ESCAPE key 172 Description Type the script name to run it. Get the current path. Add a directory to the path. Where in the path is a file. Pauses program for a time. Will stop a script file from executing at that line. Description Returns a list of available script commands

157

To interrupt a script file from running or a long block of commands from executing

File input and output Command format 173 STD OUT write 175 LDF files loaddata 173 savedata 174 savedcard 174 Text files readdata 175 write 175 fld (field) files asapexport 176 asapload 176 Export monitor data to fld file. Load data from fld file. Read text files. Writes strings to text files or to standard output. Load variables or d-card data from ldf file. Save variables to ldf file. Saves d-card data to an ldf file. Writes strings to text files or to standard output. Description Set the precision of the script interpreter.

2003 - 2012 Lumerical Solutions, Inc

158

Reference Guide asapimport 177 Debugging Command debug 182 See Also exportfigure 260 , load 161 , save 161 MATLAB functions Command matlabsave 179 matlab 179 matlabget 181 matlabput 181 Description Save workspace data to a Matlab .mat file. Execute a MATLAB command Get a variable from the MATLAB workspace Send a variable to the MATLAB workspace Description Opens the debug utility window. Import data from fld file to Import source.

8.1.1 newproject
Create a new simulation project file. Syntax newproject; newproject(option); Description Creates a new 2D layout environment. This function does not return any data. The options are 1: use default file and material database as template 2: use current file and material database as template 3: open a file browser to select and existing file as a template The default option is 1.

See Also System level 156 , new3d 159 Available in

2003 - 2012 Lumerical Solutions, Inc

Scripting Language FDTD Solutions MODE Solutions INTERCONNECT DEVICE Version 8+ Version 6+ Yes Yes

159

8.1.2 new2d
Creates a new 2D FDTD Solutions layout environment. Syntax new2d; new2d(option); Description Creates a new 2D layout environment. This function does not return any data. The options are 1: use default fsp file and material database as template 2: use current fsp file and material database as template 3: open a file browser to select and existing fsp file as a template The default option is 1.

See Also System level 156 , new3d 159 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Deprecated in Version 8. Use newproject. No No No

8.1.3 new3d
Creates a new 3D FDTD layout environment. Syntax new3d; new3d(option); Description Creates a new 3D layout environment. This function does not return any data. The options are 1: use default fsp file and material database as template 2: use current fsp file and material database as template

2003 - 2012 Lumerical Solutions, Inc

160

Reference Guide 3: open a file browser to select and existing fsp file as a template The default option is 1. See Also System level 156 , new2d 159 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Deprecated in Version 8. Use newproject. No No No

8.1.4 newmode
Creates a new MODE layout environment. Syntax newmode; newmode(option); Description Creates a new layout environment. This function does not return any data. The options are 1: use default lms file and material database as template 2: use current lms file and material database as template 3: open a file browser to select and existing lms file as a template The default option is 1.

See Also System level 156 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE No Deprecated in Version 6. Use newproject. No No

2003 - 2012 Lumerical Solutions, Inc

Scripting Language

161

8.1.5 save
Saves an simulation project file. If the simulation has been run, the file will also contain the simulation results. Syntax save; save(filename); Description Open a file browser to save the file. This function does not return any data. Save with the specified name

See Also System level 156 , load 161 , loaddata 173 , savedata 174 , savedcard 174 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.1.6 load
Loads an simulation project file. If the simulation has been run, the file will also contain the simulation results. Syntax load(filename); Description Loads the simulation file. This function does not return any data.

See Also System level 156 , loaddata 173 , save 161 , savedata 174 , savedcard 174 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

2003 - 2012 Lumerical Solutions, Inc

162

Reference Guide

8.1.7 del
Delete a file. Syntax del("filename"); rm("filename"); See Also System level 156 , delete 285 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes Description Deletes the file "filename". This function does not return any data.

8.1.8 rm
Delete a file. Syntax del("filename"); rm("filename"); See Also System level 156 , delete 285 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes Description Deletes the file "filename". This function does not return any data.

8.1.9 dir
List files in a directory. Syntax out = dir; Description The output is a string.

2003 - 2012 Lumerical Solutions, Inc

Scripting Language out = ls; out = dir("directory"); out = ls("directory"); See Also System level 156 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes Use ?dir; to write the value to the screen. Lists the files in the specified directory.

163

8.1.10 ls
List files in a directory. Syntax out = dir; out = ls; out = dir("directory"); out = ls("directory"); See Also System level 156 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes Description The output is a string. Use ?dir; to write the value to the screen. Lists the files in the specified directory.

8.1.11 cd
Change directory. Syntax cd; Description Opens a window to browse to a directory. This function does not return any data.

2003 - 2012 Lumerical Solutions, Inc

164

Reference Guide cd("directory"); Changes the working directory to "directory". Whenever you open an fsp file or run a script file, it will set the working directory to the directory of the file opened.

See Also System level 156 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.1.12 pwd
Returns the current working directory. Syntax out = pwd; Description Returns the current working directory as a string.

See Also System level 156 , currentfilename 167 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.1.13 cp
Copy a file. Syntax cp("file1","file2"); cp("path1\file1","path2 \file2"); See Also Description Makes a copy of file1 called file2. This function does not return any data. Copies file1 in path1 to file2 in path2.

2003 - 2012 Lumerical Solutions, Inc

Scripting Language System level 156 , mv 165 , pwd 164 , copy (objects) 290 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

165

8.1.14 mv
Move a file. Syntax mv("file1","file2"); cp("path1\file1","path2 \file2"); Description Moves file1 to file2. This function does not return any data. Moves file1 in path1 to file2 in path2.

See Also System level 156 , cp 164 , pwd 164 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.1.15 exit
Exit the application. Syntax exit; exit(option); Description Exits the application. Same as exit(1); This function does not return any data. Exits the application. The option can be 1: Prompt user if a file needs saving before exiting. 2: Force the application to exit without prompting the user. The default option is 1.

2003 - 2012 Lumerical Solutions, Inc

166

Reference Guide See Also System level 156 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.1.16 system
The system command allows you to have the operating system (OS) execute a command, rather than the Lumerical script interpreter. The system command does not return any data. Syntax system("command"); See Also System level 156 , readdata 175 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes Description Run "command" at the OS command prompt.

8.1.17 fileexists
Check if a file exists. The file extension must be specified. By default, the entire path will be searched. Syntax out = fileexists("filename"); out = fileexists("c:\temp\file. txt"); Description Returns 1 if the file exists Returns 0 if the file does not exist. Search for a file not in the path

See Also System level 156 , getpath 170 , which 171 , pwd 164
2003 - 2012 Lumerical Solutions, Inc

Scripting Language

167

Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.1.18 currentfilename
Get the current filename and directory. Syntax out = currentfilename; Description Returns the current filename as a string. If the current filename is not defined, this function returns an empty string "".

See Also System level 156 , fileexists 166 , getpath 170 , which 171 , pwd 164 , fileextension 168 , filebasename 167 , filedirectory 168 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.1.19 filebasename
Get the file basename from a string. Syntax out = filebasename ( "location/filename.ext" ); Description Returns the file basename as a string.

See Also System level 156 , currentfilename 167 , getpath 170 , which 171 , pwd 164 Available in

2003 - 2012 Lumerical Solutions, Inc

168

Reference Guide FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.1.20 fileextension
Get the file extension from a string. Syntax out = fileextension( "name. ext"); Description Returns the file extension as a string.

See Also System level 156 , currentfilename 167 , getpath 170 , which 171 , pwd 164 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.1.21 filedirectory
Get the file directory from a string. Syntax out = filedirectory( "location/ filename.ext" ); Description Returns the file directory as a string.

See Also System level 156 , currentfilename 167 , getpath 170 , which 171 , pwd 164 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

2003 - 2012 Lumerical Solutions, Inc

Scripting Language

169

8.1.22 getcommands
Returns the list of available script commands in the current script workspace. Syntax ?getcommands; See Also System level 156 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes Description Returns a list of available script commands

8.1.23 Run script


Run a script by typing its name. The file must be in the current path. The path always searches the current directory first. A script file is not passed variables, and does not return variables. All scripts have access to all of the variables defined in the current workspace. It's best to avoid using the names of Lumerical script functions (i.e. plot) for the names of your script files. If a script file has the same name as a function, the script will be run (not the function). This allows you to effectively re-define the behavior of a function, but it can cause confusion when done unintentionally. Syntax filename; Description Run the script file filename.lsf, if it exists in the current path. A script does not have a return type.

See Also System level 156 , getpath 170 , addpath 170 , which 171 Available in

2003 - 2012 Lumerical Solutions, Inc

170

Reference Guide FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.1.24 getpath
Get the current path. By default, the current working directory and the script sub-directory of the installation (eg. C:\Program Files\Lumerical\FDTD\scripts) are in the path. Syntax out = getpath; Description Returns the current path as a string. Use ?getpath; to print it to the screen.

See Also System level 156 , addpath 170 , which 171 , pwd 164 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.1.25 addpath
Add a directory to the path. Syntax addpath("directory"); Description Adds a directory to the path. This function does not return any data.

See Also System level 156 , getpath 170 , which 171 , pwd 164 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

2003 - 2012 Lumerical Solutions, Inc

Scripting Language

171

8.1.26 which
Returns the full file pathname for the specified file. This function can be helpful when you have added several directories to the Lumerical path variable and you want to check which files are being accessed. Syntax out = which("filename"); Description Returns the pathname of the file "filename" as a string. Use ?which("filename"); to display the result to the screen.

See Also System level 156 , getpath 170 , addpath 170 , pwd 164 , currentfilename 167 , fileexists 166 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.1.27 pause
Pause program for a time. Hit the space bar to force the script to continue. Hit the ESCAPE key to break the script at this point. Syntax pause(time); Description Pauses script for time, measured in seconds. This function does not return any data.

See Also System level 156 , break 172 , ESCAPE key 172 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

2003 - 2012 Lumerical Solutions, Inc

172

Reference Guide

8.1.28 break
Stops a script from executing. Syntax break; Description Will stop a script file from executing at that line. A warning will be generated. This function does not return any data.

See Also System level 156 , ESCAPE key 172 , pause 171 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.1.29 Excape key


Interrupts a script or long block of commands. Syntax ESCAPE key Description To interrupt a script file from running or a long block of commands from executing. A warning will be generated. Sometimes you may need to press escape several times, or hold it down to interrupt the script.

See Also System level 156 , break 172 , pause 171 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

2003 - 2012 Lumerical Solutions, Inc

Scripting Language

173

8.1.30 format
The two format commands toggle the script interpreter between 2 output precision states. The commands print (?) and num2str() use this state to determine how many digits of precision to output. Syntax format long; format short; Description Set script interpreter to 16 digits of precision. Set script interpreter to 6 digits of precision.

See Also System level 156 , num2str 229 , ? 204 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.1.31 loaddata
Loads workspace variables or d-card data from a Lumerical data file (ldf) file. If any current variables exist with the same names as those in the file, the current values will be overwritten. Syntax loaddata("filename"); Description Reads data script variables or d-card data from the specified file. This function does not return any data.

See Also System level 156 , savedata 174 , savedcard 174 , workspace 189 , load 161 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

2003 - 2012 Lumerical Solutions, Inc

174

Reference Guide

8.1.32 savedata
Saves workspace variables to a Lumerical data file (ldf) file. To save monitor (D-card) data to an ldf file, see the savedcard function. Syntax savedata("filename"); savedata("filename", var1, var2,...); Description Saves all current variables to the specified file. This function does not return any data. Saves only variables with the specified names to file.

See Also System level 156 , savedcard 174 , loaddata 173 , workspace 189 , matlabsave 179 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.1.33 savedcard
Saves d-card data to a Lumerical data file (ldf) file. D-cards are generally used to store monitor data. Data is saved in the no norm state. See the units and normalization section of the reference guide for more information. Syntax savedcard("filename"); Description Saves all current d-cards (local and global) to the specified ldf file. This function does not return any data. Saves only the d-cards with the specified names, "name1", "name2", etc.

savedcard("filename", "name1", "name2",...);

See Also System level 156 , savedata 174 , loaddata 173 , matlabsave 179 Available in

2003 - 2012 Lumerical Solutions, Inc

Scripting Language FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

175

8.1.34 readdata
You can import numerical values stored in text files with the readdata command. This command will read a file with data in a row/column format. The data must be correctly formatted so each row has the same number of columns. Readdata will ignore any line that begins with a letter. Syntax M=readdata("filename.txt"); Description Will load the text file filename into matrix variable M. Any lines starting with a letter are ignored.

See Also System level 156 , rm 162 , write 175 , str2num 230 , findstring 232 , replace 232 , replacestring 233 , substring 231 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.1.35 write
Writes string variables to text files or to standard output. Typically the write command is used to output data to a text file. If the specified file does not exist, it will be created. If it does exist, then the output string will be appended to the end of the file. The write command will automatically add a new line character at the end of the string. On Linux systems only, the write command will output to the standard output (stdout) if a filename is not specified. Syntax write(my_string); write("testfile.txt", Description Write my_string to the standard output (linux only). Will write the contents of the string variable my_string to

2003 - 2012 Lumerical Solutions, Inc

176

Reference Guide my_string); testfile.txt. This function does not return any data.

See Also System level 156 , readdata 175 , rm 162 , num2str 229 , ? 204 , endl 204 , format 173 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.1.36 asapexport
Exports the desired monitor to a file for interfacing with BRO's ASAP. These files are called fld files. The monitor must be a frequency power or a frequency profile monitor. Syntax Description

asapexport( "monitorname"); Export data from monitorname. By default, the first frequency point is exported. This function does not return any data. asapexport( "monitorname", f); asapexport( "monitorname", f, "filename"); Exports the frequency point specified by the index f. Exports to the specified "filename" without opening a file browser window.

See Also System level 156 , asapload 176 , asapimport 177 , addimportedsource 275 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No No

8.1.37 asapload
Load data from an fld file from BRO's ASAP. asapload creates a d-card structure called "fld_data" which contains all the data in the file. If "fld_data" exists, it will be called "fld_data_2". After loading an asapfile with asapload, you can extract any desired data., which can be

2003 - 2012 Lumerical Solutions, Inc

Scripting Language Ex, Ey, Ez, Hx, Hy, Hz, x, y, z power, frequency, wavelength, index Syntax asapload; asapload( "filename"); Description Select the file to load with the file browser. This function does not return any data. Loads data from an fld file called "filename" without a file browser.

177

See Also System level 156 , asapexport 176 , asapimport 177 , addimportedsource 275 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No No

8.1.38 asapimport
Import an ASAP fld file into an ASAP source. This is equivalent to editing the properties of the Import source, and clicking on the Import Source button. Syntax asapimport( "sourcename"); Description Imports the fld file into the sourcename source. A file browser will open to select the file. This function does not return any data. Specify the file to open.

asapimport( "sourcename", "filename");

See Also System level 156 , asapexport 176 , asapload 176 , addimportedsource 275 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes No No No

2003 - 2012 Lumerical Solutions, Inc

178

Reference Guide

8.1.39 gdsimport
Import a layer from a GDSII file into the layout environment. This is equivalent to performing a GDSII import through the FILE->IMPORT menu. See the Reference Guide - Layout editor chapter for more information. Syntax n = gdsimport("filename", "cellname", layer); Description Imports the specified layer from the specified cell in the specified file into the current simulation environment. The objects created will have their material set to an object defined dielectric. In 3D, the 2D geometric data will be extruded to default values in the Z dimension. The optional returned value, n, is the number of objects that were imported from the gds file. Same as the above command, but the material of the imported object will be set to the value specified. This form of the command is only allowed in 3D layouts. The behavior is the same as the above command, but the structures will be extruded in the Z dimension to the specified z min and z max values Description name of GDSII file to import. May contain complete path to file, or path relative to current working directory the name of the cell to import from the GDSII file

n = gdsimport("filename", "cellname", layer, "material"); n = gdsimport("filename", "cellname", layer, "material", zmin, zmax);

Parameter filename

Type string

cellname layer

string

number or the layer number from the GDSII file to import. If only string elements matching a certain data type are desired, this can be specified by using a string of the form: "6:2" where the desired layer is 6 and the desired data type is 2. string a valid name of a material in your current layout environment. Partial names of materials can be matched starting at the beginning of the string. For example, "Al (3" would match "Al (300nm)". the minimum z value for extruding 2D GDSII data into

material

z min

number

2003 - 2012 Lumerical Solutions, Inc

Scripting Language 3D objects z max number the maximum z value for extruding 2D GDSII data into 3D objects

179

See Also System level 156 , setnamed 292 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No Yes

8.1.40 matlabsave
Save workspace data to Matlab .mat data files. Syntax matlabsave("filename"); Description Saves all current variables to the specified .mat file. If this command is run in analysis mode, it will also save the source and monitor data. This function does not return any data. Saves only variables with the specified names to the .mat file.

matlabsave("filename", var1, ..., varN);

See Also System level 156 , matlabput 181 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.1.41 matlab
Runs a MATLAB command from the Lumerical script prompt. This gives access to extended mathematical and visualization functionality from the Lumerical script environment. If the MATLAB script integration is not enabled, this function will return an error.

2003 - 2012 Lumerical Solutions, Inc

180

Reference Guide

The first time a MATLAB function (matlab, matlabget or matlabput) is called, a MATLAB session will be started and a connection will be established with the Lumerical scripting environment. Once this connection is established, MATLAB commands can be run using the matlab function. It is important to understand that the MATLAB and the Lumerical script variable workspaces are completely separate and independent. A MATLAB command cannot act on a variable defined in the Lumerical workspace, and vice-versa. Variables must be passed between the workspaces using the matlabget and matlabput functions. At any time you may examine the MATLAB workspace or interact with the MATLAB environment by typing commands at the MATLAB script prompt. The output from the MATLAB commands will be printed at the Lumerical script prompt. One limitation of the matlab function is that no error reporting is provided to either the Lumerical script prompt or the MATLAB prompt. MATLAB commands should be tested by typing them directly into the MATLAB prompt before they are called from a Lumerical script. When you have a long sequence of MATLAB commands, you may find it more convenient to save them in a MATLAB m-file. Then, you can simply call the m-file by running a single command. Setup instructions and system requirements for the MATLAB script integration feature can be found in the online Knowledge Base. See the Setup and Configuration section of the Installation Guide. Syntax matlab("command"); matlab(" command_1 command_2 "); Description command: a string containing one or more valid MATLAB commands. Multi-line strings can be used in script files to contain a block of MATLAB commands. Multi-line strings are not supported at the script command prompt.

See Also System level 156 , matlabget 181 , matlabput 181 Available in

2003 - 2012 Lumerical Solutions, Inc

Scripting Language FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

181

8.1.42 matlabget
Copies a variable from the MATLAB workspace to the script variable workspace. The resulting variable will have the same name as the MATLAB variable, and will overwrite any existing variable with the same name. If the variable does not exist in MATLAB, the command will return an error. For more information, please see the matlab command description. Note: Matlab script integration must be enabled in order to use this command. For more information on how to set this up see the Matlab script integration page. Syntax Description

matlabget(var1, var2,...varN); The arguments to this command are one or more variable names that refer to variables in the MATLAB workspace. This function does not return any data. See Also System level 156 , matlab 179 , matlabput 181 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.1.43 matlabput
Copies a variable from the FDTD/MODE Solutions workspace to the MATLAB workspace. The resulting variable in the MATLAB workspace will have the same name as in FDTD/ MODE Solutions, and will overwrite any existing variable with the same name. If the variable does not exist in the Lumerical workspace, the command will return an error. For more information, please see the matlab command description. Syntax Description

matlabput(var1, var2,...varN); The arguments to this command are one or more variable

2003 - 2012 Lumerical Solutions, Inc

182

Reference Guide names that exist in the Lumerical variable workspace. This function does not return any data. See Also System level 156 , matlab 179 , matlabget 181 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.1.44 debug
Opens the debug utility window. Syntax debug; Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Version 8+ No No No Description Opens the debug utility window.

8.2

Manipulating variables
The following commands are used to create and access variables. Command = 183 : 183 [] 184 % 184 linspace 185 matrix 185 randmatrix 186 Description Assignment operator. Array operator. Create matrix. Create variable with space in the name Creates a linear spaced array. Creates a matrix filled with zeros. Creates a matrix with all elements randomly set between 0 and 1

2003 - 2012 Lumerical Solutions, Inc

Scripting Language meshgridx 186 meshgridy 187 meshgrid3dx 187 meshgrid3dy 188 meshgrid3dz 188 meshgrid4d 188 clear 189 workspace 189 Matrix elements 190 Matrix operations 191 Pre-defined constants 191 Create a 2D meshgrid in x direction. Create a 2D meshgrid in y direction. Create a 3D meshgrid in x direction. Create a 3D meshgrid in y direction. Create a 3D meshgrid in z direction. Create a 4D meshgrid in any direction Clears all stored script variables from memory.

183

Returns a string of all the currently defined scripting variables. How to assign and access matrix elements. Describes how operators and functions act on matrices. List of pre-defined constants.

8.2.1 =
Assignment operators. Syntax x = 5+2i; Description Assign a value to a variable.

See Also Manipulating variables 182 , == 196 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.2.2 :
Array operator. Syntax x = 2 : 10; Description x will be an array of numbers that start at 2 and increase

2003 - 2012 Lumerical Solutions, Inc

184

Reference Guide by 1 for each consecutive number. The last entry will be <= 10. x will equal 2,3,...,9,10. x = 6 : -1.5 : 2; x will be the array were the first element is 6, and consecutive elements decrease by 1.5. All elements will be >=2. In this example, the array will be [6, 4.5, 3].

See Also Manipulating variables 182 , linspace 185 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.2.3 []
Specify matrix element by element. Command x = [u11,...,u1N; u21,...,u2N; uM1,...,uMN] Description Create an N by M matrix. Columns are separated with semicolons. Elements in a row are separated with commas. The entries can either be scalars or matrices of compatible dimension.

See Also Manipulating variables 182 , linspace 185 , matrix 185 , Accessing and assigning matrix elements 190 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.2.4 %
Used to create variables with spaced in the names. Command Description

2003 - 2012 Lumerical Solutions, Inc

Scripting Language %variable with space%

185

To create a variable name that contains spaces, such as "variable with space", put a percentage sign before and after the variable name.

See Also Manipulating variables 182 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.2.5 linspace
Creates a linearly spaced array. Syntax x = linspace(min,max,num); Description x will be an array with num elements, linearly spaced between min and max. If num is set to 1, then x will be the average of min and max.

See Also Manipulating variables 182 , : 183 , [] 184 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.2.6 matrix
Initialize a matrix. All elements are set to zero. Syntax x = matrix(i,j,k,....); Description Initializes an i x j x k x .... matrix.

See Also Manipulating variables 182 , linspace 185 , [] 184


2003 - 2012 Lumerical Solutions, Inc

186

Reference Guide

Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.2.7 randmatrix
Initialize a matrix. All elements are random numbers between 0 and 1. Syntax x = randmatrix(i,j,k,....); Description Initializes an i x j x k x .... matrix. The elements are all random numbers between 0 and 1.

See Also Manipulating variables 182 , matrix 185 , rand 248 , randreset 248 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.2.8 meshgridx
Create a 2D meshgrid in the x direction Syntax out = meshgridx(x,y); Description If x and y are single column (or single row vectors), of dimension nX1 and mX1 respectively, the command X = meshgridx(x,y); Will create a 2D matrix of dimension nXm where X(i,j)=x(i).

See Also Manipulating variables 182 , image 258 , meshgridy 187 , meshgrid3dx 187 Available in

2003 - 2012 Lumerical Solutions, Inc

Scripting Language FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

187

8.2.9 meshgridy
Create a 2D meshgrid in the y direction Syntax out = meshgridy(x,y); Description If x and y are single column (or single row vectors), of dimension nX1 and mX1 respectively, the command Y = meshgridy(x,y); Will create a 2D matrix of dimension nXm where Y(i,j)=y (j).

See Also Manipulating variables 182 , image 258 , meshgridx 186 , meshgrid3dx 187 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.2.10 meshgrid3dx
Create a 3D meshgrid in the x direction Syntax out = meshgrid3dx(x,y,z); Description The 3D version of meshgridx and meshgridy.

See Also Manipulating variables 182 , meshgridx 186 , meshgridy 187 , meshgrid3dy 188 , meshgrid3dz 188 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

2003 - 2012 Lumerical Solutions, Inc

188

Reference Guide

8.2.11 meshgrid3dy
Create a 3D meshgrid in the y direction Syntax out = meshgrid3dy(x,y,z); Description The 3D version of meshgridx and meshgridy.

See Also Manipulating variables 182 , meshgridx 186 , meshgridy 187 , meshgrid3dx 187 , meshgrid3dz 188 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.2.12 meshgrid3dz
Create a 3D meshgrid in the z direction Syntax out = meshgrid3dz(x,y,z); Description The 3D version of meshgridx and meshgridy.

See Also Manipulating variables 182 , meshgridx 186 , meshgridy 187 , meshgrid3dx 187 , meshgrid3dy 188 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.2.13 meshgrid4d
Create a 4D meshgrid in any direction. Syntax out = meshgrid4d(dim, x1, x2, x3, x4); Description The 4D meshgrid function. dim specifies the dimension along which to create the grid x1,x2,x3,x4 are the position vectors in each direction

2003 - 2012 Lumerical Solutions, Inc

Scripting Language

189

See Also Manipulating variables 182 , meshgridx 186 , meshgridy 187 , meshgrid3dy 188 , meshgrid3dz 188 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.2.14 clear
Clears all stored workspace variables. This will not clear any simulation data stored in dcards. The variables c, pi, eps0, mu0 will be reset to their default values. Syntax clear; Description Clears all workspace variables. This function does not return any data.

See Also Manipulating variables 182 , cleardcard 353 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.2.15 workspace
Returns a list of all the currently defined variables in the scripting workspace. Syntax out = workspace; Description Returns a string that lists all currently defined variables in the workspace. Use ?workspace; to print this to the screen.

See Also Manipulating variables 182 Available in

2003 - 2012 Lumerical Solutions, Inc

190

Reference Guide FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.2.16 Accessing and assigning matrix elements


Accessing and assigning matrix elements. The square brackets method of defining matrices is only available in FDTD solutions. Command x = [u; v; w] x = [u, v, w] x(7) = 5; x(7) = y(2); x(3,1,8) = 3; x(2:5,1) = 1:4; Description Create a column vector. u,v,w can either be scalars or matrices of compatible dimension. Create a row vector. u,v,w can either be scalars or matrices of compatible dimension. Set the 7th element of x to 5. Set the 7th element of x to the 2nd element of y. Set an element of a multidimensional matrix to 3. Set a sub-matrix of x to values 1:4. In the assignment A(I,...) = B, if B is not a scalar, the submatrix A(I,...) must be the same same size as B. If B is a scalar, then all the values of the sub-matrix are set to B. Set all the values in a sub-matrix of x to 1. x is equal to a sub-matrix of y. Multi-dimension matrices can be accessed with a single index. Indices stored in matrix (z) used to select elements of matrix y. length(x) will equal length(z).

x(2:5,1) = 1; x = y(1:10,2,1:20); x = matrix(2,3); x(4)=7; x=y(z);

See Also Manipulating variables 182 Available in

2003 - 2012 Lumerical Solutions, Inc

Scripting Language FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

191

8.2.17 Matrix operators


Almost all the scripting functions will act element by element on matrices. Single numbers are treated as matrices of dimension 1x1. The following table provides some examples. Dimension of x 1x1 1x1 10x10 10x10 10x10

Dimension of y
N/A 1x1 1x1 10x10 11x11

Operation
z = sin(x) z=x*y z=x*y z=x*y z=x*y

Dimension of z
1x1 1x1 10x10 10x10 Error

Value of z
z 11 = sin(x 11) z 11 = x 11 * y 11 Zij = x ij * y 11 Zij = x ij * y ij Error

See Also Manipulating variables 182 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.2.18 Pre-defined constants


Name pi c eps0 mu0 h Description The number . The speed of light in a vacuum in m/s. The permittivity of free space in SI units. The permeability of free space in SI units. The Planck constant.

2003 - 2012 Lumerical Solutions, Inc

192

Reference Guide hbar true false e See Also Manipulating variables 182 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes The reduced Planck constant. Logical TRUE (1). Logical FALSE (0); The electron volt.

8.3

Operators
Standard mathematical and string operators. Algebraic operators Command * 194 / 194 + 195 - 195 - 195 ^ 196 Description Multiplication. Ex: y = x * z; Division. Ex: y = x / z; Addition. Ex: y = x + z; Subtraction. Ex: y = x z; Negative. Ex: y = -x; Power. Ex: y = x^3; In expression A^B, if B is complex, the phase of A is evaluated from - to .

Logical and relational operators Command == 196 almostequal 196 != 197 <= 198 Description Comparison. Almost equal comparison operator. Not equal. Less than or equal to.

2003 - 2012 Lumerical Solutions, Inc

Scripting Language >= 198 < 198 > 199 & 199 and 200 | 200 or 201 ! 201 ~ 202 Dataset operators Command . 193 String operators Command " 202 ' 203 + 195 endl 204 Output to screen Command ? 204 # script file comments 205 Description Display output on screen. Comment script files with # Greater than or equal to. Less than. Greater than. AND. AND. OR. OR. NOT. NOT.

193

Description
Retrieve the parameters and attributes of datasets.

Description
Create a string variable. Create a string variable. Add strings end of line character.

8.3.1 .
The dot operator can be used to retrieve the parameters and attributes of datasets. Syntax result = A.result; Description Retrieves the parameter or attribute "result" from the

2003 - 2012 Lumerical Solutions, Inc

194

Reference Guide existing dataset A. The result is a scalar matrix. See Also matrixdataset 355 , rectilineardataset 354 , getparameter 357 , getattribute 357 , visualize 259 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Version 8+ No No No

8.3.2 *
Multiplication. Syntax y = x * z; Description Multiply x and z.

See Also Operators 192 , * 194 , / 194 , + 195 , - 195 , ^ 196 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.3.3 /
Division. Syntax y = x / z; Description Divide x by z.

See Also Operators 192 , * 194 , / 194 , + 195 , - 195 , ^ 196 Available in

2003 - 2012 Lumerical Solutions, Inc

Scripting Language FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

195

8.3.4 +
Addition. Syntax y = x + z; y = string1 + string2; Description Add x and z. Concatenate strings together.

See Also Operators 192 , * 194 , / 194 , + 195 , - 195 , ^ 196 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.3.5 Subtraction, or negative. Syntax y = x - z; y = -x; Description Subtract z from x. Negative

See Also Operators 192 , * 194 , / 194 , + 195 , - 195 , ^ 196 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

2003 - 2012 Lumerical Solutions, Inc

196

Reference Guide

8.3.6 ^
Power. In expression A^B, if B is complex, the phase of A is evaluated from - to . Syntax y = x^3; Description x cubed.

See Also Operators 192 , * 194 , / 194 , + 195 , - 195 , ^ 196 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.3.7 ==
Logical comparison. This operators can be used with complex numbers and strings. Syntax out = y == x; Description Returns 1 if x and y are equal. Returns 0 otherwise.

See Also Operators 192 , = 183 , almostequal 196 , != 197 , <= 198 , >= 198 , < 198 , > 199 , & 199 , and 200 , | 200 , or 201 , ! 201 , ~ 202 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.3.8 almostequal
Almost equal comparison operator. When using floating point numbers (rather than integers), two values that are meant to be equal may not be exactly equal due to rounding errors that are always present in floating point calculations. In such cases, the almost equal function can be useful. Syntax Description

2003 - 2012 Lumerical Solutions, Inc

Scripting Language out = almostequal(A, B); out = almostequal(A, B, relative diff); out = almostequal(A, B, relative diff, absolute diff);

197

Returns 1 if A - B is less than or equal to A + B /2*1e15. Returns 0 otherwise. Returns 1 if A - B is less than or equal to A + B /2 times relative diff. Returns 0 otherwise. Returns 1 if A - B is less than or equal to A + B /2 times relative diff or if A - B is less than or equal to absolute diff. Returns 0 otherwise.

See Also Operators 192 , = 183 , == 196 , != 197 , <= 198 , >= 198 , < 198 , > 199 , & 199 , and 200 , | 200 , or 201 , ! 201 , ~ 202 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.3.9 !=
Not equal to comparison operator. Returns 1 if values are not equal. Returns 0 if values are equal. This operator can be used in matrix operations. This operators can be used with complex numbers. Syntax out = a!=b; Description If a is not equal to b, then out equals 1. Otherwise out equals 0.

See Also Operators 192 , == 196 , almostequal 196 , <= 198 , >= 198 , < 198 , > 199 , & 199 , and 200 , | 200 , or 201 , ! 201 , ~ 202 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

2003 - 2012 Lumerical Solutions, Inc

198

Reference Guide

8.3.10 <=
Logical less than or equal to. Imaginary components of x and y are ignored. Syntax out = y <= x; Description Less than or equal to.

See Also Operators 192 , == 196 , != 197 , almostequal 196 , >= 198 , < 198 , > 199 , & 199 , and 200 , | 200 , or 201 , ! 201 , ~ 202 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.3.11 >=
Logical greater than or equal to. Imaginary components of x and y are ignored. Syntax out = y >= x; Description Greater than or equal to.

See Also Operators 192 , == 196 , != 197 , <= 198 , almostequal 196 , < 198 , > 199 , & 199 , and 200 , | 200 , or 201 , ! 201 , ~ 202 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.3.12 <
Logical less than. Imaginary components of x and y are ignored. Syntax Description

2003 - 2012 Lumerical Solutions, Inc

Scripting Language out = y < x; Less than.

199

See Also Operators 192 , == 196 , != 197 , <= 198 , >= 198 , almostequal 196 , > 199 , & 199 , and 200 , | 200 , or 201 , ! 201 , ~ 202 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.3.13 >
Logical greater than. Imaginary components of x and y are ignored. Syntax out = y > x; Description Greater than.

See Also Operators 192 , == 196 , != 197 , <= 198 , >= 198 , < 198 , almostequal 196 , & 199 , and 200 , | 200 , or 201 , ! 201 , ~ 202 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.3.14 &
Logical AND. Imaginary components of x and y are ignored. Syntax out = y & x; y and x; Description If the real part of either or both of x,y are zero, then return 0. Otherwise return 1. Same as &.

See Also Operators 192 , == 196 , != 197 , <= 198 , >= 198 , < 198 , > 199 , & 199 , and 200 , | 200 , or 201 , ! 201 , ~

2003 - 2012 Lumerical Solutions, Inc

200

Reference Guide
202

Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.3.15 and
Logical AND. Imaginary components of x and y are ignored. Syntax out = y & x; y and x; Description If the real part of either or both of x,y are zero, then return 0. Otherwise return 1. Same as &.

See Also Operators 192 , == 196 , != 197 , <= 198 , >= 198 , < 198 , > 199 , & 199 , and 200 , | 200 , or 201 , ! 201 , ~
202

Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.3.16 |
Logical OR. Imaginary components of x and y are ignored. Syntax out = y | x; y or x; Description If the real part of either or both of x,y is non-zero, then return 1. Otherwise return 0. Same as |.

See Also Operators 192 , == 196 , != 197 , <= 198 , >= 198 , < 198 , > 199 , & 199 , and 200 , | 200 , or 201 , ! 201 , ~
202

2003 - 2012 Lumerical Solutions, Inc

Scripting Language Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

201

8.3.17 or
Logical OR. Imaginary components of x and y are ignored. Syntax out = y | x; y or x; Description If the real part of either or both of x,y is non-zero, then return 1. Otherwise return 0. Same as |.

See Also Operators 192 , == 196 , != 197 , <= 198 , >= 198 , < 198 , > 199 , & 199 , and 200 , | 200 , or 201 , ! 201 , ~
202

Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.3.18 !
Logical NOT operator. If a value is 0, then NOT returns 1. For all other values, NOT returns 0. NOT(A) is equivalent to A==0, where == is the comparison operator. Syntax out = !a; out = ~a; Description applies logical not operator to a applies logical not operator to a

See Also Operators 192 , == 196 , != 197 , <= 198 , >= 198 , < 198 , > 199 , & 199 , and 200 , | 200 , or 201 , ! 201 , ~
202

Available in

2003 - 2012 Lumerical Solutions, Inc

202

Reference Guide FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.3.19 ~
Logical NOT operator. If a value is 0, then NOT returns 1. For all other values, NOT returns 0. NOT(A) is equivalent to A==0, where == is the comparison operator. Syntax out = !a; out = ~a; Description applies logical not operator to a applies logical not operator to a

See Also Operators 192 , == 196 , != 197 , <= 198 , >= 198 , < 198 , > 199 , & 199 , and 200 , | 200 , or 201 , ! 201 , ~
202

Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.3.20 "
String operator. Strings can be created with single or double quotes. The following escape sequences are recognized when creating strings with double quotes: \" double quotes in string \n newline (linefeed) character in string \\ backslash in string Syntax out="my string"; Description use double quotes to create strings

NOTE: Literal back slashes and double quotes It is always possible to create a literal backslash in a string with \\. However, \ also results in a literal backslash, IF it it will not be interpreted as part of an escape sequence (\n, \", \\). This note is important when storing paths in strings.

2003 - 2012 Lumerical Solutions, Inc

Scripting Language

203

Suppose we want to create the string C:\Program Files\Lumerical. The following three commands are valid and equivalent: mystring = 'C:\Program Files\Lumerical'; # use single quotes mystring = "C:\Program Files\Lumerical"; # use double quotes mystring = "C:\\Program Files\\Lumerical"; # use double quotes and \\ escape character However, suppose we want to create the string C:\Program Files\Lumerical\. The only difference is the additional backslash at the end of the string. The following two commands are valid and equivalent: mystring = 'C:\Program Files\Lumerical\'; # use single quotes mystring = "C:\\Program Files\\Lumerical\\"; # use double quotes and \\ escape character The other potential command, where we use a single backslash, is not valid syntax and will result in an error. mystring = "C:\Program Files\Lumerical\"; # use double quotes The problem is that the script interpreter will interpret the final \" as an escape character for a literal double quote, rather than as a single backslash and a closing double quote. When interpreted this way, the command results in a syntax error because there is no double quote character closing the string.

See Also Operators 192 , ' 203 , num2str 229 , + 195 , endl 204 , write 175 , eval 230 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.3.21 '
String operator. Strings can be created with single or double quotes. The following escape sequences are recognized when creating strings with single quotes: '' single quote in string

2003 - 2012 Lumerical Solutions, Inc

204

Reference Guide Syntax out='my string'; Description use single quotes to create strings

See Also Operators 192 , " 202 , num2str 229 , + 195 , endl 204 , write 175 , eval 230 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.3.22 endl
Add an end of line character to a string Syntax out = "line1"+endl+"line2"; Description Add an end of line character to the string.

See Also Operators 192 , num2str 229 , + 195 , " 202 , write 175 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.3.23 ?
Print output to the screen. Use the format script command to change the precision of the output. Syntax ?command; Description Displays the output of the command on the screen This function does not return any data.

See Also System level 156 , write 175 , format 173 , # 205

2003 - 2012 Lumerical Solutions, Inc

Scripting Language Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

205

8.3.24 comments
Use the # character to comment script files. Anything after the # character is ignored. The comments are not displayed when the script file is run. Comments can not be used when typing commands directly into the script prompt. Syntax x=1; # set x to 1 See Also System level 156 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes Description Anything after the # character is ignored.

8.4

Functions
Standard mathematical and matrix functions. Trigonometric and complex Command sin 209 cos 209 tan 210 asin 210 acos 211 atan 211 atan2 212 Description Trigonometric sin function. Trigonometric cos function. Trigonometric tan function. Inverse trigonometric sin function. Inverse trigonometric cos function. Inverse trigonometric tan function. Same as atan, but returns angle in correct quadrant.

2003 - 2012 Lumerical Solutions, Inc

206

Reference Guide real 212 imag 212 conj 213 abs 213 angle 214 unwrap 214 Returns the real part of variable Returns the imaginary part of variable Complex conjugate Absolute value Phase of a complex number. Removes phase difference of more than 2

Logarithmic, exponential and power Command log 215 log10 215 sqrt 215 exp 216 Matrix functions Command size 216 length 217 pinch 217 sum 218 max 218 min 219 dot 219 cross 220 flip 222 interp 224 spline 225 integrate 225 integrate2 226 Description Returns the dimensions of a matrix. Returns the total number of elements in a matrix. Remove singleton dimensions from a matrix. The sum of a matrix. The max value in a matrix. The min value in a matrix. The dot product of two vectors. The cross product of two vectors. Flip a matrix in one dimension. Linear interpolation function. Cubic spline interpolation. Integrate a matrix. Integrate a matrix, ignore singleton dimensions. Description The natural logarithm. Input can be complex or negative. The log, base 10. Input can be complex or negative. The square root. The exponential.

2003 - 2012 Lumerical Solutions, Inc

Scripting Language find 227 findpeaks 228 transpose 228 ctranspose 229 mult 221 reshape 223 eig 220 permute 222 inv 223 See also Manipulating variables 182 String functions Command num2str 229 str2num 230 eval 230 feval 231 length 217 substring 231 findstring 232 replace 232 replacestring 233 Description Convert number to a string. Convert a string into a floating point number. Execute string containing Lumerical scripting language. Run a Lumerical script file. Returns the total length of the string. Returns a substring of a string, as a specified position and length. Returns the position of a substring in a string. Replaces a part of a string with another, at a specified position. Replaces all instances of a substring with another string. Find values that satisfy a condition in a matrix. Find peaks in a matrix. Transpose a matrix. Transpose a matrix, and do complex conjugate. Perform matrix multiplication of two or more matrices. Reshape the matrix to have different dimensions conserving the overall product of the dimensions. Calculate the eigenvalues and/or eigenvectors of a matrix. Rearrange the dimensions of a matrix. Calculate the inverse of a matrix.

207

Frequency and time-domain

2003 - 2012 Lumerical Solutions, Inc

208

Reference Guide Command fft 233 fftw 235 fftk 236 invfft 237 czt 238 Line and polygon functions Command polyarea 239 centroid 240 polyintersect 240 inpoly 241 polygrow 241 polyand 242 polyor 242 polyxor 244 lineintersect 244 linecross 245 Miscellaneous Command ceil 246 floor 246 mod 246 round 247 rand 248 Description Round up. Round down. Modulus after division. Rounds to the nearest integer. Returns a uniformly distributed random number Description Returns the area of a polygon. Returns the center of mass of a polygon. Determines if two polygons intersect. Determines if a series of points are inside our outside a polygon. Grows or shrinks a polygon by a specified amount. Combines two polygons into one with an and operation. Combines two polygons into one with an or operation. Combines two polygons into one with a xor operation. Returns the intersection of line segments. Determines if line segments cross each other. Description Fast Fourier transform. Returns the angular frequency vector. Returns the spatial wavevector kx. Inverse fft. Chirped z-transform.

2003 - 2012 Lumerical Solutions, Inc

Scripting Language between 0 and 1. randreset 248 finite 249 solar 249 stackrt 250 Resets the random number seed. Determines if a number is finite or NaN. Returns the solar power spectrum

209

Calculates reflection and transmission of multi-layer stacks

8.4.1 sin
Trigonometric sine function. Angle units are in radians. Function is defined for complex angles. Phase of a complex number is evaluated between - and . Syntax out = sin(x); See Also Functions 205 , asin 210 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes Description Returns the complex sine of x.

8.4.2 cos
Trigonometric cosine function. Angle units are in radians. Function is defined for complex angles. Phase of a complex number is evaluated between - and . Syntax out = cos(x); See Also Functions 205 , acos 211 Available in Description Returns the complex cosine of x.

2003 - 2012 Lumerical Solutions, Inc

210

Reference Guide FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.4.3 tan
Trigonometric tangent function. Angle units are in radians. Function is defined for complex angles. Phase of a complex number is evaluated between - and . Syntax out = tan(x); Description Returns the complex tangent of x.

See Also Functions 205 , atan 211 , atan2 212 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.4.4 asin
Inverse trigonometric sine function. Angle units are in radians. Function is defined for complex values. Phase of a complex number is evaluated between - and . If x is complex, or abs(x) > 1, the following equation is used: asin(x) = -i ln( ix + sqrt(1-x^2)) Syntax out = asin(x); See Also Functions 205 , sin 209 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes Description Returns the complex arcsine of x.

2003 - 2012 Lumerical Solutions, Inc

Scripting Language

211

8.4.5 acos
Inverse trigonometric cosine function. Angle units are in radians. Function is defined for complex values. Phase of a complex number is evaluated between - and . If x is complex, or abs(x) > 1, the following equation is used: acos(x) = -i ln( x + i sqrt( 1-x^2)) Syntax out = acos(x); See Also Functions 205 , cos 209 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes Description Returns the complex arccosine of x.

8.4.6 atan
Inverse trigonometric tangent function. Angle units are in radians. Function is defined for complex values. Phase of a complex number is evaluated between - and . If x is complex, or abs(x) > 1, the following equation is used: atan(x) = 0.5 i ln( (i+x)/(i-x) ) Syntax out = atan(x); Description Returns the complex arctangent of x.

See Also Functions 205 , atan2 212 , tan 210 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

2003 - 2012 Lumerical Solutions, Inc

212

Reference Guide

8.4.7 atan2
Inverse trigonometric tangent function, calculates the arctangent of y/x, but returns the angle in the correct quadrant. Angle units are in radians. Function is defined for real values only. Syntax out = atan2(y,x); See Also Functions 205 , atan 211 , tan 210 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes Description x,y must be real.

8.4.8 real
Returns the real part of a number or matrix. Syntax out = real(x); See Also Functions 205 , imag 212 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes Description Returns the real part of x.

8.4.9 imag
Returns the imaginary part of a number or matrix. Syntax out = imag(x); Description Returns the imaginary part of x.

2003 - 2012 Lumerical Solutions, Inc

Scripting Language

213

See Also Functions 205 , real 212 , conj 213 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.4.10 conj
Returns the complex conjugate of a number or matrix. Syntax out = conj(x); Description Returns the complex conjugate of x.

See Also Functions 205 , real 212 , imag 212 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.4.11 abs
Returns the absolute value of a number or matrix. Syntax out = abs(x); Description Returns the absolute value of x.

See Also Functions 205 , real 212 , imag 212 Available in

2003 - 2012 Lumerical Solutions, Inc

214

Reference Guide FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.4.12 angle
Returns the angle or phase of a complex number or matrix in radians. Syntax out = angle(x); Description Returns the phase of x.

See Also Functions 205 , real 212 , imag 212 , unwrap 214 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.4.13 unwrap
Removes changes of more than 2 from a 1D array. It can be useful after angle(x) to see phase without discontinuities. Syntax out = unwrap(x); Description Return the values of x without discontinuities.

See Also Functions 205 , real 212 , imag 212 , angle 214 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

2003 - 2012 Lumerical Solutions, Inc

Scripting Language

215

8.4.14 log
The natural logarithm. Input can be complex or negative. Syntax out = log(x); See Also Functions 205 , log10 215 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes Description The natural logarithm. Input can be complex or negative.

8.4.15 log10
The log, base 10. Input can be complex or negative. Syntax out = log10(x); See Also Functions 205 , log 215 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes Description The log, base 10. Input can be complex or negative.

8.4.16 sqrt
The square root. Syntax out = sqrt(x); See Also Functions 205 , ^ 196 Description The square root.

2003 - 2012 Lumerical Solutions, Inc

216

Reference Guide Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.4.17 exp
The exponential. Syntax out = exp(x); See Also Functions 205 , log 215 , ^ 196 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes Description The exponential.

8.4.18 size
Returns the size of a matrix. Syntax y = size(x); Description y is a matrix which shows the dimensions of x.

See Also Functions 205 , length 217 , flip 222 , transpose 228 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

2003 - 2012 Lumerical Solutions, Inc

Scripting Language

217

8.4.19 length
Returns the number of elements in a matrix. If the argument is a string, it will return the length of the string. Syntax y = length(x); Description y the number of elements in a matrix. For example, if x is an n by m matrix, y = length( x ) = n * m.

See Also Functions 205 , size 216 , transpose 228 , flip 222 , substring 231 , findstring 232 , replace 232 , replacestring 233 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.4.20 pinch
Removes all singleton dimensions from a matrix. Syntax out = pinch(x); Description Removes all singleton dimensions. For example, if x is a matrix of dimension 1x1x1xM, then y=pinch(x); will return a Mx1 matrix where y(i) = x(1,1,1,i); Removes a specified dimension. If x is an NxMxKxP matrix then y=pinch(x,2); will return an NxKxP matrix where y(i,j,k) = x(i,1,j,k) Removes a specified dimension but keeps a specific index for the dimension being removed. If x is an NxMxKxP matrix then y=pinch(x,2,4); will return an NxKxP matrix where y(i,j,k) = x(i,4,j,k)

pinch(x,i);

pinch(x,I,j);

2003 - 2012 Lumerical Solutions, Inc

218

Reference Guide

See Also Functions 205 , find 227 , size 216 , flip 222 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.4.21 sum
Sum of elements in a matrix. Syntax out = sum(x); out = sum(x,2); See Also Functions 205 , integrate 225 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes Description Sum of all the elements in a matrix, over all dimensions. Sum x over the specified dimension.

8.4.22 max
The maximum value in a matrix. For complex numbers, only the real part is considered. Syntax out = max(x); See Also Functions 205 , min 219 , abs 213 Available in Description The maximum value in a matrix.

2003 - 2012 Lumerical Solutions, Inc

Scripting Language FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

219

8.4.23 min
The minimum value in a matrix. For complex numbers, only the real part is considered. Syntax out = min(x); See Also Functions 205 , max 218 , abs 213 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes Description The minimum value in a matrix.

8.4.24 dot
Dot product. Matrix A, B must have the same number of elements. The dot product will be calculated with the following formula.

C
i

A(i ) B (i )

Syntax C = dot(A, B);

Description Returns the dot product of A and B

See Also Functions 205 , cross 220 , * 194 , length 217 , size 216 Available in

2003 - 2012 Lumerical Solutions, Inc

220

Reference Guide FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.4.25 cross
Vector cross product. Matrix A, B must be the same size. The cross product will be computed on the first dimension that has a size of 3. There must be at least one dimension with a size of 3. Assume that A,B are 2D matrices, where the second dimension contains the vector components. The size of the second dimension must be 3. Then the elements of C will be calculated with the standard cross product formulas.

C (i,1) C (i,2) C (i,3)


Syntax

A(i,2) B(i,3) A(i,3) B(i,2) A(i,1) B(i,3) A(i,3) B(i,1) A(i,1) B(i,2) A(i,2) B(i,1)
Description Returns the cross product of A and B

C = cross(A, B);

See Also Functions 205 , dot 219 , * 194 , length 217 , size 216 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.4.26 eig
Find the eigen value and/or eigen vector of a matrix. The matrix has to be square. Syntax out = eig(A); out = eig(A, 1); Description Returns the eigenvalues of matrix A.

2003 - 2012 Lumerical Solutions, Inc

Scripting Language out = eig(A, 2); out = eig(A, 3); Returns the eigenvectors of matrix A. Returns both the eigenvalues and eigenvectors of matrix A.

221

See Also Operators 192 , = 183 , == 196 , != 197 , <= 198 , >= 198 , < 198 , > 199 , & 199 , and 200 , | 200 , or 201 , ! 201 , ~ 202 , mult 221 , permute 222 , reshape 223 , inv 223 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes, version 8+ Yes, version 6+ Yes Yes

8.4.27 mult
Perform matrix multiplication of two or more matrices. The dimensions of the matrices have to match Syntax out = mult(A,B,...) Description Returns the matrix multiplication of matrices, A x B x C ...

See Also Operators 192 , = 183 , == 196 , != 197 , <= 198 , >= 198 , < 198 , > 199 , & 199 , and 200 , | 200 , or 201 , ! 201 , ~ 202 , eig 220 , permute 222 , reshape 223 , inv 223 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes, version 8+ Yes, version 6+ Yes Yes

2003 - 2012 Lumerical Solutions, Inc

222

Reference Guide

8.4.28 flip
Flip a matrix along one dimension. Syntax C = flip(A, dim); Description Flips the matrix A along the dimension dim.

See Also Functions 205 , size 216 , length 217 , pinch 217 , transpose 228 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.4.29 permute
This is an advanced version of the transpose function. It rearranges the dimensions of a matrix as specified by the second argument. Syntax out = permute(A, [i,j,k, ...]) Description Returns a matrix with the same elements as A but with rearranged dimensions i,j,k, etc.

See Also Operators 192 , = 183 , == 196 , != 197 , <= 198 , >= 198 , < 198 , > 199 , & 199 , and 200 , | 200 , or 201 , ! 201 , ~ 202 , eig 220 , reshape 223 , mult 221 , inv 223 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes, version 8+ Yes, version 6+ Yes Yes

2003 - 2012 Lumerical Solutions, Inc

Scripting Language

223

8.4.30 reshape
Reshapes the matrix A to have the size i-by-j-by-k-by-... .The product of the specified dimensions, i*j*k*..., must be the same as that of the original matrix A,

Syntax out = reshape(A, [i,j,k, ...])

Description Returns an array with the same elements as A but reshaped to have the size i by j by k by ...

See Also Operators 192 , = 183 , == 196 , != 197 , <= 198 , >= 198 , < 198 , > 199 , & 199 , and 200 , | 200 , or 201 , ! 201 , ~ 202 , eig 220 , permute 222 , mult 221 , inv 223 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes, version 8+ Yes, version 6+ Yes Yes

8.4.31 inv
Calculate the inverse of a matrix. The matrix has to be invertible. Syntax out = Inv(A) Description Returns the inverse of matrix A

See Also Operators 192 , = 183 , == 196 , != 197 , <= 198 , >= 198 , < 198 , > 199 , & 199 , and 200 , | 200 , or 201 , ! 201 , ~ 202 , eig 220 , permute 222 , mult 221 , reshape 223 Available in

2003 - 2012 Lumerical Solutions, Inc

224

Reference Guide FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes, version 8+ Yes, version 6+ Yes Yes

8.4.32 interp
Linear interpolation of a data set. The data can be complex. Syntax out = interp(Ex, xold, xnew); Description Does a linear interpolation of a 1D function. Ex is existing data xold specifies the points where Ex is sampled xnew specifies new point to interpolate the data. The xnew does does not have to be within the bounds of xold. The 2D version of interp. The 3D version of interp.

interp(Ex, xold, yold, xnew, ynew); interp(Ex, xold, yold, zold, xnew, ynew, znew); See Also Functions 205 , spline 225 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.4.33 interptri
Triangular to linear interpolation of a data set. The data can be complex. # Interpolate from triangular mesh to rectilinear mesh Ec_rect(1:nxspan,1:nyspan) = interptri(tri,vtx2,Ec(1:nvtx),xgrid,ygrid); Syntax Description

2003 - 2012 Lumerical Solutions, Inc

Scripting Language out = interptri(Elements, Vertices,Ex, xgrid, ygrid);

225

Does a triangular to linear interpolation of a function. Ex is existing data xgrid/ygrid specifies the points where Ex is to be sampled on the rectilinear mesh Elements are the elements of the triangular mesh taken from the simulation region Vertices are the vertices of the triangular mesh taken from the simulation region

8.4.34 spline
Does a cubic spline interpolation of a data set. Syntax out = spline(Ex,xold,xnew); Description Cubic spline interpolation of a 1D function. Ex is existing data xold specifies the points where Ex is sampled xnew specifies new point to interpolate the data. The xnew does does not have to be within the bounds of xold.

See Also Functions 205 , interp 224 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.4.35 integrate
Returns the integral over the specified dimension of a matrix. Integrals over singleton dimensions will return zero (i.e. the area under a single point is zero). See integrate2 for an alternate behavior. Syntax out = integrate(A, n, x1); Description Integrates A over the nth dimension in the matrix.

2003 - 2012 Lumerical Solutions, Inc

226

Reference Guide x1 is the corresponding position vector for that dimension. out = integrate(A, d, x1, x2, ...); Calculates the integral of A over the specified list of dimension(s) d. d is a vector containing the dimensions over which to integrate. xi are the position vectors corresponding to the dimensions of A over which the integration is occurring. For example power = integrate(A,1:2,x,y) will integrate A over an x-y surface.

See Also Functions 205 , integrate2 226 , max 218 , min 219 , interp 224 , find 227 , pinch 217 , round 247 , getdata 349 , sum 218 , length 217 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.4.36 integrate2
Very similar to the standard integrate function, except that singleton dimensions are treated differently. As described in the integrate function description, integrating over dimensions with a single value (singleton dimensions) returns zero because the area under a single point is zero. In some cases, particularly when you are not sure which dimensions are singleton, this behavior can cause difficulties. The integrate2 function automatically ignores all dimensions with a size of one, which avoids the problem of a zero valued integrals due to singleton dimensions. Syntax out = integrate2(A, 1, x1); Description Integrates A over the first dimension in the matrix. x1 is the corresponding position vector.

out = integrate2(A, d, x1, x2, Calculates the integral of A over the specified dimension(s) ...); d. d is a vector containing the dimensions over which to integrate.

2003 - 2012 Lumerical Solutions, Inc

Scripting Language

227

xi is the position vector corresponding to the dimensions of A over which the integration is occurring. If any of the xi vectors only have 1 element, integrate returns 0. For example power = integrate2(A,1:2,x,y) will integrate A over an x-y surface.

See Also Functions 205 , integrate 225 , max 218 , min 219 , interp 224 , find 227 , pinch 217 , round 247 , getdata 349 , sum 218 , length 217 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Version 8+ Version 6+ Yes Yes

8.4.37 find
This function will search for entries in a matrix that meet some condition. The indices of those values are returned. For multi-dimensional matrixes, the find function will still return a single index. This is useful when using the output from find in a loop. Syntax out = find(x,5e-6); out = find(x>5); Description Will return the index of x that corresponds to the closest value to 5e-6. Will return indices of all values of x that are greater than 5.

See Also Functions 205 , pinch 217 , findpeaks 228 , integrate 225 , length 217 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

2003 - 2012 Lumerical Solutions, Inc

228

Reference Guide

8.4.38 findpeaks
Returns the position of peaks in a matrix. A peak is defined as a data point that is larger than its nearest neighbors. Syntax out = findpeaks(y); Description Returns the position of the peak with the largest value in y. The length of y must be at least 2. If no peak is found in the data, a value of 1 is returned. Returns a matrix containing the positions of the largest n peaks found in the data. The returned values are ordered from largest to smallest. The returned matrix is always of dimension nX1. If less than n peaks are found, the remaining values of the returned matrix are 1.

findpeaks(y,n);

See Also Functions 205 , find 227 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.4.39 transpose
Transpose a 1D or 2D matrix. Syntax y = transpose(x); Description If x is an N x M matrix, then y will be M x N, where the entries are y(j,i)=x(i,j).

See Also Functions 205 , ctranspose 229 , flip 222 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

2003 - 2012 Lumerical Solutions, Inc

Scripting Language

229

8.4.40 ctranspose
Transpose a 1D or 2D matrix and take the complex conjugate of each element. Syntax y = ctranspose(x); Description If x is an N x M matrix, then y will be M x N, where the entries are y(j,i)=x(i,j)* .

See Also Functions 205 , transpose 228 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.4.41 num2str
Convert an integer, floating point number, or matrix into a string. Use the format script command to change the precision of the output. Syntax out = num2str(x); Description Converts the number x into a string. x can also be a 1D or 2D matrix.

See Also Operators 192 , " 202 , + 195 , ? 204 , endl 204 , write 175 , format 173 ,str2num 230 , findstring 232 , replace 232 , replacestring 233 , substring 231 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

2003 - 2012 Lumerical Solutions, Inc

230

Reference Guide

8.4.42 str2num
Convert a string into a floating point number. Use the format script command to change the precision of the output. Syntax out = str2num(string); Description Converts string into a number.

See Also Operators 192 , " 202 , + 195 , ? 204 , endl 204 , write 175 , format 173 , findstring 232 , replace 232 , replacestring 233 , substring 231 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.4.43 eval
Execute string containing Lumerical scripting language. Syntax eval(string); Description Execute string containing Lumerical scripting language at the Lumerical script prompt. This function does not return any data.

See Also Operators 192 , feval 231 , str2num 230 , num2str 229 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

2003 - 2012 Lumerical Solutions, Inc

Scripting Language

231

8.4.44 feval
Evaluates a string as script file. This function is useful for running script files that are not in your path and files with spaces in the name. Syntax feval(filename); Description Execute string containing the name of a script file at the Lumerical script prompt. This function does not return any data.

See Also Operators 192 , eval 230 , str2num 230 , num2str 229 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.4.45 substring
Can be used to extract a substring from a string. Syntax s1 = substring(s,pos); s1 = substring(s,pos,len); Description Returns a substring of s, starting at position pos to the end of s. The position pos can be 1 to length(s). Returns a substring of s, starting at position pos, with len characters. If len is -1 (or any value less than 0) it returns the substring at position pos to the end of s. The default value of len is -1.

See Also Functions 205 , length 217 , findstring 232 , replace 232 , replacestring 233 , str2num 230 , num2str
229

Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

2003 - 2012 Lumerical Solutions, Inc

232

Reference Guide

8.4.46 findstring
Returns the position of a given substring in a string. Syntax pos = findstring(s,s1); pos = findstring(s,s1,p0); Description Returns the position of the first instance substring s1 in s. If s1 is not found in s, it returns -1. Returns the position of the first instance substring s1 in s, starting at position p0. If s1 is not found in s, starting from p0, it returns -1.

See Also Functions 205 , length 217 , substring 231 , replace 232 , replacestring 233 , str2num 230 , num2str
229

Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.4.47 replace
Replaces a substring of a string with a new string. Syntax snew = replace(s,pos,len, s1); Description Replaces len characters of s, starting at position pos, with the string in s1. If len is 0, it will insert the string s1 between pos-1 and pos. If len is -1 (or any values less than 0) it will replace all remaining characters in s with s1, starting at pos. The position pos can be 1 to length(s).

See Also Functions 205 , length 217 , substring 231 , findstring 232 , replacestring 233 , str2num 230 , num2str 229 Available in

2003 - 2012 Lumerical Solutions, Inc

Scripting Language FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

233

8.4.48 replacestring
Replaces a substring of a string with a new string. Syntax snew = replacestring(s,s1, s2); Description Replaces all instances of s1 in s with s2.

See Also Functions 205 , length 217 , substring 231 , findstring 232 , replace 232 , str2num 230 , num2str 229 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.4.49 fft
Compute the 1D, 2D or 3D Fast Fourier Transform (fft) of a matrix. In the 1D case the transform is given by
N ( 2 i )( n 1)( m 1) N

E w [ m]

fft( E x )
n 1

E x [ n] e

The fft, inverse fft and all associated functions have an option (option 1 below) that controls the format used to store the frequency domain data. When working with spectral data it is not possible to switch between formats; there are no functions to convert between formats. This implies that if you use option 1=n to produce a spectrum with fft, then you must also use option 1=n if you want to pass that same spectral data to invfft. Similarly, if you use option 1=n for fft, then you also need to use option 1=n with fftw to get the proper frequency vector corresponding to your spectrum. invfft and fftk work in the same way. Syntax out = fft(Ex); Description Returns the fast Fourier transform of Ex. Ex can be 1D, 2D

2003 - 2012 Lumerical Solutions, Inc

234

Reference Guide or 3D. out = fft(Ex,option1, option2); option1 This option controls the format used to store the frequency domain data. The options are: 1 : the standard fft (zero frequency is at the first element of the matrix). 2 : zero frequency is the first element, but only data up to and including the Nyquist frequency is stored. This option is only useful for real valued, 1D time/spatial signals. 3 : the fft is shifted so zero frequency is the central element of the spectrum (precisely, this means the zero frequency point is at element floor(N/2 + 1), where N is the number of samples). option2 This option is either a 1, 2 or 3 element vector depending on whether Ex is 1D, 2D or 3D. For each dimension, specify a value of either 0, 1 or N to obtain the desired 0 padding options. 0: no zero padding 1: zero padding up to the next power of 2 longer than the length of Ex (default) N: zero pad up to length N if N > length(Ex), where length of Ex is the length in a specific dimension. If N <= length(Ex), it will zero pad up to the next power of 2 longer than the length of Ex. For the fastest results, N should be a power of 2 and can be entered, for example, as 2^12. Note: FFT Conventions There are different, but equivalent conventions for defining Fourier transforms. Lumerical defines the forward FFT using a positive sign in the exponential term, and the inverse FFT using a negative sign in the exponential term. However, some other packages (e.g. MATLAB) use the opposite convention, with a negative sign in the exponential for the forward FFT and a positive sign in the exponential for the inverse FFT. To convert between the different FFT conventions, switch the invfft and fft and rescale the results. For a signal y with N elements this can be done as follows: Lumerical fft(y,1,0) invfft(y,1,0) MATLAB ifft(y)*N fft(y)/N

2003 - 2012 Lumerical Solutions, Inc

Scripting Language

235

See Also Functions 205 , invfft 237 , fftw 235 , fftk 236 , czt 238 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.4.50 fftw
Returns the angular frequency vector corresponding to time vector t.

fftw(t )

2 0, dt M

, ( M 1)
,

where M=length(t). fftw and all related functions have an option (option 1 below) that controls the format used to store the frequency domain data. When working with spectral data it is not possible to switch between formats; there are no functions to convert between formats. This implies that if you use option 1=n to produce a spectrum with fft, then you must also use option 1=n if you want to pass that same spectral data to invfft. Similarly, if you use option 1=n for fft, then you also need to use option 1=n with fftw to get the proper frequency vector corresponding to your spectrum. Invfft and fftk work in the same way.

Syntax out = fftw(t); fftw(t,option1,option2);

Description Returns the angular frequency vector corresponding to time vector t. Option1 1 : the standard fft (default) 2 : frequencies above the Nyquist frequency are removed 3 : the fft is shifted so both positive and negative frequencies are seen Option2 0: no zero padding 1: zero padding up to the next power of 2 longer than the length of Ex (default) N: zero pad up to length N if N > length(t). If N <= length (t), it will zero pad up to the next power of 2 longer than

2003 - 2012 Lumerical Solutions, Inc

236

Reference Guide the length of t. For the fastest results, N should be a power of 2 and can be entered, for example, as 2^12. See Also Functions 205 , fft 233 , fftk 236 , invfft 237 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.4.51 fftk
Returns the spatial wavevector kx associated with a fourier transform of a function of x.

fftk( x)

2 0, dx M

, ( M 1)
,

where M=length(x). fftk and all related functions have an option (option 1 below) that controls the format used to store the frequency domain data. When working with spectral data it is not possible to switch between formats; there are no functions to convert between formats. This implies that if you use option 1=n to produce a spectrum with fft, then you must also use option 1=n if you want to pass that same spectral data to invfft. Similarly, if you use option 1=n for fft, then you also need to use option 1=n with fftw to get the proper frequency vector corresponding to your spectrum. Invfft and fftk work in the same way. Syntax out = fftk(x); fftk(x,option1,option2); Description Returns the spatial wavevector kx associated with a fourier transform of a function of x.. Option1 1 : the standard fft (default) 2 : frequencies above the Nyquist frequency are removed 3 : the fft is shifted so both positive and negative frequencies are seen Option2 0: no zero padding 1: zero padding up to the next power of 2 longer than the length of Ex (default)

2003 - 2012 Lumerical Solutions, Inc

Scripting Language

237

N: zero pad up to length N if N > length(x). If N <= length (x), it will zero pad up to the next power of 2 longer than the length of x. For the fastest results, N should be a power of 2 and can be entered, for example, as 2^12. See Also Functions 205 , fft 233 , fftw 235 , invfft 237 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.4.52 invfft
Compute the 1D,2D or 3D inverse Fast Fourier Transform (fft) of a matrix. In the 1D case the transform is given by

E x [ m]

invfft( E w )

1 N

E w [ n] e
n 1

2 i )( n 1)( m 1) N

The inverse fft, fft and all related functions have an option (option 1 below) that controls the format used to store the frequency domain data. When working with spectral data it is not possible to switch between formats; there are no functions to convert between formats. This implies that if you use option 1=n to produce a spectrum with fft, then you must also use option 1=n if you want to pass that same spectral data to invfft. Similarly, if you use option 1=n for fft, then you also need to use option 1=n with fftw to get the proper frequency vector corresponding to your spectrum. Invfft and fftk work in the same way. Syntax out = invfft(x); invfft(x,option1,option2); Description Returns the inverse fast Fourier transform of x. x can 1D,2D or 3D. option1 This option controls the format used to store the frequency domain data. The options are: 1 : the standard fft (zero frequency is at the first element of the matrix). 2 : zero frequency is the first element, but only data up to and including the Nyquist frequency is stored. This option is only useful for real valued, 1D time/spatial

2003 - 2012 Lumerical Solutions, Inc

238

Reference Guide signals. 3 : the fft is shifted so zero frequency is the central element of the spectrum (precisely, this means the zero frequency point is at element floor(N/2 + 1), where N is the number of samples). option2 This option is either a 1, 2 or 3 element vector depending on whether Ex is 1D, 2D or 3D. For each dimension, specify a value of either 0, 1 or N to obtain the desired 0 padding options. 0: no zero padding 1: zero padding up to the next power of 2 longer than the length of Ex (default) N: zero pad up to length N if N > length(Ex), where length of Ex is the length in a specific dimension. If N <= length(Ex), it will zero pad up to the next power of 2 longer than the length of Ex. For the fastest results, N should be a power of 2 and can be entered, for example, as 2^12. See Also Functions 205 , fft 233 , fftw 235 , fftk 236 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.4.53 czt
Returns the chirped z-transform of a set of data. The czt function is often more convenient than the standard fft functions because you can specify an arbitrary range of k.

E k [ m]

czt ( E x , x, k )
n

E x [n] e ix[ n ]k [ m ] E x [n1, n 2] e ix[ n1]k [ m1]


n1, n 2 ix[ n 2 ] k [ m 2 ]

E k [m1, m2]

czt ( E x , x1, x 2, k1, k 2)

Syntax out = czt(Ex,t,w)

Description Returns the chirped z-transform of Ex, function of t, at

2003 - 2012 Lumerical Solutions, Inc

Scripting Language

239

each desired angular frequency w. Note that w must be a linearly spaced set of angular frequencies but can cover any range. czt(Ex,x,y,kx,ky); The two dimensional chirped z-transform. kx and ky must be linearly spaced sets of wavenumbers but can cover any range.

See Also Functions 205 , fft 233 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.4.54 polyarea
Returns the area of a polygon. The area is positive if the vertices are defined in a counterclockwise direction, and negative if the vertices are defined in a clockwise direction. The polygon vertices are contained in a single matrix of dimension Nx2 (or 2xN) where N >= 3. The second dimension represents the x,y positions. For example, a valid polygon is V = [ 0,0; 1,0; 1,1; 0,1]; Syntax out = polyarea(V); Description Returns the area of V. The sign of the area indicates if V is defined in a counter-clockwise (positive) or clockwise (negative) direction.

See Also Functions 205 , centroid 240 , polyintersect 240 , inpoly 241 , polygrow 241 , polyand 242 , polyor 242 , polydiff 243 , polyxor 244 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

2003 - 2012 Lumerical Solutions, Inc

240

Reference Guide

8.4.55 centroid
Returns the center of mass of a polygon. The polygon vertices are contained in a single matrix of dimension Nx2 (or 2xN) where N >= 3. The second dimension represents the x,y positions. For example, a valid polygon is V = [ 0,0; 1,0; 1,1; 0,1]; Syntax out = centroid(V); Description Returns the center of mass of V, assuming uniform density. The output is a 2x1 matrix representing the x and y positions.

See Also Functions 205 , polyarea 239 , polyintersect 240 , inpoly 241 , polygrow 241 , polyand 242 , polyor 242 , polydiff 243 , polyxor 244 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.4.56 polyintersect
Determines if two polygons intersect. This command is available in FDTD Solutions 7.0. It is not available in MODE Solutions 4.0. The polygon vertices are contained in a single matrix of dimension Nx2 (or 2xN) where N >= 3. The second dimension represents the x,y positions. For example, a valid polygon is V = [ 0,0; 1,0; 1,1; 0,1]; Syntax out = polyintersect(V1,V2); Description Returns 0 if the polygons do not overlap 0.5 if the polygons touch 1 if they overlap 2 if one polygon completely encloses the other

See Also

2003 - 2012 Lumerical Solutions, Inc

Scripting Language

241

Functions 205 , polyarea 239 , centroid 240 , inpoly 241 , polygrow 241 , polyand 242 , polyor 242 , polydiff 243 , polyxor 244 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.4.57 inpoly
Determines if a point is inside our outside a polygon. The function is vectorized so it can be used to create a mesh of a polygon. The polygon vertices are contained in a single matrix of dimension Nx2 (or 2xN) where N >= 3. The second dimension represents the x,y positions. For example, a valid polygon is V = [ 0,0; 1,0; 1,1; 0,1]; Syntax out = inpoly(V,x,y); Description Returns a matrix of the same dimension of x with 1 if the corresponding point is inside the polygon and 0 otherwise. The matrices x and y must have the same length, or one of them can be a singleton.

See Also Functions 205 , polyarea 239 , centroid 240 , polyintersect 240 , polygrow 241 , polyand 242 , polyor 242 , polydiff 243 , polyxor 244 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.4.58 polygrow
Returns a polygon that has grown or shrunk by the specified amount. The polygon is grown in a direction normal to every line segment. The polygon vertices are contained in a single matrix of dimension Nx2 (or 2xN) where N >= 3. The second dimension represents the x,y positions. For example, a valid polygon is V = [ 0,0; 1,0; 1,1; 0,1];

2003 - 2012 Lumerical Solutions, Inc

242

Reference Guide

Syntax out = plygrow(V,dx);

Description Returns a new polygon that has grown by dx. To shrink a polygon, use dx < 0.

See Also Functions 205 , polyarea 239 , centroid 240 , polyintersect 240 , inpoly 241 , polyand 242 , polyor 242 , polydiff 243 , polyxor 244 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.4.59 polyand
Combines two polygons into one using a boolean and operation. The polygon vertices are contained in a single matrix of dimension Nx2 (or 2xN) where N >= 3. The second dimension represents the x,y positions. For example, a valid polygon is V = [ 0,0; 1,0; 1,1; 0,1]; Syntax V3 = polyand(V1,V2); Description Returns a new polygon, V3, that is the and of V1 and V2.

See Also Functions 205 , polyor 242 , polydiff 243 , polyxor 244 , polyarea 239 , centroid 240 , polyintersect 240 , inpoly 241 , polygrow 241 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.4.60 polyor
Combines two polygons into one using a boolean or operation. The polygon vertices are contained in a single matrix of dimension Nx2 (or 2xN) where N >= 3. The second dimension represents the x,y positions. For example, a valid polygon is

2003 - 2012 Lumerical Solutions, Inc

Scripting Language V = [ 0,0; 1,0; 1,1; 0,1]; Syntax V3 = polyor(V1,V2); Description Returns a new polygon, V3, that is the or of V1 and V2.

243

See Also Functions 205 , polyand 242 , polydiff 243 , polyxor 244 , polyarea 239 , centroid 240 , polyintersect 240 , inpoly 241 , polygrow 241 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.4.61 polydiff
Combines two polygons into one by taking the difference. The polygon vertices are contained in a single matrix of dimension Nx2 (or 2xN) where N >= 3. The second dimension represents the x,y positions. For example, a valid polygon is V = [ 0,0; 1,0; 1,1; 0,1]; Syntax V3 = polydiff(V1,V2); Description Returns a new polygon, V3, that is V1-V2.

See Also Functions 205 , polyand 242 , polyor 242 , polyxor 244 , polyarea 239 , centroid 240 , polyintersect 240 , inpoly 241 , polygrow 241 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

2003 - 2012 Lumerical Solutions, Inc

244

Reference Guide

8.4.62 polyxor
Combines two polygons into one using a boolean xor operation. The polygon vertices are contained in a single matrix of dimension Nx2 (or 2xN) where N >= 3. The second dimension represents the x,y positions. For example, a valid polygon is V = [ 0,0; 1,0; 1,1; 0,1]; Syntax V3 = polyxor(V1,V2); Description Returns a new polygon, V3, that is the xor of V1 and V2.

See Also Functions 205 , polyand 242 , polyor 242 , polydiff 243 , polyarea 239 , centroid 240 , polyintersect 240 , inpoly 241 , polygrow 241 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.4.63 lineintersect
Returns the intersection points of lines in the x-y plane. Note that the intersection point does not have to lie on the line segments themselves that define the lines. To see if the line segments actually cross the command linecross should be used. Line segments are contained in a single matrix of dimension 2*Nx2, where there are N line segments. For example, the matrix L = [ 0,0; 1,1; 0,0, 0,1]; represents 2 lines segments, one from (0,0) to (1,1) and another from (0,0) to (0,1). Syntax out = lineintersect(L1,L2); Description Returns the intersection of the lines represented by the segments in L1 and L2. L1 and L2 must have the same size (2*N,2 for N line segments). The result is a sequence of x,y points in the form Nx2 representing the intersections of the N lines. There are special cases when The lines are parallel. In this case, the position returned is (1.#INF,b). The value of 1.#INF can be tested for using the script commands finite. The value of b is 0 if the lines are not coincident and 1 if they are coincident. The points in a segment are degenerate, ie the same. In

2003 - 2012 Lumerical Solutions, Inc

Scripting Language

245

this case, the position returned is (1.#INF,b), where b is 0, 1, 2 if the both line segments are degenerate, the first is degenerate, or the second is degenerate respectively. See Also Functions 205 , linecross 245 , finite 249 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.4.64 linecross
Determines if line segments cross each other. Line segments are contained in a single matrix of dimension 2*Nx2, where there are N line segments. For example, the matrix L = [ 0,0; 1,1; 0,0, 0,1]; represents 2 lines segments, one from (0,0) to (1,1) and another from (0,0) to (0,1). Syntax out = linecross(L1,L2); Description Returns a matrix of dimension N which determines if the N line segments in L1 and the N line segments in L2 cross. L1 and L2 must have the same size (2*Nx2 for N line segments). The result is a matrix of length N that is 0 if the segments do not cross, 1 if they cross and 0.5 if the endpoint of one line touches another. Line segments that are coincident and touch also return a value of 0.5

See Also Functions 205 , lineintersect 244 , finite 249 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

2003 - 2012 Lumerical Solutions, Inc

246

Reference Guide

8.4.65 ceil
The ceil command rounds the input to the nearest integer greater than or equal to itself. Syntax out = ceil(X); Description Returns the nearest integer greater than or equal to X.

See Also Functions 205 , floor 246 , mod 246 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.4.66 floor
The floor command rounds the input to the nearest integer less than or equal to itself. Syntax out = floor(X); See Also Functions 205 , ceil 246 , mod 246 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes Description Returns the nearest integer less than or equal to X.

8.4.67 mod
Modulus after division. Syntax out = mod(X,Y); Description Returns X - n.*Y where n = floor(X./Y) if Y is not equal to 0. The input X must be a real array or a real scalar. Y must be a real scalar.

2003 - 2012 Lumerical Solutions, Inc

Scripting Language The following are true by convention: mod(X,0) = X mod(X,X) = 0 See Also Functions 205 , floor 246 , ceil 246 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

247

8.4.68 sign
Get the sign of a number. Syntax out = sign(data); Description Real values sign = 0 for data=0 sign = 1 for data>0 sign =-1 for data<0 Complex values sign = 0 for data=0+0i sign = data/abs(data) for data!=0 See Also Functions 205 , floor 246 , ceil 246 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Version 8+ Version 6+ Version 2+ Yes

8.4.69 round
Rounds a number to the nearest integer. Syntax Description

2003 - 2012 Lumerical Solutions, Inc

248

Reference Guide out = round(x); See Also Functions 205 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes Rounds x to the nearest integer.

8.4.70 rand
Generate a uniform random number between 0 and 1. Syntax out = rand; out = rand(min,max); out = rand(min,max,option); Description Generates a uniform random number between 0 and 1. Generates a random number between min and max. By default, min and max are 0 and 1 respectively. option = 1: output is a double precision number between min and max (default) option = 2: output is an integer between min and max.

See Also Functions 205 , randreset 248 , randmatrix 186 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.4.71 randreset
Resets the random number generator seed. Syntax out = randreset; Description Resets the random number seed based on the clock time. This function returns the random number seed that was

2003 - 2012 Lumerical Solutions, Inc

Scripting Language used. out = randreset(seed); Set the seed to a specific value

249

See Also Functions 205 , rand 248 , randmatrix 186 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.4.72 finite
The finite command returns 1 (true) if a value is finite. Numbers such as NaN or #1.INF return 0 (false). Syntax out = finite(x); Description Returns a matrix of the same size as x. The values are 1 for values of x that are finite and 0 for values that are NaN. For example, finite(1/0) returns 0.

See Also Functions 205 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.4.73 solar
Returns the solar power spectrum, in Watts/meter^2/meter. Syntax out = solar(1); out = solar(0); Description Returns the power of the solar spectrum as a function of wavelength, in W/m^2/m Returns the corresponding wavelength vector, in m

2003 - 2012 Lumerical Solutions, Inc

250

Reference Guide

Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE No No No Yes

See Also plot 253 , integrate 225

8.4.74 stackrt
Calculates reflection and transmission of a plane wave through a multi-layer stack. Syntax RT = stackrt(n,d,f); Description RT is a data set that contains the fraction of reflected and transmitted power, and complex r,t coefficients for both S and P polarizations. Arguments for a stack with Nlayer: n: Refractive index of each layer. Size is either Nlayers, or Nlayers x length(f) if dispersive materials are involved d: Thickness of each layer. Size is Nlayers. The thickness of the first and last layers is not important, as they are assumed to be infinite. f: Frequency vector. RT = stackrt(n,d,f,theta); theta: Angle vector, in degrees. Optional.

Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE See Also Functions 205 FDTD 8 No No No

2003 - 2012 Lumerical Solutions, Inc

Scripting Language

251

8.5

Loop and conditional statements


The scripting language currently supports FOR loops and IF statements. Other control structures such as while loops or case statements must be constructed from these. Command for 251 if 252 while 251 Description For loop. If statement. A for loop must be used. See the for loop section.

8.5.1 for
for loops allow some operations to be repeated a number of times. A while loop can be implemented when using the three argument version of for. Syntax for(x=1:100) { ?x; } Description Single argument for loop. The loop will be sequentially executed for each value of x. Three argument for loop. x=1 at the start of the loop. The loop continues while x <=100 and sets x=x+1 at each pass. This is equivalent to a while loop that will execute while x<10.

for(x=1; x<= 100; x=x+1) { ?x; } x=1; for(0; x<10; 0) { ?x; x=x+1; } See Also Loops 251 , if 252 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

2003 - 2012 Lumerical Solutions, Inc

252

Reference Guide

8.5.2 if
The scripting language supports if statements in the following forms: Syntax if(x < 5) { y = x^2; } if(x < 5) { y = x^2; } if(x < 5) { y = x^2; } else { y = x^3; } if(x < 5) { if(x > 0) {y = x^2; } } else { y = x^3; } See Also Loops 251 , for 251 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes Description Simple if statement on one line. Multi-line if statement

If else statement.

Nested if statement with else.

8.6

Plotting commands
Line and image plots are supported. These figures can be exported to jpeg images. Plotting functions. Command plot 253 plotxy 254 polar 255 Description Makes line plots. Makes line plots, when data sets are sampled at different position vectors. Makes polar plots.

2003 - 2012 Lumerical Solutions, Inc

Scripting Language polar2 256 polarimage 257 legend 257 image 258 setplot 260 visualize 259 Miscellaneous plotting functions. Command selectfigure 259 exportfigure 260 closeall 261 Description Selects a figure. Exports a figure. Closes all figure windows. Makes polar plots, when data sets are sampled at different position vectors. Makes a 2D polar image plot. Makes a legend on a figure with line plots. Makes 2D image plots. Sets figure properties. Pass in simulation data to the visualizer.

253

8.6.1 plot
Create line plots. All data sets must be sampled on the same position vector. See plotxy for data sets that are sampled on different position vectors. Syntax out = plot(x,y); Description Creates a plot of y vs x, y and x are both 1D vectors with the same length. The figure number is returned. x is a nx1 matrix. y is a nxm matrix. This will generate a graph with m lines. (y(1:n,1) vs x, y(1: n,2) vs x, etc) Creates a plot with 3 curves, x,y1, y2, y3 must be the same length, returns the figure number. Creates a plot of y vs x with axis labels and a title, returns the figure number. Creates a plot with desired options. Options can be be logplot plot lines OR plot points

plot(x,y);

plot(x,y1,y2,y3); plot(x,y, "x label", "y label", "title"); plot(x,y, "x label", "y label", "title", "options");

2003 - 2012 Lumerical Solutions, Inc

254

Reference Guide greyscale OR color polar (used for imaging far field projections) any comma separated list of the above, for example "logplot,greyscale,polar" Returns the figure number. See Also Plotting commands 252 , plotxy 254 , legend 257 , image 258 , closeall 261 , setplot 260 , exportfigure 260 , visualize 259 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.6.2 plotxy
Create line plots. In particular, this function is used when the data sets are sampled on different position vectors. Syntax out = plotxy(x,y); Description Creates a plot of y vs x, y and x are both 1D vectors with the same length. The figure number is returned. Creates a plot with multiple curves. The xn-yn pairs must have the same length, but x1, x2, and xn can have different start-end values and resolutions. It returns the figure number.

plotxy(x1,y1,x2,y2,xn,yn);

plotxy(x1,y1,x2,y2, "x label", Creates line plots with axis labels and a title, returns the "y label", "title"); figure number. See Also Plotting commands 252 , plot 253 , legend 257 , image 258 , closeall 261 , setplot 260 , exportfigure 260 , visualize 259 Available in

2003 - 2012 Lumerical Solutions, Inc

Scripting Language FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

255

8.6.3 polar
Create polar plots. All data sets must be sampled on the same position vector. See polar2 for data sets that are sampled on different position vectors. Syntax out = polar(theta,rho) Description Creates a polar coordinate plot of the angle theta versus the radius rho. theta is the angle from the x-axis to the radius vector specified in radians; rho is the length of the radius vector. Theta and rho can be vectors of the same length, or if the length of theta is n, then y can be a nxm matrix. The figure number is returned. polar(theta,rho1,rho2,rho3) polar(theta,rho,"x label", "y label", "title") polar(theta,rho,"x label", "y label", "title", "options"); Creates a plot with 3 curves, theta, rho1, rho2, rho3 must be the same length, returns the figure number. Creates a plot of y vs x with axis labels and a title, returns the figure number. Creates a plot with desired options. Options can be be logplot plot lines OR plot points greyscale OR color any comma separated list of the above, for example "logplot,greyscale,polar" Returns the figure number.

See Also Plotting commands 252 , polar2 256 , legend 257 , image 258 , closeall 261 , setplot 260 , exportfigure 260 , polarimage 257 Available in

2003 - 2012 Lumerical Solutions, Inc

256

Reference Guide FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.6.4 polar2
Create polar plots. In particular, this function is used when the data sets are sampled on different position vectors. Syntax out = polar(theta,rho) Description Creates a polar coordinate plot of the angle theta versus the radius rho. theta is the angle from the x-axis to the radius vector specified in radians; rho is the length of the radius vector. Theta and rho can be vectors of the same length, or if the length of theta is n, then y can be a nxm matrix. The figure number is returned. polar(theta1,rho1,theta2, rho2) polar(theta,rho,"x label", "y label", "title") polar(theta,rho,"x label", "y label", "title", "options"); Creates a plot with 2 curves. The two data sets can be sampled on different theta vectors. Creates a plot of y vs x with axis labels and a title, returns the figure number. Creates a plot with desired options. Options can be be logplot plot lines OR plot points greyscale OR color any comma separated list of the above, for example "logplot,greyscale,polar" Returns the figure number.

See Also Plotting commands 252 , polar 255 , legend 257 , image 258 , closeall 261 , setplot 260 , exportfigure 260 , polarimage 257 Available in

2003 - 2012 Lumerical Solutions, Inc

Scripting Language FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

257

8.6.5 polarimage
Create 2D polar image plots. This is typically used to plot far field data. Syntax polarimage(ux,uy,data); Description Creates a 2D image plot. If ux is of dimension N x 1, where ux goes from -1 to 1 uy is of dimension M x 1, where uy goes from -1 to 1 data must be of dimension N x M Creates a 2D image plot with axis labels Optionally returns the figure number. Creates a 2D image plot with axis labels and options, options can be logplot

out = image(ux,uy,data, "x label", "y label", "title"); image(ux,uy,data, "x label", "y label", "title", "options");

See Also Plotting commands 252 , plot 253 , polar 255 , image 258 , closeall 261 , setplot 260 , exportfigure 260 , visualize 259 , Near to far field projections 358 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.6.6 legend
Add a legend to a line plot. Syntax legend ("legend1","legend2",..., "legendn"); See Also Description Adds a legend to the selected figure. This function does not return any data.

2003 - 2012 Lumerical Solutions, Inc

258

Reference Guide Plotting commands 252 , legend 257 , plot 253 , closeall 261 , visualize 259 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.6.7 image
Create 2D image plots. Syntax out = image(x,y,z); Description Creates a 2D image plot. If x is of dimension N x 1 y is of dimension M x 1 z must be of dimension N x M Returns the figure number. Creates a 2D image plot with axis labels, returns the figure number. Creates a 2D image plot with axis labels and options, options can be logplot polar any comma separated list of the above

image(x,y,z, "x label", "y label", "title"); image(x,y,z, "x label", "y label", "title", "options");

See Also Plotting commands 252 , plot 253 , closeall 261 , setplot 260 , exportfigure 260 , visualize 259 , polarimage 257 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

2003 - 2012 Lumerical Solutions, Inc

Scripting Language

259

8.6.8 visualize
Send data to the visualizer. Syntax visualize(R); visualize("name", x,y,z, p1,"p1", p2,"p2", "a1",a1,"a2",a2); visualize("name", x,y,z, p1,"p1", p2,"p2", "a1",a1x,a1y,a1z); visualize("name", p1,"p1", p2,"p2", "a1",a1x,a1y,a1z); Plot data not attached to a spatial grid. Description Plots the dataset R in the Visualizer. Plots data on a spatial grid. name - Visualizer name x,y,z - spatial grid vectors p1,"p1" - additional parameter vectors (vector, then parameter name). "a1",a1 - data attributes (data name, then data matrix) Plot vector data "a1",a1x,a1y,a1z - data attributes (data name, then data matrix X,Y,Z components)

See Also Plotting commands 252 , exportfigure 260 , image 258 , plot 253 , setplot 260 , closeall 261 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Version 8+ Version 5+ Yes Yes

8.6.9 selectfigure
Selecting a figure will show the figure on screen (give it focus). A warning will be generated if the figure does not exist. Syntax selectfigure; Description Selects the last figure that was created. This function does not return any data.

2003 - 2012 Lumerical Solutions, Inc

260

Reference Guide selectfigure(1); Selects figure 1.

See Also Plotting commands 252 , exportfigure 260 , image 258 , plot 253 , setplot 260 , closeall 261 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.6.10 setplot
Set figure properties. Syntax ?setplot; Description Creates a string which lists all figure properties for the figure that is currently selected. Unless the setfigure() command was called, the most recently created plot will be selected. Set the desired property of the currently selected figure to property value.

setplot("property", "property value");

See Also Plotting commands 252 , image 258 , plot 253 , visualize 259 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.6.11 exportfigure
Exports the current figure to a JPG image. If the file extension is not specified, ".jpg" will be used. The image size will be the same as the figure window size. If a file is overwritten, a warning will be generated. If an export fails, a warning will be generated.

2003 - 2012 Lumerical Solutions, Inc

Scripting Language Syntax exportfigure("filename"); Description

261

Exports the current figure to a JPG image with the name "filename". The exported image will have the same size as the current figure.

See Also Plotting commands 252 , selectfigure 259 , image 258 , plot 253 , setplot 260 , closeall 261 , visualize 259 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.6.12 closeall
Close all open figure windows. Syntax closeall; Description Close all open figure windows. This function does not return any data.

See Also Plotting commands 252 , plot 253 , image 258 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.7

Adding Objects
The following commands can be used to add objects. Objects are always added to the location specified by the groupscope variable. Simulation environment Command Description

2003 - 2012 Lumerical Solutions, Inc

262

Reference Guide switchtolayout 264 Closes the analysis window, deletes current simulation data and allows you to manipulate simulation objects for a new simulation. Used to determine if the simulation file is open in layout or in analysis mode. Changes the group scope. Adds a container group to the simulation environment. Add an analysis group. Add an object from the object library. Add a grid attribute object.

layoutmode 264 groupscope 284 addgroup 264 addanalysisgroup 265 addobject 266 addgridattribute 280 Structures Command addcircle 266 addcustom 267 addimport 267 addpyramid 267 addpoly 268 addrect 268 addring 269 addsphere 270 addsurface 270 addstructuregroup 265 addconstdope adddiffusion 279 addbulkgen 280 addimportdope 279 addimportgen 280 Simulation region

Description Add a circle primitive. Add a custom primitive. Add an import primitive. Add a pyramid primitive. Add a polygon primitive Add a rectangle primitive. Add a ring primitive. Add a sphere primitive. Add a surface primitive. Add a structure group. Add a constant doping region. Add a diffusion region. Add a bulk generation region. Add an import primitive for a doping region. Add an import primitive for a generation region.

2003 - 2012 Lumerical Solutions, Inc

Scripting Language Command addfdtd 270 addeigenmode 271 addpropagator 271 addmesh 272 adddevice 278 Sources Command adddipole 273 addgaussian 273 addplane 274 addmode 272 ; addmodesource 273 addtfsf 274 addimportedsource 275 Monitors Command addindex 275 addtime 276 addmovie 276 addprofile 276 addpower 277 Create objects in Deck Command createbeam 277 Description Creates a new Gaussian beam that is accessible from the deck. Description Add an index monitor. Add a time monitor. Add a movie monitor. Add a profile monitor. Add a power monitor. Description Add a dipole source. Add a Gaussian source. Add a plane source. Add a mode source. Add a TFSF source. Add an imported source. Description Add an FDTD simulation area. Adds a MODE simulation area. Adds a propagator simulation object to the MODE Solutions simulation environment. Add a mesh override region. Adds a DEVICE simulation area.

263

2003 - 2012 Lumerical Solutions, Inc

264

Reference Guide

8.7.1 switchtolayout
Closes the analysis window and allows you to manipulate simulation objects for a new simulation. If a simulation file is open in ANALYSIS mode, any commands to modify objects will return errors. You must switch to LAYOUT mode before modifying any ob jects. Syntax switchtolayout; Description Switches to LAYOUT mode. This function does not return any data.

See Also Adding Objects 261 , layoutmode 264 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.7.2 layoutmode
Used to determine if the simulation file is open in layout or in analysis mode. Syntax ?layoutmode; Description Returns 1 if in layout mode, and 0 if in analysis mode.

See Also Adding Objects 261 , switchtolayout 264 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.7.3 addgroup
Adds a container group to the simulation environment. Syntax Description

2003 - 2012 Lumerical Solutions, Inc

Scripting Language addgroup; Adds a container group to the simulation environment. This function does not return any data.

265

See Also Adding Objects 261 , addtogroup 290 , addstructuregroup 265 , addanalysisgroup 265 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No Yes

8.7.4 addstructuregroup
Adds a structure group to the simulation environment. Syntax addstructuregroup; Description Adds a structure group to the simulation environment. This function does not return any data.

See Also Adding Objects 261 , addtogroup 290 , adduserprop 291 , addgroup 264 , addanalysisgroup 265 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No Yes

8.7.5 addanalysisgroup
Adds an analysis group to the simulation environment. Syntax addanalysisgroup; Description Adds an analysis group to the simulation environment. This function does not return any data.

See Also Adding Objects 261 , addtogroup 290 , adduserprop 291 , addgroup 264 , addstructuregroup 265 Available in
2003 - 2012 Lumerical Solutions, Inc

266

Reference Guide FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No Yes

8.7.6 addobject
Adds a object from the object library. T Syntax addobject("script_ID"); Description Adds an object from the object library. This function does not return any data.

See Also Adding Objects 261 , addtogroup 290 , adduserprop 291 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No No

8.7.7 addcircle
Adds a circle primitive to the simulation environment. Syntax addcircle; Description Adds primitive to the simulation environment. This function does not return any data.

See Also Adding Objects 261 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE asdd Yes Yes No Yes

2003 - 2012 Lumerical Solutions, Inc

Scripting Language

267

8.7.8 addcustom
Adds a custom primitive to the simulation environment. Syntax addcustom; Description Adds primitive to the simulation environment. This function does not return any data.

See Also Adding Objects 261 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No No

8.7.9 addimport
Adds an import primitive to the simulation environment. Syntax addimport; Description Adds primitive to the simulation environment. This function does not return any data.

See Also Adding Objects 261 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No No

8.7.10 addpyramid
Adds a pyramid primitive to the simulation environment. Syntax addpyramid; Description Adds primitive to the simulation environment.

2003 - 2012 Lumerical Solutions, Inc

268

Reference Guide This function does not return any data. See Also Adding Objects 261 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No Yes

8.7.11 addpoly
Adds a polygon primitive to the simulation environment. Syntax addpoly; Description Adds primitive to the simulation environment. This function does not return any data.

See Also Adding Objects 261 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No Yes

8.7.12 addrect
Adds a rectangle primitive to the simulation environment. Syntax addrect; Description Adds primitive to the simulation environment. This function does not return any data.

See Also Adding Objects 261 Available in

2003 - 2012 Lumerical Solutions, Inc

Scripting Language FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No Yes

269

8.7.13 addtriangle
Adds a 3 vertex, triangle shaped polygon primitive to the simulation environment. Syntax addtriangle; Description Adds primitive to the simulation environment. This function does not return any data.

See Also Adding Objects 261 , addpoly 268 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No Yes

8.7.14 addring
Adds a ring primitive to the simulation environment. Syntax addring; Description Adds primitive to the simulation environment. This function does not return any data.

See Also Adding Objects 261 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No Yes

2003 - 2012 Lumerical Solutions, Inc

270

Reference Guide

8.7.15 addsphere
Adds a sphere primitive to the simulation environment. Syntax addsphere; Description Adds primitive to the simulation environment. This function does not return any data.

See Also Adding Objects 261 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No Yes

8.7.16 addsurface
Adds a surface primitive to the simulation environment. Syntax addsurface; Description Adds primitive to the simulation environment. This function does not return any data.

See Also Adding Objects 261 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No No

8.7.17 addfdtd
Adds a FDTD simulation area to the simulation environment. Syntax addfdtd; Description Adds a simulation area to the simulation environment.

2003 - 2012 Lumerical Solutions, Inc

Scripting Language This function does not return any data. See Also Adding Objects 261 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No No

271

8.7.18 addeigenmode
Adds an eigenmode simulation object to the MODE Solutions simulation environment. Syntax addeigenmode; See Also Adding Objects 261 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE No Yes No No Description Add an eigenmode mode simulation region.

8.7.19 addpropagator
Adds a propagator simulation object to the MODE Solutions simulation environment. Syntax addpropagator; See Also Adding Objects 261 Available in Description Add a propagator mode simulation region.

2003 - 2012 Lumerical Solutions, Inc

272

Reference Guide FDTD Solutions MODE Solutions INTERCONNECT DEVICE No Yes No No

8.7.20 addmesh
Adds a mesh override region to the simulation environment. Syntax addmesh; Description Adds a mesh override region to the simulation environment. This function does not return any data.

See Also Adding Objects 261 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No No

8.7.21 addmode
Adds a mode source to the simulation environment. Syntax addmode; Description Adds source to the simulation environment. This function does not return any data.

See Also Adding Objects 261 , updatesourcemode 306 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No No

2003 - 2012 Lumerical Solutions, Inc

Scripting Language

273

8.7.22 addmodesource
Adds a mode source to the simulation environment. Syntax addmodesource; Description Adds source to the simulation environment. This function does not return any data.

See Also Adding Objects 261 , addmode 272 , updatesourcemode 306 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE No Yes No No

8.7.23 adddipole
Adds a dipole source to the simulation environment. Syntax adddipole; Description Adds source to the simulation environment. This function does not return any data.

See Also Adding Objects 261 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No No

8.7.24 addgaussian
Adds a gaussian source to the simulation environment. Syntax addgaussian; Description Adds source to the simulation environment.

2003 - 2012 Lumerical Solutions, Inc

274

Reference Guide This function does not return any data. See Also Adding Objects 261 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No No

8.7.25 addplane
Adds a plane wave source to the simulation environment. Syntax addplane; Description Adds source to the simulation environment. This function does not return any data.

See Also Adding Objects 261 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No No

8.7.26 addtfsf
Adds a Total Field Scattered Field (tfsf) source to the simulation environment. Syntax addtfsf; Description Adds source to the simulation environment. This function does not return any data.

See Also Adding Objects 261 Available in

2003 - 2012 Lumerical Solutions, Inc

Scripting Language FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No No

275

8.7.27 addimportedsource
Adds an imported source to the simulation environment. Syntax addimportedsource; Description Adds source to the simulation environment. This function does not return any data.

See Also Adding Objects 261 , asapimport 177 , asapload 176 , asapexport 176 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes No No No

8.7.28 addindex
Adds an index monitor to the simulation environment. Syntax addindex; Description Adds monitor to the simulation environment. This function does not return any data.

See Also Adding Objects 261 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No No

2003 - 2012 Lumerical Solutions, Inc

276

Reference Guide

8.7.29 addtime
Adds a time monitor to the simulation environment. Syntax addtime; Description Adds monitor to the simulation environment. This function does not return any data.

See Also Adding Objects 261 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No No

8.7.30 addmovie
Adds a movie monitor to the simulation environment. Syntax addmovie; Description Adds monitor to the simulation environment. This function does not return any data.

See Also Adding Objects 261 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No No

8.7.31 addprofile
Adds a profile monitor to the simulation environment. Syntax addprofile; Description Adds monitor to the simulation environment.

2003 - 2012 Lumerical Solutions, Inc

Scripting Language This function does not return any data. See Also Adding Objects 261 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No No

277

8.7.32 addpower
Adds a power monitor to the simulation environment. Syntax addpower; Description Adds monitor to the simulation environment. This function does not return any data.

See Also Adding Objects 261 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No No

8.7.33 createbeam
Creates a new Gaussian beam that is accessible from the deck. Only available in MODE Solutions. Syntax createbeam; Description Creates a Gaussian beam in the deck/global workspace. The Gaussian beam has the properties specified in the Overlap analysis->Beam tab of the analysis window Returns the name of the Gaussian beam created, which is by default "gaussian#" (# being the total number of Gaussian beams existing in the current deck).

2003 - 2012 Lumerical Solutions, Inc

278

Reference Guide See Also Adding Objects 261 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE No Yes No No

8.7.34 adddevice
Adds a Device simulation region to the simulation environment.

Syntax adddevice; See Also Adding Objects 261 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE No No No Yes

Description Add a device simulation region.

8.7.35 adddope
Adds a region with constant doping to the simulation environment.

Syntax addconstdope; See Also Adding Objects 261 Available in

Description Add a constant doping region.

2003 - 2012 Lumerical Solutions, Inc

Scripting Language FDTD Solutions MODE Solutions INTERCONNECT DEVICE No No No Yes

279

8.7.36 adddiffusion
Adds a diffusion region to the simulation environment.

Syntax adddiffusion; See Also Adding Objects 261 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE No No No Yes

Description Add a diffusion region.

8.7.37 addimportdope
Adds a doping region to the simulation environment where the doping profile has been or will be imported into DEVICE.

Syntax addimportdope; See Also Adding Objects 261 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE No No No Yes

Description Add an import primitive to define a doping region.

2003 - 2012 Lumerical Solutions, Inc

280

Reference Guide

8.7.38 addbulkgen
Adds a bulk generation region to the simulation environment.

Syntax addbulkgen; See Also Adding Objects 261 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE No No No Yes

Description Add a bulk generation region.

8.7.39 addimportgen
Adds a generation region to the simulation environment where the generation profile has been imported into DEVICE.

Syntax addimportgen; See Also Adding Objects 261 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE No No No Yes

Description Add an import primitive to define a generation region.

8.7.40 addgridattribute
Adds a grid attribute object to the simulation environment. Syntax Description

2003 - 2012 Lumerical Solutions, Inc

Scripting Language ?addgridattribute; addgridattribute(type,value); Outputs a list of available grid attribute types. Adds a grid attribute object to the simulation. type: This string defines the type of attribute to be added. value: the attribute value. Depending on the attribute type, the value may be a scalar number (i.e. concentration), a 3 element vector (i.e. orientation), 9 element tensor, etc.

281

addgridattribute(type,value,x, Adds a grid attribute with spatially varying data. y,z); type: This string defines the type of attribute to be added. value: the attribute value. Depending on the attribute type, the value may be a scalar number (i.e. concentration), a 3 element vector (i.e. orientation), 9 element tensor, etc. The size of the value matrix should be Nx X Ny X Nz X M , where Nx, Ny, Nz are the sizes of the position vectors, and M is the size of the attribute value (scalar, vector, tensors, etc). x,y,z: Vectors that specify the position where the attribute values are specified. See Also Adding Objects 261 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Version 8+ No No No

8.7.41 addelement
Adds an element from the INTERCONNECT element library to the simulation environment. Syntax addelement("element"); Description Adds an element from the element library. If no element name is given, this command will add a compound element by default.

2003 - 2012 Lumerical Solutions, Inc

282

Reference Guide FDTD Solutions MODE Solutions INTERCONNECT DEVICE No No Yes No

8.8

Manipulating objects
Physical structures, sources, monitors, and the simulation volume itself are considered objects. Objects generally have properties that can be modified. Selecting and deleting objects Command groupscope 284 deleteall 285 delete 285 selectall 286 unselectall 286 select 287 selectpartial 287 shiftselect 288 Description Changes the group scope. Deletes all objects in the current group scope. Deletes the selected objects. Selects all objects in the current group scope. Unselect all objects. Selects objects with a given name in the current group scope. Selects any objects where partialname can be found in the name, in the current TAB. The same as select("name"); but does not unselect currently selected objects. Can be used to select multiple objects. The same as selectpartial("partialname"); but does not unselect currently selected objects. Can be used to select multiple objects.

shiftselectpartial 289

Moving and copying objects Command move 289 copy 290 addtogroup 290 Object properties Description Move an object. Copy an object. Add an object/objects into a group.

2003 - 2012 Lumerical Solutions, Inc

Scripting Language Command adduserprop 291 set 292 setnamed 292 setglobalmonitor 293 setglobalsource 294 runsetup 295 get 294 getnumber 296 getnamed 296 getnamednumber 297 getglobalmonitor 298 getglobalsource 298 haveproperty 299 importsurface 300 importsurface2 301 importnk 302 importnk2 304 setsourcesignal 305 updatesourcemode 306 clearsourcedata 307 Description Add a user property to a structure group. Set a property of selected objects. Set a property of any objects with a given name. Set global monitor properties. Set global source properties. Force group setup scripts to run. Get a property of selected objects. Get the number of selected objects. Get a property of any objects with a given name. Get the number of objects with a given name. Get global monitor properties. Get global source properties. Returns the number of selected objects with a particular property.

283

Import surface data from a file. Only applies to import primitives. Import surface data from script variables. Only applies to import primitives. Import n and k data from a file. Only applies to import primitives. Import n and k data from script variables. Only applies to import primitives. Set a custom source time signal. Updates the mode for a mode source. Clears source data for an imported source, or the selected mode for a mode source.

Controlling the view Command redraw 307 Description Redraw graphics.

2003 - 2012 Lumerical Solutions, Inc

284

Reference Guide redrawoff 308 redrawon 308 redrawmode 309 setview 310 getview 311 orbit 311 framerate 312 Undo and redo commands Command undo 313 redo 313 Description Undo last modify object command. Redo command after an undo. Turn automatic redraw off. Turn automatic redraw on. Get the current status of automatic redrawing; turn it off or on Control how the graphics are drawn in the Layout Editor Get the current view control properties from the Layout Editor. A built in function to do an orbit of the perspective view with option of creating a movie. Measure graphics performance of your computer.

8.8.1 groupscope
Changes the group scope. Script commands that add or modify simulation object use the groupscope property to know where to act within the object tree. For example, if you want to delete everything within a particular group, set the groupscope to that group (i.e. :: model::my_group). If you want to delete all objects in the simulation, set the group scope the root level (i.e. ::model). Syntax ?groupscope; groupscope("group_name"); Description returns the current group scope changes the group scope

See Also Manipulating objects 282 , delete 285 , selectall 286 , select 287 Available in

2003 - 2012 Lumerical Solutions, Inc

Scripting Language FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

285

8.8.2 deleteall
Deletes all objects in the current group scope. Syntax deleteall; Description Deletes all objects in the current group scope. This function does not return any data.

See Also Manipulating objects 282 , groupscope 284 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.8.3 delete
Deletes selected objects. Syntax delete; Description Deletes selected objects. This function does not return any data.

See Also Manipulating objects 282 , groupscope 284 Available in

2003 - 2012 Lumerical Solutions, Inc

286

Reference Guide FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.8.4 selectall
Selects all objects in the current group scope. Syntax selectall; Description Selects all objects in the current group scope. This function does not return any data.

See Also Manipulating objects 282 , groupscope 284 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.8.5 unselectall
Unselect all objects and groups. Syntax unselectall; Description Unselects all objects and groups. This function does not return any data.

See Also Manipulating objects 282 Available in

2003 - 2012 Lumerical Solutions, Inc

Scripting Language FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

287

8.8.6 select
Selects objects with a given name in the current group scope. A failed select command will have the same result as the unselectall command. Syntax select("name"); Description Selects objects with the name "name" in the current group scope. This function does not return any data.

select("group name::name"); Selects all objects with the name "name" located in the group named "group name". The group named "group name" must be in the current group scope. See Also Manipulating objects 282 , groupscope 284 , unselectall 286 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.8.7 selectpartial
Selects any objects with a given partial name, in the current TAB. Syntax selectpartial("partialname"); Description Selects any objects where "partialname" can be found in the object name provided the object is not in a group. To select objects located in groups see the command below. This function does not return any data.

2003 - 2012 Lumerical Solutions, Inc

288

Reference Guide selectpartial ("partialgroupname:: partialname"); Selects any objects where "partialgroupname" can be found in the group name and "partialname" can be found in the object name.

See Also Manipulating objects 282 , groupscope 284 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.8.8 shiftselect
Same as select, but does not unselect other currently selected objects. Syntax shiftselect("name"); Description The same as select("name"), but does not unselect currently selected objects. Can be used to select multiple objects. This function does not return any data. The same as select("groupname::name"), but does not unselect currently selected objects.

shiftselect("group name:: name");

See Also Manipulating objects 282 , groupscope 284 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

2003 - 2012 Lumerical Solutions, Inc

Scripting Language

289

8.8.9 shiftselectpartial
Same as selectpartial, but does not unselect other currently selected objects. Syntax shiftselectpartial ("partialname"); Description The same as selectpartial("partialname"), but does not unselect currently selected objects. Can be used to select multiple objects. This function does not return any data. The same as selectpartial("partialgroupname::partialname") , but does not unselect currently selected objects. Can be used to select multiple objects.

shiftselectpartial ("partialgroupname:: partialname");

See Also Manipulating objects 282 , groupscope 284 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.8.10 move
Move selected objects. Syntax move(dx); move(dx,dy); move(dx,dy,dz); Description In 2D or 3D, move by dx In 2D or 3D, move by dx and dy. This function does not return any data. In 3D, move by dx, dy, and dz. In 2D, dz will be ignored.

See Also Manipulating objects 282 , copy 290 , select 287 Available in

2003 - 2012 Lumerical Solutions, Inc

290

Reference Guide FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.8.11 copy
Copy selected objects. Syntax copy; Description Copy the selected objects. The new objects will have have the same name. Their position will be shifted by a default amount. This function does not return any data. Same as copy; but with a specified move of dx. Same as copy; but with a specified move of dx, dy. Same as copy; but with a specified move of dx, dy, dz. In 2D, dz is ignored.

copy(dx); copy(dx,dy); copy(dx,dy,dz);

See Also Manipulating objects 282 , move 289 , select 287 , cp (copy files) 164 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.8.12 addtogroup
Add selected objects to a group. Syntax addtogroup("group name"); Description Adds selected object(s) to a group. If a group with name "group name" already exists, then the objects are added to the existing group. Otherwise, a group named "group

2003 - 2012 Lumerical Solutions, Inc

Scripting Language name" is created. This function does not return any data. See Also Manipulating objects 282 , addgroup 264 , addstructuregroup 265 , addanalysisgroup 265 , adduserprop 291 , runsetup 295 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No Yes

291

8.8.13 adduserprop
Add user properties to a structure group. Syntax adduserprop("property name", type, value); Description Adds a user property to a selected structure group. The name is set to "property name". The type is an integer from 0 to 5. The corresponding variable types are 0 number 1 text 2 length 3 time 4 frequency 5 material The value of the user property is set to value.

See Also Manipulating objects 282 , addstructuregroup 265 , runsetup 295 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No Yes

2003 - 2012 Lumerical Solutions, Inc

292

Reference Guide

8.8.14 set
Set a property of currently selected objects. This command will return an error in analysis mode. Syntax ?set; set("property",value); Description Returns a list of the properties of the selected object(s). This will set the properties of a currently selected object, including pull-downs and check boxes. It cannot be used to set the value of a selected object in a group. Value can be a number or string. This function does not return any data. This form can be used to set the property of the ith selected object when multiple objects are selected. It cannot be used to set the value of a selected object in a group. The objects are ordered by their location in the object tree. The uppermost selected object is given the index 1, and the index numbers increase as you go down the tree.

set("property",value,i);

See Also Manipulating objects 282 , get 294 , setnamed 292 , setmaterial 387 , addmaterial 386 , haveproperty 299 , runsetup 295 , runanalysis 350 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.8.15 setnamed
Like the set command, except that the object name must be specified. This command will return an error in analysis mode. Syntax ?setnamed("name"); setnamed("name", "property", value); Description Returns a list of the properties of the objects called name. The same as set, but acts on objects with a specific name, instead of selected objects.

2003 - 2012 Lumerical Solutions, Inc

Scripting Language setnamed("name", "property", value,i);

293

This form can be used to set the property of the ith named object when multiple objects have the same name. The objects are ordered by their location in the object tree. The uppermost selected object is given the index 1, and the index numbers increase as you go down the tree. The same as set, but acts on objects within the group named "groupname" that are named "name", instead of selected objects. This form can be used to set the property of the ith object with the name "name" in the group "groupname" when multiple objects have the same name. The objects are ordered by their location in the object tree. The uppermost selected object is given the index 1, and the index numbers increase as you go down the tree.

setnamed("groupname:: name", "property", value); setnamed("groupname:: name", "property", value,i);

See Also Manipulating objects 282 , set 292 , get 294 , getnamed 296 , getnamednumber 297 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.8.16 setglobalmonitor
Set global monitor properties. This command will return an error in analysis mode. Syntax ?setglobalmonitor; setglobalmonitor("property", value); Description Returns a list of the global monitor properties Set the global monitor property named "property" to a value. This function does not return any data.

See Also Manipulating objects 282 , set 292 , getglobalmonitor 298 , setglobalsource 294 , getglobalsource
298

Available in

2003 - 2012 Lumerical Solutions, Inc

294

Reference Guide FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No No

8.8.17 setglobalsource
Set global source properties. This command will return an error in analysis mode. Syntax ?setglobalsource; setglobalsource("property", value); Description Returns a list of the global source properties Set the global source property named "property" to a value. This function does not return any data.

See Also Manipulating objects 282 , set 292 , setglobalmonitor 293 , getglobalmonitor 298 , getglobalsource 298 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No No

8.8.18 get
Get a property from selected objects. The property names for the get command are the same as the property names in the Edit dialogue box. For example, if you see a property called "mesh accuracy", then you can use the command get("mesh accuracy"); to get that property. It is possible to get numeric, string, drop down and checkbox properties. Note: Beam profiles In addition to the properties available through the Edit dialogue, it is possible to get the beam profile for gaussian, planewave and mode sources. The property names are "x vector","y vector","z vector","Ex","Ey","Ez","Hx","Hy", and "Hz". In addition, for mode sources, the real part of the effective index for the mode can be obtained. This property is named "neff".

2003 - 2012 Lumerical Solutions, Inc

Scripting Language Syntax ?get; out = get("property"); Description Returns a list of the properties of the selected object(s).

295

Gets the requested property value from the currently selected object. It cannot be used to get the property value of a selected object in a group. If multiple objects are selected get("property") is the same as get("property",i), where i is the number of the first selected objects with the requested property. Out can be a matrix or a string, depending on the property requested. Gets the property of the ith selected object. Use this to act on a series of objects. It cannot be used to get the value of a selected object in a group. The objects are ordered by their location in the object tree. The uppermost selected object is given the index 1, and the index numbers increase as you go down the tree.

get("property",i);

See Also Manipulating objects 282 , getnumber 296 , getnamed 296 , getnamednumber 297 , set 292 , haveproperty 299 , runsetup 295 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.8.19 runsetup
Runsetup forces the setup scripts of structure and analysis groups to run. In most cases, it is not necessary to use this function, as group setup scripts automatically re-run at the end of script, if the object has been modified. It is only necessary to use this function when you need to force the setup script to run before the end of your script file. Syntax Description

2003 - 2012 Lumerical Solutions, Inc

296

Reference Guide runsetup; Forces setup scripts of groups to run.

See Also Manipulating objects 282 , get 294 , set 292 , runanalysis 350 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.8.20 getnumber
Get the number of objects that are selected. Syntax out = getnumber; Description Returns the number of objects that are selected;

See Also Manipulating objects 282 , get 294 , getnamed 296 , getnamednumber 297 , set 292 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.8.21 getnamed
Get a property from objects with a given name. If multiple objects are selected, and the values are different, the smallest value is returned. To be certain of the results, be sure that only one object is selected, or use the form of getnamed that allows a specific object to be selected. Syntax ?getnamed("name"); Description Returns a list of the properties of the objects called name.

2003 - 2012 Lumerical Solutions, Inc

Scripting Language out = getnamed("name", "property"); out=getnamed("name", "property", i); The same as get, but acts on objects with a specific name, instead of selected objects.

297

Gets the property of the ith named object. Use this to act on a series of objects. The objects are ordered by their location in the object tree. The uppermost selected object is given the index 1, and the index numbers increase as you go down the tree. The same as get, but acts on objects named "name" located in the group "groupname", instead of selected objects. Gets the property of the ith object named "name" located in the group "groupname". Use this to act on a series of objects. The objects are ordered by their location in the object tree. The uppermost selected object is given the index 1, and the index numbers increase as you go down the tree.

out = getnamed ("groupname::name", "property"); out = getnamed ("groupname::name", "property");

See Also Manipulating objects 282 , get 294 , getnumber 296 , getnamednumber 297 , set 292 , setnamed
292

Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.8.22 getnamednumber
Get the number of objects with a given name. Syntax out = getnamednumber ( "name"); out = getnamednumber ( "groupname::name"); Description The same as getnumber, but acts on objects with a specific name, instead of selected objects. The same as getnumber, but acts on all objects named "name" in the group "groupname", instead of selected

2003 - 2012 Lumerical Solutions, Inc

298

Reference Guide objects. See Also Manipulating objects 282 , get 294 , getnamed 296 , getnumber 296 , set 292 , setnamed 292 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.8.23 getglobalmonitor
Set global monitor properties. This command will return an error in analysis mode. Syntax ?getglobalmonitor; ?getglobalmonitor ("property"); Description Returns a list of the global monitor properties Returns the value of the requested property.

See Also Manipulating objects 282 , get 294 , setglobalmonitor 293 , setglobalsource 294 , getglobalsource
298

Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No No

8.8.24 getglobalsource
Set global monitor properties. This command will return an error in analysis mode. Syntax Description

2003 - 2012 Lumerical Solutions, Inc

Scripting Language ?getglobalsource; Returns a list of the global source properties

299

?getglobalsource("property"); Returns the value of the requested property. See Also Manipulating objects 282 , get 294 , setglobalmonitor 293 , getglobalmonitor 298 , setglobalsource 294 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No No

8.8.25 getsolver
Returns the solver that is currently active. Syntax ?getsolver; Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE No Yes No No Description Returns the solver that is currently active.

8.8.26 haveproperty
Returns the number of selected objects with a particular property. Syntax out = haveproperty ("property"); Description Returns the number of selected objects with the specified property.

See Also Manipulating objects 282 , get 294 , set 292 Available in

2003 - 2012 Lumerical Solutions, Inc

300

Reference Guide FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No Yes

8.8.27 importsurface
Import surface data. This command only applies to import primitives. The function returns 1 if the data is successfully imported. Example script files showing how to use these functions can be found in the Online Help. See the User Guide, Structures section. Syntax out = importsurface(filename, upper_surface,file_units,x0,y0,z0, invertXY); out = importsurface(filename, upper_surface,file_units,x0,y0, invertXY); Parameter filename Description Import a surface from the file in the string filename in a three dimensional simulation. All arguments after filename are optional. Import a surface from the file in the string filename in a two dimensional simulation. All arguments after filename are optional. Type string Description name of the file with surface data to import. May contain complete path to file, or path relative to current working directory

Default value required

upper_surface

number This optional argument should be 1 to import the upper surface and 0 to import the lower surface. string The optional string argument file_units can be "m", "cm, "mm", "microns" or "nm" to specify the units in the file.

file_units

"m"

x0

number The optional arguments x0, y0 and z0 specify the data origin in the global coordinates of the Graphical Layout Editor. For example, if you are importing a surface defined by an AFM that is on a slab of Si that

2003 - 2012 Lumerical Solutions, Inc

Scripting Language ranges from 0 to 2 microns, you should set z0 to 2 microns. y0 z0 invertXY 0 0 0 number number

301

number The optional argument invertXY can be used to reverse how the x and y axes are read from the file.

See Also Manipulating objects 282 , importsurface2 301 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No No

8.8.28 importsurface2
Import surface data from script variables. This command only applies to import primitives. The function returns 1 if the data is successfully imported. Example script files showing how to use these functions can be found in the Online Help. See the User Guide, Structures section. Syntax out = importsurface2(Z,x,y, upper_surface); out = importsurface2(Y,x, upper_surface); Description Import a surface from the variables Z, x and y in three dimensional simulations. The upper_surface argument is optional. Import a surface from the variables Y and x in two dimensional simulations. The upper_surface argument is optional. Default value required Type matrix Description The two dimensional matrix that defines the surface.

Parameter Z

2003 - 2012 Lumerical Solutions, Inc

302

Reference Guide x required matrix If Z is an NxM matrix, then x should have dimension Nx1. For two dimensional simulation, if Y is an Nx1 matrix then x should have dimension Nx1. If Z is an NxM matrix, then y should have dimension Mx1.

y upper_surface

required 1

matrix

number This optional argument should be 1 to import the upper surface and 0 to import the lower surface. matrix This argument should be an Nx1 matrix that defines the surface for two dimensional simulations.

required

See Also Manipulating objects 282 , importsurface 300 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No No

8.8.29 importnk
Import the refractive index (n and k) over an entire volume or surface from a file. This command only applies to import primitives. The function returns 1 if the data is successfully imported. Example script files showing how to use these functions can be found in the Online Help. See the User Guide, Structures section. Note: Uniform grid The n,k import only works for uniform x,y,z grids. If grid values are non-uniform, interpolated values are incorrect. Syntax out = importnk(filename,file_units, x0,y0,z0,reverse_index_order); Description Import n (and k) data from filename in three dimensional simulations. All arguments after the filename are optional.

2003 - 2012 Lumerical Solutions, Inc

Scripting Language out = importnk(filename,file_units, x0,y0,reverse_index_order);

303

Import n and k data from filename in two dimensional simulations. All arguments after the filename are optional. Type string Description name of the file with n (and k) data to import. May contain complete path to file, or path relative to current working directory The optional string argument file_units can be "m", "cm, "mm", "microns" or "nm" to specify the units in the file.

Parameter filename

Default value required

file_units

"m"

string

x0

number The optional arguments x0, y0 and z0 specify the data origin in the global coordinates of the Graphical Layout Editor. For example, if you defined your volume with respect to a particular point in space, for example (0,0,-5) microns, then you should set z0 to -5 microns. number number number The optional argument reverse_index_order can be set to 1 to reverse how the indices are interpreted in the file. It is best to verify the correct setting with a graphical import before using the script command.

y0 z0 reverse_index_order

0 0 0

See Also Manipulating objects 282 , importnk2 304 Available in

2003 - 2012 Lumerical Solutions, Inc

304

Reference Guide FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No No

8.8.30 importnk2
Import the refractive index (n and k) over an entire volume or surface from script variables. This command only applies to import primitives. The function returns 1 if the data is successfully imported. Example script files showing how to use these functions can be found in the Online Help. See the User Guide, Structures section. Note: Uniform grid The n,k import only works for uniform x,y,z grids. If grid values are non-uniform, interpolated values are incorrect. Syntax out = importnk2(n,x,y,z); out = importnk2(n,x,y); Description Import n (and k) data from script variables in three dimensional simulations. All arguments are required. Import n (and k) data from script variables in two dimensional simulations. All arguments are required. Default value required Type matrix Description The refractive index. This should be an NxMxP matrix in three dimensions and an NxM matrix in two dimensions. If it is complexvalued, then the imaginary part is interpreted as k. If n is an NxMxP matrix, then x should have dimension Nx1. For two dimensional simulation, if n is an NxM matrix then x should have dimension Nx1. Values of x must be uniformly spaced. If n is an NxMxP matrix, then y should have dimension Mx1. For

Parameter n

required

matrix

required

matrix

2003 - 2012 Lumerical Solutions, Inc

Scripting Language

305

two dimensional simulation, if n is an NxM matrix then y should have dimension Mx1. Values of y must be uniformly spaced. z 1 number If n is an NxMxP matrix, then z should have dimension Px1. Values of z must be uniformly spaced.

See Also Manipulating objects 282 , importnk 302 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No No

8.8.31 setsourcesignal
Sets a custom source time signal. This is an advanced source setting for users wanting a custom source time signal. For the vast majority of simulations, a custom time signal is not required. If this function is not used, the time signal will be automatically generated. For an example script file which uses this script command, see Online User Guide>Sources->Custom time signal. Syntax setsourcesignal("name", t, amplitude, phase); setsourcesignal("name", t, amplitude, phase, fcentre, bandwidth); Description Sets the time domain signal of source named "name". t, amplitude, and phase are 1D vectors with the same length. Allows you to specify the precise center frequency and bandwidth that will be used for all simulations. These values are used for materials fits, calculating the mesh, and source limits. If fcentre and bandwidth are not specified, they will be automatically estimated from the time signal.

2003 - 2012 Lumerical Solutions, Inc

306

Reference Guide See Also sourcepower 329 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No No

8.8.32 updatesourcemode
Updates the mode profile of selected mode source. If there is no mode profile stored in the source, then the mode with the highest effective index will be selected. If a mode is already stored in the source, then the mode with the best overlap with the old mode will be selected. Note that the mode source must be selected before running this command. Syntax ?updatesourcemode; Description Updates mode profile of the selected MODE source. Returns the fraction of electromagnetic fields that overlap between the old and the new mode

NOTE: Saving simulation files before using updatesourcemode If you have a script file which updates the simulation mesh, then you should use the save script command 161 before updating the source mode. This will ensure that the mesh has been updated before the new mode is calculated. NOTE: overlap The fraction of electromagnetic fields that overlap between the two modes is given by the expression below. It is also the fraction of power from mode2 that can propagate in mode1.

overlap

Re

* E1 H 2 dS

E2
* 1

H 1* dS Re E 2

1
* H2 dS

E1 H
See Also addmode 272 , clearsourcedata 307

dS

2003 - 2012 Lumerical Solutions, Inc

Scripting Language Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No No

307

8.8.33 clearsourcedata
Clears source data for an imported source, or the selected mode for a mode source. Syntax clearsourcedata; Description Clears source data for the selected source.

Example Clear source data from an imported source. This will make the file much smaller, which can be convenient when emailing simulation files. select("source3"); clearsourcedata; See Also updatesourcemode 306 , asapimport 177 , asapload 176 , asapexport 176 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No No

8.8.34 redraw
Force the graphical viewports of the CAD to update. The viewports update automatically by default, so this command is only required after using the redrawoff command. Syntax redraw; Description Redraws graphics. This function does not return any data.

2003 - 2012 Lumerical Solutions, Inc

308

Reference Guide

See Also Manipulating objects 282 , redrawon 308 , redrawoff 308 , redrawmode 309 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No Yes

8.8.35 redrawoff
Disable automatic updating of the graphical viewports in the CAD. This can greatly increase the speed of scripts that add large numbers of objects. Syntax redrawoff; Description Prevents redrawing of graphics. This function does not return any data.

See Also Manipulating objects 282 , redrawon 308 , redraw 307 , redrawmode 309 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No Yes

8.8.36 redrawon
Enable automatic updating of the graphical viewports in the CAD. Automatic updating is the default behavior, so this command is only required after using the redrawoff command. Syntax redrawon; Description Turns redrawing back on. This function does not return any data.

2003 - 2012 Lumerical Solutions, Inc

Scripting Language See Also Manipulating objects 282 , redraw 307 , redrawoff 308 , redrawmode 309 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No Yes

309

8.8.37 redrawmode
This command can be used to determine the current status of automatic redrawing. It can also be used to set the current status of automatic redrawing. The graphics will be redrawn after any script command that may change the properties of a graphical object. Syntax out = redrawmode; Description The value of out indicates if automatic redrawing is off or on out=1: automatic redrawing is on out=0: automatic redrawing is off Set the automatic redrawing off or on. To turn it on, use in=1. To turn it off, use in=0. The value of out is set after executing the command so that out=in once this command has been executed.

out = redrawmode(in);

See Also Manipulating objects 282 , redraw 307 , redrawoff 308 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No Yes

2003 - 2012 Lumerical Solutions, Inc

310

Reference Guide

8.8.38 setview
This command allows the viewing properties of the Layout Editor to be modified. Syntax outstring = setview; Description Returns a list of the view properties that can be set. The command ?setview; will return extent, zoom, theta, phi Sets the default value for any of the view properties. For example, setview("extent"); is the same as pressing the graphical extent button. Sets the values to of any property for viewing.

setview("property");

setview("property",value);

The following table describes the properties that can be set Property extent Description Control the view extent. In this case, value should be a 2x1, 4x1 or 6x1 matrix representing the view range min x, max x, min y, max y, min z and max z respectively. Controls the relative zoom of the perspective view compared to the default level. To zoom in by a factor of 2 in the perspective view, use setview("zoom",2); Controls the polar angle of the perspective view, in degrees. Controls the azimuthal angle of the perspective view, in degrees.

zoom

theta phi

See Also Manipulating objects 282 , getview 311 , orbit 311 , redraw 307 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No Yes

2003 - 2012 Lumerical Solutions, Inc

Scripting Language

311

8.8.39 getview
This command allows the viewing properties of the Layout Editor to be retrieved. Syntax outstring = getview; Description Returns a list of the view properties that can be set. The command ?getview; will return extent, zoom, theta, phi Returns the current value of any of the view properties. For example, zoom_level = getview("zoom"); will return the current zoom setting of the perspective view relative to the default level.

out = getview("property");

The properties that can be obtained with getview are described in setview 310 . See Also Manipulating objects 282 , setview 310 , orbit 311 , redraw 307 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No Yes

8.8.40 orbit
This command performs an elliptical viewing orbit of the structure in the perspective view. Note that the commands setview 310 , getview 311 and redraw 307 make it possible to create any type of orbit you would like in your own script file. Syntax orbit; orbit(zoom_factor); Description Performs an orbit of the current perspective view. Performs an orbit with the specified minimum zoom

2003 - 2012 Lumerical Solutions, Inc

312

Reference Guide factor. By default the zoom factor is 1.5. orbit(zoom_factor, frame_rate); Performs an orbit with the specified frame rate specified in frames per second. The default frame rate is 15. The orbit will be streamed to the mpeg file filename for later viewing.

orbit(zoom_factor, frame_rate, "filename");

See Also Manipulating objects 282 , setview 310 , getview 311 , framerate 312 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No Yes

8.8.41 framerate
Orbits the perspective view and returns the framerate. This can be useful for estimating your graphics performance. If comparing the performance of two computers, be sure to use exactly the same simulation file. Syntax fr = framerate(num_frames, zoom); Description num_frames - Number of frames to draw zoom - Zoom factor used in perspective view fr - number of frames / wall time required to complete orbit.

See Also Manipulating objects 282 , setview 310 , getview 311 , orbit 311 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes No No No

2003 - 2012 Lumerical Solutions, Inc

Scripting Language

313

8.8.42 undo
Undo the last command that modified any objects, you can undo the last 5 commands. Syntax undo; Description Undo last modify object command. This function does not return any data.

See Also Manipulating objects 282 , redo 313 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.8.43 redo
Redo a command after a previous undo. Syntax redo; Description Redo command after previous undo. This function does not return any data.

See Also Manipulating objects 282 , undo 313 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

2003 - 2012 Lumerical Solutions, Inc

314

Reference Guide

8.8.44 addport
Add a port to a compound/script element. (Note that this command does not apply for primitive elements.) Syntax addport("element", "port", "type", "data"); Description Adds a new port to the element with the specified properties. Returns the name of the port that is created. Default value required required Type string string Description Name of the element to add a port to. Name of the port to add. The named will be modified if there is already a port of the same name. The type of port to add. The options are: Bidirectional, Input, Output, Analyzer Input The type of data for the port. The options are: Variant, Optical Signal, Electrical Signal, Digital Signal

Property element port

type

required

string

data

required

string

Manipulating objects 282 , removeport 315 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE No No Yes No

2003 - 2012 Lumerical Solutions, Inc

Scripting Language

315

8.8.45 removeport
Remove a port from a compound/script element. (Note that this command does not apply for primitive elements.) Syntax removeport("element", "port"); Description Removes "port" from "element". Returns 1 if the port is successfully removed, 0 otherwise.

Manipulating objects 282 , addport 314 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE No No Yes No

8.8.46 connect
Connects one element to another via the specified ports. Syntax Description

connect("element1", "port1", Connects "port1" of "element1" to "element2" or "port2". "element2", "port2"); Manipulating objects 282 , disconnect 316 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE No No Yes No

2003 - 2012 Lumerical Solutions, Inc

316

Reference Guide

8.8.47 disconnect
Disconnect one element to another via the specified ports. Syntax Description

connect("element1", "port1", Deletes the connection between "port1" of "element1" and "element2", "port2"); "port2" of "element2". Manipulating objects 282 , connect 315 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE No No Yes No

8.9

Running simulations
Moving between tabs Command switchtolayout 264 layoutmode 264 Description Closes the analysis window and allows you to manipulate simulation objects for a new simulation. Used to determine if the simulation file is open in layout or in analysis mode.

Running Simulations Command run 317 runparallel 317 addjob 318 runjobs 318 clearjobs 319 runsweep 319 Description Launch the simulation. (Options available) Launch the simulation in parallel mode. Add a simulation to the job queue. Run all simulations in the job queue. Remove all simulations from the job queue. Runs a parameter sweep or optimization task

2003 - 2012 Lumerical Solutions, Inc

Scripting Language

317

8.9.1 run
Run the current simulation. When the simulation finishes, all simulation data will be saved to the current file, then the file is re-loaded. Syntax run; run(option1); Description Launch the simulation in parallel mode as defined in the resource manager. This function does not return any data. Option1 (default: 3) can be: 1: run FDTD in single processor mode avoiding any use of MPI. 2: run FDTD in single processor mode (legacy issues). Pop-up dialogs no longer take focus. 3: run FDTD in parallel mode as defined in the resource manager.

See Also runparallel 317 , runanalysis 350 , addjob 318 , runjobs 318 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes No

8.9.2 runparallel
Launch the simulation in parallel mode. Equivalent to run and run(3). When the simulation finishes, all simulation data will be saved to the current file. Syntax runparallel; Description Launch the simulation in parallel mode as defined in the resource manager. This function does not return any data.

See Also run 317 , runanalysis 350 Available in

2003 - 2012 Lumerical Solutions, Inc

318

Reference Guide FDTD Solutions MODE Solutions INTERCONNECT DEVICE Deprecated in Version 7. Use run. No No No

8.9.3 addjob
Adds the specified simulation file to the job manager queue. Syntax addjob(filename); Description Add the simulation file "filename" to the job manager queue.

See Also run 317 , runsweep 319 , runjobs 318 , clearjobs 319 , currentfilename 167 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No Yes

8.9.4 runjobs
Runs all jobs in the job manager queue. The script execution will be paused while the jobs run, then resume when all jobs complete successfully. If Job errors occur, the script will not proceed. Syntax runjobs; runjobs(option); Description Run all jobs in the Job queue. option=0: run jobs in single processor mode using only the local resource. option=1: run jobs in parallel mode using all available resources (default).

See Also run 317 , runsweep 319 , addjob 318 , clearjobs 319 , save 161 , load 161 Available in

2003 - 2012 Lumerical Solutions, Inc

Scripting Language FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No Yes

319

8.9.5 clearjobs
Remove all jobs from the job manager queue. Syntax clearjobs; See Also run 317 , addjob 318 , runjobs 318 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No Yes Description Remove all jobs from the Job queue.

8.9.6 runsweep
Runs a parameter sweep or optimization task. Syntax runsweep; runsweep("taskname"); Description Runs all sweeps and optimization tasks. Runs only the sweep or optimization named taskname.

See Also run 317 , getsweepdata 348 , addjob 318 , runjobs 318 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

2003 - 2012 Lumerical Solutions, Inc

320

Reference Guide

8.10 FDTD Measurements and Normalization


These commands are used to get measurement data from sources and monitors Command transmission 321 transmission_avg 322 Description Returns the power transmission through a monitor. Returns the total spectral average power through a monitor surface, normalized to the total spectral average of the source. Returns the partial spectral average power through a monitor surface, normalized to the partial spectral average of the source. Get source angle.

transmission_pavg 323

getsourceangle 323

These commands are used for normalization of FDTD data Command nonorm 324 cwnorm 325 sourcenorm 325 sourcenorm2_avg 326 Description Use no normalization. Use CW normalization. Returns the normalization used in the cwnorm state. Returns the source normalization spectrum used to normalize data in the cwnorm state for the total spectral averaged quantities Returns the source normalization spectrum used to normalize data in the cwnorm state for the partial spectral averaged quantities Returns the power injected into the simulation by a dipole source. Returns the source power. Returns the total spectral average power injected into the simulation by the source. Returns the partial spectral average power injected into the simulation by the source. Returns the source intensity. Returns the total spectral average intensity injected into the simulation by the source.

sourcenorm2_pavg 327

dipolepower 328 sourcepower 329 sourcepower_avg 330 sourcepower_pavg 331 sourceintensity 333 sourceintensity_avg 333

2003 - 2012 Lumerical Solutions, Inc

Scripting Language sourceintensity_pavg 334

321

Returns the partial spectral average intensity injected into the simulation by the source.

8.10.1 transmission
The transmission function returns the amount of power transmitted through power monitors and profile monitors, normalized to the source power. A value of 0.5 means that half of the optical power injected by the source passed through the monitor. Negative values mean the power is flowing in the negative direction. The transmission is calculated with the following formula.

T( f )
where

1 real P( f ) Monitor dS 2 sourcepower


T(f) is the normalized transmission as a function of frequency P(f) is the Poynting vector dS is the surface normal

The normalization state (cwnorm or nonorm) does not affect the result because of the source power normalization. Syntax out = transmission ( "mname"); out = transmission ( "mname", option); Description Transmission through monitor mname. It must be obvious from the shape of the monitor which axis is normal to the monitor surface. The additional argument, option, can have a value of 1 or 2. If it is 2, the data is unfolded where possible according to the symmetry or anti-symmetric boundaries if it comes from a monitor that intersect such a boundary at x min, y min or z min. The default value of option is 2.

See Also sourcepower 329 , dipolepower 328 , transmission_avg 322 , transmission_pavg 323 Available in

2003 - 2012 Lumerical Solutions, Inc

322

Reference Guide FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No No

8.10.2 transmission_avg
Returns the total spectral average power through a monitor surface, normalized to the total spectral average of the source. See the Units and normalization - Spectral averaging section for more information.

Tavg
where

1 real P Monitor dS total 2 sourcepower _ avg


Tav g is the normalized total spectral average transmission <P> is the total spectral average Poynting vector dS is the surface normal

The normalization state (cwnorm or nonorm) does not affect the result because of the source power normalization. Syntax out = transmission_avg ( "monitorname"); out = transmission_avg ( "monitorname", option); Description Returns the total spectral average transmission through monitorname. It must be obvious from the shape of the monitor which axis is normal to the monitor surface. The additional argument, option, can have a value of 1 or 2. If it is 2, the data is unfolded where possible according to the symmetry or anti-symmetric boundaries if it comes from a monitor that intersect such a boundary at x min, y min or z min. The default value of option is 2.

See Also sourcepower_avg 330 , transmission 321 , transmission_pavg 323 , Units and Normalization, Spectral averaging Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No No

2003 - 2012 Lumerical Solutions, Inc

Scripting Language

323

8.10.3 transmission_pavg
Returns the partial spectral average power through a monitor surface, normalized to the partial spectral average of the source. See the Units and normalization - Spectral averaging section for more information.

T pavg ( f )
where

1 real P( f ) Monitor dS partial 2 sourcepower _ pavg( f )

Tpav g is the normalized partial spectral average transmission <P> is the partial spectral average Poynting vector dS is the surface normal

The normalization state (cwnorm or nonorm) does not affect the result because of the source power normalization. Syntax out = transmission_pavg ( "monitorname" ); out = transmission_pavg ( "monitorname", option ); Description Returns the partial spectral average transmission through monitorname. It must be obvious from the shape of the monitor which axis is normal to the monitor surface. The additional argument, option, can have a value of 1 or 2. If it is 2, the data is unfolded where possible according to the symmetry or anti-symmetric boundaries if it comes from a monitor that intersect such a boundary at x min, y min or z min. The default value of option is 2.

See Also sourcepower_pavg 331 , transmission 321 , transmission_avg 322 , Units and Normalization, Spectral averaging Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No No

8.10.4 getsourceangle
Broadband sources inject fields that have a constant in-plane wavevector at all frequencies. This implies injection angle must change as a function of frequency. The in-plane wavevector is chosen such that the incidence angle at the center frequency of the simulation (fSIM) will match the source angle theta (thetaSIM) specified in the source
2003 - 2012 Lumerical Solutions, Inc

324

Reference Guide properties. Higher frequencies will be injected at smaller angles, while lower frequencies will be injected at larger angles. This 'theta vs wavelength' plot in the beam source edit window shows the same function.

(f)

a sin

sin( SIM ) f SIM f

Syntax theta = getsourceangle ( "sourcename", f);

Description Returns the source angle theta (degrees) as a function of frequency. f is a vector of frequencies (Hz).

See Also sourcepower 329 , Online Help-User Guide-Sources-Broadband injection angles Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No No

8.10.5 nonorm
Do not normalized the data to the source power. The actual field intensities will be used in all calculations. This function controls the checkbox located in Settings - Normalization state. Syntax nonorm; Description Use no normalization. This function does not return any data.

See Also cwnorm 325 , Units and Normalization Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No No

2003 - 2012 Lumerical Solutions, Inc

Scripting Language

325

8.10.6 cwnorm
Use CW normalization. All simulation data will be normalized to the injected source power. Most users prefer to do their analysis in the CW normalization state, since it removes any effect caused by the finite pulse length of the source. It also converts the units of all electromagnetic fields to be the same as in the time domain. This function controls the checkbox located in Settings - Normalization state. Syntax cwnorm; Description Use CW normalization. This function does not return any data.

See Also nonorm 324 , Units and Normalization Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No No

8.10.7 sourcenorm
Returns the source normalization spectrum used to normalize data in the cwnorm state for standard fourier transform quantities. See the Units and normalization chapter for more information. If the source time signal of the jth source in the simulation is s j(t), and N is the number of active sources then

s( )

sourcenorm ( )

1 N

exp i t s j (t )d
sources

Syntax out = sourcenorm(f);

Description Returns the source normalization used to normalize data in the cwnorm state at the vector of frequency points f. (f is the frequency in Hz) This function makes it possible to perform the normalization using the spectrum of one source, rather than the sum of all the sources.

out = sourcenorm(f, name);

2003 - 2012 Lumerical Solutions, Inc

326

Reference Guide

See Also sourcenorm2_avg 326 , sourcenorm2_pavg 327 , sourcepower 329 , cwnorm 325 , nonorm 324 , Units and Normalization Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No No

8.10.8 sourcenorm2_avg
Returns the source normalization spectrum used to normalize data in the cwnorm state for the total spectral averaged quantities. See the Units and normalization - Spectral averaging section for more information. The script function sourcenorm is defined as

s( )

sourcenorm ( )

1 exp i t s j (t )d N sources

If sourcenorm2_avg is called without any arguments, it returns

sourcenorm 2 _ avg

s( ' ) d '

Syntax out = sourcenorm2_avg; out = sourcenorm2_avg ( "sourcename");

Description This function returns the source normalization for total spectral averaged quantities. This function makes it possible to perform the normalization using the spectrum of one source, rather than the sum of all the sources.

See Also sourcenorm 325 , sourcenorm2_pavg 327 , sourcepower_avg 330 , cwnorm 325 , nonorm 324 , Units and Normalization, Spectral averaging Available in

2003 - 2012 Lumerical Solutions, Inc

Scripting Language FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No No

327

8.10.9 sourcenorm2_pavg
Returns the source normalization spectrum used to normalize data in the cwnorm state for the partial spectral averaged quantities. See the Units and normalization - Spectral averaging section for more information. If the source time signal of the jth source in the simulation is s j(t), and N is the number of active sources then

s( )

sourcenorm ( )

1 exp i t s j (t )d N sources

Partial spectral averaging uses a Lorentzian weighting of the following form. Delta is the FWHM of |h|2.

hi ( , ' )
2

1 2 ( ')
2

( / 2) 2

h( , ' ) d ' 1
If this function is called without any arguments, it returns

sourcenorm 2 _ pavg

h( , ' ) s ( ' ) d '

Syntax out = sourcenorm2_pavg( f, delta); out = sourcenorm2_pavg( f, delta, "sourcename");

Description This function returns the source normalization for partial spectral averaged quantities. This function makes it possible to perform the normalization using the spectrum of one source, rather than the sum of all the sources.

See Also sourcenorm 325 , sourcenorm2_avg 326 , sourcepower_pavg 331 , cwnorm 325 , nonorm 324 ,

2003 - 2012 Lumerical Solutions, Inc

328

Reference Guide Units and Normalization, Spectral averaging Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No No

8.10.10 dipolepower
Returns the power injected into the simulation region by a dipole source. In 3D simulations, the units will be in Watts if cw norm is used, and Watts/Hertz 2 if no norm is used. The dipolepower script command returns the power that was injected into the simulation region, and is equivalent to measuring the power transmitted out of a small box surrounding the dipole. In contrast, sourcepower 329 will return the power that an ideal dipole would radiate in a homogeneous material. dipolepower and sourcepower are equivalent for dipoles in a homogeneous medium. Advanced notes: There can be some numerical errors in this calculation that become significant when small mesh sizes are used. If the mesh step is the order of, or smaller than, /500, it may be necessary to measure this quantity using a small box of power monitors surrounding the dipole. If the dipole is injected into a dispersive medium with a non-zero imaginary part of the refractive index, then the results of this function are not reliable. Please contact support@lumerical.com for more assistance if you are using a dipole in dispersive medium, or in a fine mesh region, and would like to calculate the total power emitted by the dipole. Syntax out = dipolepower(f); out = dipolepower(f, name); Description Returns the amount of power radiated by the dipole source, at frequency points f. (f in Hz) This option allows you to obtain the power radiated by a single dipole, rather than the sum of all dipoles. This option is only needed for simulations with multiple dipoles.

See Also sourcenorm 325 , sourcepower 329 , sourcepower_avg 330 , sourcepower_pavg 331 , transmission 321 , cwnorm 325 , nonorm 324 , Units and Normalization Available in

2003 - 2012 Lumerical Solutions, Inc

Scripting Language FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No No

329

8.10.11 sourcepower
Returns the power that an ideal source would inject into homogeneous material. In 3D simulations, the units will be in Watts if CW norm is used, and Watts/Hertz 2 if no norm is used. For beam sources (Gaussian, plane wave) and mode sources, the sourcepower is P ( f ) Source determined from the equation below. Note that is the Poynting vector determined by the fields that an ideal source would have in a homogeneous material, and the integral is computed over the injection region of the source.

sourcepowernonorm ( f )

1 real P ( f ) Source dS 2

sourcepowercwnorm ( f )

1 real P ( f ) Source dS 2 2 sourcenorm

For simulations using beam sources, sourcepower gives the amount of power injected into the simulation. The only exception is if the simulation is setup such that there is radiation which travels through the injection plane of the source in the source injection direction (pink arrow). In such cases, the actual amount of power injected by the source will not be given by sourcepower. In almost all cases, this means your simulation is not setup properly. For point sources (dipole), the sourcepower script function returns the power an ideal dipole source will radiate in a homogeneous medium. This quantity can be calculated analytically (see Dipoles - Radiated Power page in the User Guide). The actual radiated power is NOT given by the sourcepower function. The actual radiated power is highly dependant on the surrounding materials, since the reflections from the structures will interfere with the fields from the dipole, changing the actual radiated power. To get the actual radiated power, see the dipolepower 328 script function. For additional information, see the Dipoles - Radiated Power page in the User Guide. Syntax out = sourcepower(f); Description Returns the source power used to normalize transmission

2003 - 2012 Lumerical Solutions, Inc

330

Reference Guide calculations at the vector of frequency points f. (f is the frequency in Hz) out = sourcepower(f, option); The additional argument, option, can have a value of 1 or 2. If it is 2, the data is unfolded where possible according to the symmetry or anti-symmetric boundaries if it comes from a monitor that intersect such a boundary at x min, y min or z min. The default value of option is 2. This option allows you to obtain the spectrum of one source, rather than the sum of all sources. This option is only needed for simulations with multiple sources.

out = sourcepower(f, option, name);

See Also sourcenorm 325 , sourcepower_avg 330 , sourcepower_pavg 331 , dipolepower 328 , transmission 321 , sourceintensity 333 , cwnorm 325 , nonorm 324 , Units and Normalization Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No No

8.10.12 sourcepower_avg
Returns the total spectral average power injected into the simulation by the source. See the Units and normalization - Spectral averaging section for more information. This script function calculates the following quantities, depending on whether the normalization state is cwnorm or nonorm:

sourcepower _ avgnonorm
0

sourcepowernonorm( )d
s ( ) sourcepowercwnorm ( )d
2

sourcepower _ avgcwnorm ( f )

s( ) d
0

where sourcepower is the quantity returned by the sourcepower script function, s(w) is returned by sourcenorm, and =2 f. Typically, this function should be used in the cwnorm state. Also see the sourcenorm2_pavg script function.

2003 - 2012 Lumerical Solutions, Inc

Scripting Language Syntax out = sourcepower_avg; out = sourcepower_avg (option); Description

331

Returns the spectrally averaged source power as defined above. The additional argument, option, can have a value of 1 or 2. If it is 2, the data is unfolded where possible according to the symmetry or anti-symmetric boundaries if it comes from a monitor that intersect such a boundary at x min, y min or z min. The default value of option is 2. This option allows you to obtain the spectrum of one source, rather than the sum of all sources. This option is only needed for simulations with multiple sources.

out = sourcepower_avg (option, "sourcename");

See Also sourcenorm2_avg 326 , sourcepower 329 , sourcepower_pavg 331 , transmission_avg 322 , sourceintensity_avg 333 , cwnorm 325 , nonorm 324 , Units and Normalization, Spectral averaging Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No No

8.10.13 sourcepower_pavg
Returns the partial spectral average power injected into the simulation by the source. See the Units and normalization - Spectral averaging section for more information. Partial spectral averaging uses a Lorentzian weighting of the form

hi ( , ' )
2

1 2 ( ')
2

( / 2) 2

h( , ' ) d ' 1
This script function calculates the following quantities, depending on whether the normalization state is cwnorm or nonorm:

sourcepower _ pavgnonorm ( f )

h( , ' ) sourcepowernonorm ( )d

2003 - 2012 Lumerical Solutions, Inc

332

Reference Guide

h( , ' ) s ( ) sourcepowercwnorm ( ' )d ' sourcepower _ pavgcwnorm ( f )


0

h( , ' ) s ( ' ) d '


0
where sourcepower is the quantity returned by the sourcepower script function, s(w) is returned by sourcenorm, and =2 f. Typically, this function should be used in the cwnorm state. Also see the sourcenorm2_pavg script function. Syntax out = sourcepower_pavg(f, df); Description Returns the spectrally averaged source power as defined above. The quantity f is the frequency and the quantity df is the frequency range around which the averaging is performed, both in Hz. The additional argument, option, can have a value of 1 or 2. If it is 2, the data is unfolded where possible according to the symmetry or anti-symmetric boundaries if it comes from a monitor that intersect such a boundary at x min, y min or z min. The default value of option is 2.

out = sourcepower_pavg(f, df,option);

out = sourcepower_pavg(f,df, This option allows you to obtain the spectrum of one option, "sourcename"); source, rather than the sum of all sources. This option is only needed for simulations with multiple sources. See Also sourcenorm2_pavg 327 , sourcepower 329 , sourcepower_avg 330 , transmission_pavg 323 , sourceintensity_pavg 334 , cwnorm 325 , nonorm 324 , Units and Normalization, Spectral averaging Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No No

2003 - 2012 Lumerical Solutions, Inc

Scripting Language

333

8.10.14 sourceintensity
Sourceintensity returns the source power divided by the area of the source. In 3D simulations, the units will be in Watts/m2 if CW norm is used, and Watts/m2/Hertz 2 if No norm is used. This function is often used when normalizing power measurements from simulations with a TFSF source. Syntax out = sourceintensity(f); out = sourceintensity(f, option); Description Returns the source intensity at the vector of frequency points f (f is the frequency in Hz). The additional argument, option, can have a value of 1 or 2. If it is 2, the data is unfolded where possible according to the symmetry or anti-symmetric boundaries if it comes from a monitor that intersect such a boundary at x min, y min or z min. The default value of option is 2. This function makes it possible to perform the normalization using the spectrum of one source, rather than the sum of all the sources.

out = sourceintensity(f, option, name);

See Also sourcenorm 325 , sourcepower 329 , sourceintensity_avg 333 , sourceintensity_pavg 334 , dipolepower 328 , transmission 321 , cwnorm 325 , nonorm 324 , Units and Normalization 37 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No No

8.10.15 sourceintensity_avg
Returns the total spectral average intensity injected into the simulation by the source. The average intensity is equal to the average power divided by the source area. See the sourcepower_pavg 331 command and the Units and normalization - Spectral averaging section for more information. Syntax out = sourceintensity_avg; out = sourceintensity_avg Description Returns the spectrally averaged source intensity as defined above. The additional argument, option, can have a value of 1 or 2.

2003 - 2012 Lumerical Solutions, Inc

334

Reference Guide (option); If it is 2, the data is unfolded where possible according to the symmetry or anti-symmetric boundaries if it comes from a monitor that intersect such a boundary at x min, y min or z min. The default value of option is 2. This function makes it possible to perform the normalization using the spectrum of one source, rather than the sum of all the sources.

out = sourceintensity_avg (option, "sourcename");

See Also sourcenorm2_avg 326 , sourceintensity 333 , sourcepower 329 , transmission_avg 322 , cwnorm 325 , nonorm 324 , Units and Normalization 37 , Spectral averaging Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No No

8.10.16 sourceintensity_pavg
Returns the partial spectral average intensity injected into the simulation by the source. The partial average intensity is equal to the partial average power divided by the source area. See the sourcepower_pavg 331 command and the Units and normalization - Spectral averaging section for more information. Syntax out = sourceintensity_pavg (f,df); Description Returns the spectrally averaged source power as defined above. The quantity f is the frequency and the quantity df is the frequency range around which the averaging is performed, both in Hz.

out = sourceintensity_pavg(f, The additional argument, option, can have a value of 1 or 2. df, option); If it is 2, the data is unfolded where possible according to the symmetry or anti-symmetric boundaries if it comes from a monitor that intersect such a boundary at x min, y min or z min. The default value of option is 2. out = sourceintensity_pavg(f, This function makes it possible to perform the df, option, "sourcename"); normalization using the spectrum of one source, rather than the sum of all the sources. See Also

2003 - 2012 Lumerical Solutions, Inc

Scripting Language sourcenorm2_pavg 327 , sourcepower 329 , sourcepower_avg 330 , transmission_pavg 323 , cwnorm 325 , nonorm 324 , Units and Normalization, Spectral averaging Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No No

335

8.11 Eigenmode Solver Measurements


This section is only relevant for MODE Solutions, please see the MODE Solutions Knowledge Base for more information.

8.11.1 setanalysis
Set calculation parameters in MODE Solutions analysis window.

Syntax ?setanalysis; setanalysis("property", value);

Description Lists all the parameters in the analysis window. Sets"property" to value.

See Also Measurements 347 , mesh 336 , findmodes 337 , frequencysweep 338 , analysis 336 , getanalysis
335

Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE No Yes No Yes

8.11.2 getanalysis
Set calculation parameters in MODE Solutions analysis window.

Syntax

Description

2003 - 2012 Lumerical Solutions, Inc

336

Reference Guide ?getanalysis; getanalysis("property"); Lists all the parameters in the analysis window. Returns the current value for the particular property on the analysis window

See Also Measurements 347 , mesh 336 , findmodes 337 , frequencysweep 338 , analysis 336 , setanalysis
335

Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE No Yes No Yes

8.11.3 analysis
Opens the MODE Solutions analysis window corresponding to the active solver. Syntax analysis; Description opens the analysis window corresponding to the active solver.

See Also Measurements 347 , setanalysis 335 , runanalysis 350 , getanalysis Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE No Yes No No

335

8.11.4 mesh
Produces a mesh of the current structure that is required to perform a subsequent calculation (either to calculate the modes, or to perform a frequency sweep). Produces a dcard called "material" which contains the material properties of the meshed object. Syntax mesh; Description Mesh the current simulation.

2003 - 2012 Lumerical Solutions, Inc

Scripting Language

337

See Also setanalysis 335 , mesh 336 , findmodes 337 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE No Yes No No

8.11.5 findmodes
Calculates the modes supported by the structure using the current calculation settings. This function is the script equivalent to the calculate modes button. Each mode will be saved as a D-CARD named "modeX", where X is the xth mode found. The D-CARD saves data such as effective index and mode profile.

Syntax n=findmodes;

Description n will be equal to the number of modes found.

See Also setanalysis 335 , mesh 336 , selectmode 337 , frequencysweep 338 , coupling 338 , overlap 339 , bestoverlap 340 , propagate 341 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE No Yes No No

8.11.6 selectmode
All modes found in a simulation are numbered based on their effective index. They are displayed in the mode table of the Analysis tab. The selectmode command will select the Nth mode in the mode table.

Syntax selectmode(N); selectmode(name);

Description where N is the number of the desired mode. where name is a string containing the name of a mode.

2003 - 2012 Lumerical Solutions, Inc

338

Reference Guide Modes are named mode1, mode2, ..modeN. This form of the command is compatible with the bestoverlap 340 function See Also setanalysis 335 , mesh 336 , findmodes 337 , frequencysweep 338 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE No Yes No No

8.11.7 frequencysweep
Performs a frequency sweep using the current settings within the frequency analysis tab. Produces a D-CARD called "frequencysweep" that contains dispersion, effective index, and other data for as a function of frequency.

Syntax frequencysweep;

Description Perform a frequency sweep with the current settings. This function does not return any data.

See Also setanalysis 335 , mesh 336 , findmodes 337 , selectmode 337 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE No Yes No No

8.11.8 coupling
The coupling function calculates the complex coupling coefficient between two modes. The power coupling can be calculated with the overlap function, or by the following formula.

PowerCoupling

Here 'a' is the ratio of the basis state coefficients. The full formula for a can be found in the following reference:
2003 - 2012 Lumerical Solutions, Inc

Scripting Language

339

Allan W. Snyder and John D. Love, Optical Waveguide Theory. Chapman & Hall, London, England, 1983. See the overlap function for more details about overlap and coupling calculations. Only available in MODE Solutions. Syntax out = coupling(mode2, mode1); out = coupling(mode2, mode1, x, y); Description mode2, mode1: the mode names out: the coupling coefficient Mode alignment can be adjusted before coupling is calculated. x offset y offset

See Also copydcard 351 , findmodes 337 , coupling 338 , overlap 339 , bestoverlap 340 , propagate 341 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE No Yes No No

8.11.9 overlap
Calculates the overlap and power coupling between two modes. Overlap: Measures the fraction of electromagnetic fields that overlap between the two modes. This is also the fraction of power from mode2 that can propagate in mode1.

overlap

Re

* E1 H 2 dS

E2
* 1

H 1* dS Re E 2

1
* H2 dS

E1 H

dS

Power Coupling: Measures the amount of power that can couple from mode2 into a forward propagating wave with the mode profile of mode1. The remaining power that can propagate in this mode will couple into the backwards propagating mode. Therefore, the power coupling is always less than or equal to the overlap. If the two modes have the same effective index, then the power coupling will be equal to the overlap. A dielectric interface is a simple example. The modes on each side of the interface will

2003 - 2012 Lumerical Solutions, Inc

340

Reference Guide have an overlap of 1, but the power coupling will be less than one. This is due to reflections caused by the index change at the interface. These calculations are based on the methods described in Snyder and Love "Optical Waveguide Theory", Chapman & Hall, London, England, 1983.

Syntax out = overlap(mode2, mode1); out = overlap(mode2, mode1, x, y,z);

Description mode2, mode1: the mode names out(1): the mode overlap out(2): the mode power coupling Mode alignment can be adjusted before overlap is calculated. x offset y offset z offset The offset is applied to the second mode listed.

See Also copydcard 351 , findmodes 337 , coupling 338 , bestoverlap 340 , propagate 341 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE No Yes No No

8.11.10 bestoverlap
Finds the best overlap between the D-CARD called "test_mode" and the currently calculated modes. It returns the name of the mode with the best overlap. This function is mainly used for tracking the desired mode during parameter sweeps. See the overlap function for more details about overlap and coupling calculations.

Syntax out = bestoverlap ("test_mode");

Description Calculates the best overlap. out: a string containing the name of the mode with the best overlap test_mode: a string containing the name of a D-CARD

2003 - 2012 Lumerical Solutions, Inc

Scripting Language mode See Also findmodes 337 , coupling 338 , overlap 339 , propagate 341 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE No Yes No No

341

8.11.11 propagate
The propagate command calculates the resulting mode profile of an arbitrary mode after it has propagated through a waveguide for some distance. This is done by decomposing the mode into modes supported by the waveguide. Each supported mode is then propagated through the waveguide. The resulting modes are then added coherently to give the final mode profile. See the overlap function for more details about overlap and coupling calculations. Syntax out = propagate(mode, d, n1, n2); Description mode: the name of the d-card containing the mode to propagate d: distance to propagate n1: minimum index n2: maximum index out: the name of the D-CARD created by the propagate command A D-CARD with the name out will be created that contains the resulting mode profile Mode alignment can be adjusted before propagate is calculated. x offset y offset

out = propagate(mode, d, n1, n2, x, y);

8.12 INTERCONNECT Measurements


This section is only relevant for INTERCONNECT, please see the INTERCONNECT Knowledge Base for more information.

2003 - 2012 Lumerical Solutions, Inc

342

Reference Guide

8.12.1 validate
Updates the results for the specified analyzer. Syntax validate("analyzer"); Description Updates the results for "analyzer". If the name is not provided, the selected analyzer will be updated.

See Also validateall 342 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE No No Yes No

8.12.2 validateall
Updates the results for all the analyzers in the current simulation. Syntax validateall; Description Updates the results for all the analyzers in the current simulation.

See Also validate 342 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE No No Yes No

8.12.3 setresult
Sets the result of a scripted/compound element. Note that this command is not available from the script prompt or script file editor. Syntax Description

2003 - 2012 Lumerical Solutions, Inc

Scripting Language setresult("result",value); setresult("result",value,"kind (unit)"); setresult("result",x,y,"x title",'y title'); See Also getresult 350 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE No No Yes No

343

Sets the "result" for the scripted/compound element to the specified value. Sets the "result" for the scripted/compound element to the specified value with the given description. Note that units should be placed in parenthesis. Sets the x, y parameters of the "result" for the scripted/ compound element. This is useful for visualization.

8.12.4 getresult
See getresult 350 .

8.12.5 popportdata
Extract the first available data value from the input port. Syntax data_out = popportdata ('input_port"); Description Returns the first available data value from "input_port".

See Also pushportdata 344 , cloneportdata 344 , portdatasize 344 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE No No Yes No

2003 - 2012 Lumerical Solutions, Inc

344

Reference Guide

8.12.6 pushportdata
Sends the data value to the specified output port. Syntax pushportdata("output_port", data); Description Sends the data value to "output_port".

See Also popportdata 343 , cloneportdata 344 , portdatasize 344 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE No No Yes No

8.12.7 cloneportdata
Clones an existing data value. Syntax data_destination = cloneportdata(data_source); Description Clones "data_source", returns the data destination.

See Also popportdata 343 , pushportdata 344 , portdatasize 344 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE No No Yes No

8.12.8 portdatasize
Returns the number of data values available at the input port. Syntax size = portdatasize Description Returns the number of data values available at the input

2003 - 2012 Lumerical Solutions, Inc

Scripting Language ("input_port"); port.

345

See Also popportdata 343 , pushportdata 344 , cloneportdata 344 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE No No Yes No

8.12.9 setsparameter
Sets the s-parameters between output port and input port. Syntax Description

setsparameter("output_port", Sets the s-parameter between "output_port" and "input_port", "constant", "input_port" as a single complex constant value (frequency value); independent). setsparameter ("output_port","mode_1", "input_port", "mode_2", "constant", value); Sets the s-parameter between "mode_1" at "output_port" and "mode_2" at "input_port" as a single complex constant value (frequency independent).

setsparameter("output_port", Sets the s-parameter between "output_port" and "input_port", "transmission", "input_port", where the transmission is a matrix with 3 transmission); columns: frequency (Hz), amplitude and angle (rad). The number of rows of the matrix is the number of frequency points. If only two columns are provided, it is assume that the angle values are zero. setsparameter ("output_port","mode_1", "input_port", "mode_2", "transmission", transmission); Sets the s-parameter between "mode_1" at "output_port" and "mode_2" at "input_port", where the transmission is a matrix with 3 columns: frequency (Hz), amplitude and angle (rad). The number of rows of the matrix is the number of frequency points. If only two columns are provided, it is assume that the angle values are zero.

2003 - 2012 Lumerical Solutions, Inc

346

Reference Guide setsparameter("output_port", Sets the frequency dependent propagation parameters "input_port", "propagation", between between "output_port" and "input_port", where the propagation, length); propagation is a matrix with up to 5 columns columns: frequency (Hz), absorption (dB/m), effective index, group velocity (m/s) and disperstion (m/s/s). The number of rows of the matrix is the number of frequency points. Group velocity and dispersion are optional. The length (m) is the propagation length. setsparameter ("output_port","mode_1", "input_port", "mode_2", "propagation", propagation, length); Sets the s-parameter between "mode_1" at "output_port" and "mode_2" at "input_port", where the propagation is a matrix with up to 5 columns columns: frequency (Hz), absorption (dB/m), effective index, group velocity (m/s) and disperstion (m/s/s). The number of rows of the matrix is the number of frequency points. Group velocity and dispersion are optional. The length (m) is the propagation length.

Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE No No Yes No

8.12.10 setfir
Initialize a FIR filter using the current s-parameters. Syntax setfir("window",taps); Description Initialize a FIR filter (with the specified number of taps) using the current s-parameters. "window" is the window function used by the FIR. The options are: "rectangular", "hamming", "hanning".

See Also setsparameter 345 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE No No Yes No

2003 - 2012 Lumerical Solutions, Inc

Scripting Language

347

8.13 Measurement and optimization data


Measurement data (monitor and analysis data in FDTD Solutions and MODE Solutions' Propagator, as well as mode data in MODE Solutions' Eigenmode Solver) is stored within data structures called d-cards that are either created by the user or created automatically to record and store appropriate calculation data. D-cards can be: Local: This means that they are a generated by the current simulation (or by running analysis scripts in the current simulation) and will be lost when switching back to layout mode. Global: This means that they persist until deliberately cleared with a call to cleardcard. Global d-cards are not saved with the file, and should be saved separately in an ldf file. Data obtained from analysis The following commands are used to take inventory of which data structures exist, and to determine the types of data available within each data structure. Command getdata 349 runanalysis 350 havedata 351 copydcard 351 cleardcard 353 clearanalysis 352 Description Provides a list of existing d-cards, or shows the data contained in a specific d-card. Runs the analysis script in analysis objects Used to see if there is any data stored within a dcard. Creates a copy of a d-card. Clears a d-card. Clears d-card data obtained by running analysis scripts.

The following commands are used to retrieve data from d-cards. Command getdata 349 getelectric 353 getmagnetic 354 read and write data to file 354 Description Gets specific data from a d-card. Get |E|2 Get |H|2 Read and write data to a file.

The following commands are used for datasets. Command Description

2003 - 2012 Lumerical Solutions, Inc

348

Reference Guide rectilineardataset 354 matrixdataset 355 addparameter 356 addattribute 356 getresult 350 getparameter 357 getattribute 357 Creates a empty rectilinear dataset associated with the coordinates x/y/z. Creates an empty matrix dataset. Adds a parameter to an existing dataset. Adds an attribute to an existing dataset. Gets the dataset results from a monitor or analyzer. Get a parameter from an existing dataset. Get an attribute from an existing dataset.

Parameter sweep/optimization data is global. It is saved with the simulation file and is not cleared when switching the current simulation to layout mode. Data can be obtained from the sweeps using the following script command: Command getsweepdata 348 Description Returns parameter sweep or optimization data.

8.13.1 getsweepdata
Gets data from a parameter sweep or optimization. Note: copydcard and cleardcard will not work with the sweep or optimization data. To save sweep data to a lumerical data file, ".ldf", use the savedata script command. Syntax ?getsweepdata; ?getsweepdata ("sweep_name"); out = getsweepdata ("sweep_name", "data"); Description Returns names of all sweep or optimization objects. Returns all the names of the available data which is stored in the sweep or optimization object. Returns parameter sweep or optimization data. The following data can be obtained from an optimization: fomTrend - Figure of merit as a function of generation fomHistory - Figure of merit history (for each generation there will be generation size number) bestFom - Best figure of merit obtained during sweep bestParameter - Parameter which corresponds to bestFom paramHistory - Parameter history

2003 - 2012 Lumerical Solutions, Inc

Scripting Language For a parameter sweep, this command returns both parameters and results. See Also getdata 349 , savedata 174 , runsweep 319 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

349

8.13.2 getdata
Get data from the simulation. Remember to run the simulation before using getdata. Syntax ?getdata; ?getdata("monitor") out = getdata( "monitor", "dataname"); out = getdata( "dcard", "dataname", option); Description Returns names of all objects with data. Returns list of of data within the simulation object. Gets data from a monitor. For example, you can use Ex = getdata("monitor1","Ex"); to get the Ex field data from monitor1. The optional argument, option, can have a value of 1 or 2. If it is 2, the data is unfolded where possible according to the symmetry or anti-symmetric boundaries if it comes from a monitor that intersect such a boundary at x min, y min or z min. The default value of option is 2. For Propagator simulations in MODE Solutions, this options also allow users to choose whether to expand the data to the correct size for dimensions where the field component is zero. Option 1 will return a singleton value of 0 for the field component in that dimension, and option 2 will return a matrix (composed of zeros) that matches the size of the other field components. See Also Measurements 347 , havedata 351 , getelectric 353 , getmagnetic 354 , nonorm 324 , cwnorm 325 , getsweepdata 348

2003 - 2012 Lumerical Solutions, Inc

350

Reference Guide

Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.13.3 getresult
Gets the dataset results from a monitor or analysis group. For getting results that are scalar matrices, see getdata 349 . Syntax ?getresult("monitor_name"); Description Returns the names of all the results for the monitor. All the dataset and scalar matrix results will be returned in this case.

R = getresult("monitor_name Returns the result R from the monitor. R is a dataset. ","R"); See Also rectilineardataset 354 , matrixdataset 355 , getattribute 357 , addattribute 356 , "." operator 219 , visualize 259 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Version 8+ No Yes No

8.13.4 runanalysis
Runs the analysis script in analysis objects. Note: Scripts that already have data are not re-run; to re-run a script, first clear data using clearanalysis. Syntax runanalysis; Description Runs the analysis scripts in all analysis objects in the simulation file. This function does not return any data. Runs the analysis script in the analysis object named

runanalysis("group name");

2003 - 2012 Lumerical Solutions, Inc

Scripting Language "group name". This function does not return any data. See Also run 317 , getdata 349 , havedata 351 , clearanalysis 352 , runsetup 295 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

351

8.13.5 havedata
Used to see if there is any data stored within a d-card (note that only raw data is considered here, this does not include expanded data or calculated data from the monitors). Syntax havedata; havedata("name"); havedata("name","data"); Description Returns 1 if any of the d-cards currently in memory have raw data, and 0 if none of the d-cards have any raw data. Returns 1 if the d-card named "name" has raw data, and 0 if it does not have any raw data. Returns 1 if the d-card named "name" has the raw data named "data", and 0 if it does not have any raw data.

See Also Measurements 347 , getdata 349 , copydcard 351 , cleardcard 353 , workspace 189 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No Yes

8.13.6 copydcard
Will create a global copy of any d-card currently in memory. Syntax Description

2003 - 2012 Lumerical Solutions, Inc

352

Reference Guide copydcard( "name"); Will create a global copy of any d-card currently in memory called "name". By default, the new name will be ":: global_name". This function does not return any data. Will create a global copy of any d-card currently in memory called "name". The new name will be "::newname".

copydcard( "name", "newname");

See Also Measurements 347 , havedata 351 , cleardcard 353 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No No

8.13.7 clearanalysis
Clears analysis object results. This data is also cleared by switching from Analysis Mode to Layout Mode. Note: The analysis object results are calculated with the runanalysis command. Syntax clearanalysis; clearanalysis( "name1", "name2", ...); Description Clears analysis object results. This function does not return any data. Clears data from specific analysis objects.

See Also Measurements 347 , switchtolayout 264 , getdata 349 , runanalysis 350 , havedata 351 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No Yes

2003 - 2012 Lumerical Solutions, Inc

Scripting Language

353

8.13.8 cleardcard
Clears global d-cards. Only global d-cards are cleared. Local d-cards are associated with the current simulation and can only be cleared by switching from Analysis Mode to Layout Mode. Syntax cleardcard; cleardcard( "name1", "name2", ...); Description Clears all the global d-cards. This function does not return any data. Clears any number of specified d-cards.

See Also Measurements 347 , havedata 351 , copydcard 351 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No No

8.13.9 getelectric
Returns the sum of the amplitude squares for all electric field components, i.e. it returns | Ex|2+|Ey|2+|Ez|2. Syntax out = getelectric ( "monitorname"); getelectric( "monitorname", option); Description Returns |Ex|2+|Ey|2+|Ez|2 from the monitor. The optional argument, option, can have a value of 1 or 2. If it is 2, the data is unfolded where possible according to the symmetry or anti-symmetric boundaries if it comes from a monitor that intersect such a boundary at x min, y min or z min. The default value of option is 2.

See Also Measurements 347 , getdata 349 , getmagnetic 354 , cwnorm 325 , nonorm 324 Available in

2003 - 2012 Lumerical Solutions, Inc

354

Reference Guide FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No No

8.13.10 getmagnetic
Returns the sum of the amplitude squares for all magnetic field components, i.e. it returns | Hx|2+|Hy|2+|Hz|2. Syntax out = getmagnetic ( "monitorname"); getmagnetic ( "monitorname", option); Description Returns |Hx|2+|Hy|2+|Hz|2 from the monitor. The optional argument, option, can have a value of 1 or 2. If it is 2, the data is unfolded where possible according to the symmetry or anti-symmetric boundaries if it comes from a monitor that intersect such a boundary at x min, y min or z min. The default value of option is 2.

See Also Measurements 347 , getdata 349 , getelectric 353 , cwnorm 325 , nonorm 324 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No No

8.13.11 Read and write data to files


Please see the following section for file I/O commands. System level commands: File input and output 156

8.13.12 rectilineardataset
Creates an empty rectilinear dataset that is associate with the x/y/z coordinates (ex. E and H fields). Like matrix datasets, rectilinear datasets can be parameterized, and can contain an arbitrary number of attributes (see addattribute) 356 and parameters (see addparameter) 356 . For datasets that are not associated with the x/y/z coordinates (ex. transmission as a function of frequency), see matrixdataset 355 .

2003 - 2012 Lumerical Solutions, Inc

Scripting Language

355

Syntax rectilineardataset(x,y,z); rectilineardataset(" dataset_name");

Description Creates a empty rectilinear dataset associated with the coordinates x/y/z. Creates a empty rectilinear dataset named "dataset_name" associated with the coordinates x/y/z.

See Also matrixdataset 355 , addattribute 356 , addparameter 356 , visualize 259 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Version 8+ No No No

8.13.13 matrixdataset
Creates an empty matrix dataset. Matrix datasets differ from standard matrices in that they can be parameterized, and can contain an arbitrary number of attributes (see addattribute) 356 and parameters (see addparameter) 356 . For datasets that are associated with the x/y/z coordinates (ex. E and H fields), see rectilineardataset 354 . Syntax matrixdataset; matrixdataset(" dataset_name"); Description Creates an empty dataset. Creates an empty dataset with the name "dataset_name".

See Also rectilineardataset 354 , addattribute 356 , addparameter 356 , visualize 259 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Version 8+ No No No

2003 - 2012 Lumerical Solutions, Inc

356

Reference Guide

8.13.14 addparameter
Adds a parameter to an existing dataset. Syntax R.addparameter("p_name", p); R.addparameter("p1_name", p1, "p2_name", p2); Description Adds the parameter p to the existing dataset R. Adds the parameter1 p1 and p2 to the existing dataset R. Here, p1 and p2 must be interdependent. For example, p1 = frequency and p2 = wavelength. Parameters that are not interdependent must be added separately.

matrixdataset 355 , rectilineardataset 354 , addattribute 356 , visualize 259 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Version 8+ No No No

8.13.15 addattribute
Adds an attribute to an existing dataset. Syntax Description

R.addattribute("a_name", a); Adds the attribute a to the existing dataset R. R.addattribute("a_vector", a_1, a_2, a_3); Adds the vector attribute a_vector to the existing dataset R. The components of the vector are a_1, a_2 and a_3

See Also matrixdataset 355 , addattribute 356 , addparameter 356 , visualize 259 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Version 8+ No No No

2003 - 2012 Lumerical Solutions, Inc

Scripting Language

357

8.13.16 getparameter
Get a parameter from an existing dataset. Syntax ?getparameter(R); Description Returns the names of all the parameters in the dataset R.

Parameter = R.getparameter Retrieves the parameter p from the existing dataset R. The ("p"); result "Parameter" is a scalar matrix. Parameter = getparameter (R,"p"); Retrieves the parameter p from the existing dataset R. The result "Parameter" is a scalar matrix.

matrixdataset 355 , rectilineardataset 354 , "." operator 219 , getresult 350 , getattribute 357 , visualize 259 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Version 8+ No No No

8.13.17 getattribute
Get an attribute from an existing dataset. Syntax ?getattribute(R); Attribute = R.getattribute ("a"); Attribute = getparameter (R,"a"); Description Returns the names of all the attributes in the dataset R. Retrieves the attribute a from the existing dataset R. The result "Attribute" is a scalar matrix. Retrieves the attribute a from the existing dataset R. The result "Attribute" is a scalar matrix.

matrixdataset 355 , rectilineardataset 354 , "." operator 219 , getresult 350 , getparameter 357 , visualize 259 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Version 8+ No No No

2003 - 2012 Lumerical Solutions, Inc

358

Reference Guide

8.14 Near to far field projections


Far field projections 359 Command farfieldfilter 362 Description The far field filter is used to remove ripples in the far field projection due to clipping of the near fields. It should be used when the near fields at the edge of the monitor are small but not precisely zero. Projects a given power or field profile monitor to the far field. Farfieldvector2d is identical to farfield2d, however the data is returned as matrix of Nx1x3, where the last index refers to Ex, Ey and Ez. Farfieldpolar2d is identical to farfield2d, however the data is returned as matrix of Nx1x3, where the last index refers to Er, E and Ez, in cylindrical coordinates. farfieldangle 365 farfield3d 367 farfieldvector3d 368 For 2D simulations. It returns the matrix of angles, in degrees, corresponding to the data in farfield2d. Projects a given power or field profile monitor to the far field. Farfieldvector3d is identical to farfield3d, however the data is returned as matrix of NxMx3, where the last index refers to Ex, Ey and Ez. Farfieldpolar3d is identical to farfield3d, however the data is returned as matrix of NxMx3, where the last index refers to Er, E and E , in spherical coordinates. farfieldux 369 farfielduy 370 farfieldspherical 370 farfieldexact2d 372 farfieldexact3d 373 For 3D simulations. It returns the matrix of ux corresponding to the data in farfield3d. For 3D simulations. It returns the matrix of uy corresponding to the data in farfield3d. Interpolates far field projection data from E(ux,uy) to E(theta,phi). Calculates the far field at any specified position. Calculates the far field at any specified position.

farfield2d 363 farfieldvector2d 364

farfieldpolar2d 365

farfieldpolar3d 369

2003 - 2012 Lumerical Solutions, Inc

Scripting Language farfieldexact 374

359

Similar to farfieldexact2d and farfieldexact3d, however the far field is only evaluated at positions explicitly specified by the vector list. Calculates the integral of the far field projection over some range of theta in 2D simulation Calculates the integral of the far field projection over a specified cone in 3D simulation

farfield2dintegrate 366 farfield3dintegrate 371

8.14.1 Far field projections


FDTD/MODE Solutions allows you to perform projections of the near field electromagnetic field to the far field with simple script commands. The far field projections can be performed in two cases: Case 1 The electromagnetic fields are known on a surface, for example at z=0. The field can be projected to any point in the half-space above the surface (z>0). This will be accurate when The electromagnetic fields are zero at the edges of the surface used for the projection. The surface is one unit cell of a periodic structure and periodicity is assumed in the far field projection. Symmetric and anti-symmetric boundaries can be used in the simulation because the data is unfolded prior to performing the projection. In this case, we typically project the field as a function of angle into the half-space above the surface. This projection is fast because it can make use of ffts to perform the projection. This projection cannot be used to calculate the fields at an intermediate distance of a few wavelengths. Case 2 The electromagnetic fields are known on the surface of a box. The field can be projected to any point outside the box. It is necessary to surround the scattering object with 6 surface monitors and add the results of 6 projections coherently using an exact far field projection. This projection is slow because it does not make use of ffts. This projection

2003 - 2012 Lumerical Solutions, Inc

360

Reference Guide can be used to calculate the fields as close as a few wavelengths from where they were recorded. Field normalization The far field projection functions return either the complex electric field E or electric field intensity |E|2 at a distance of 1m. To scale the field to a different distance we can recognize that the E and |E|^2 scale as shown in the following table. Electric field scaling 2D Electric field intensity scaling

E ( R)

E0 / R

E (r )

E (1) r

3D

E ( R)

E0 / R
E (r )

E (1) r2

Power Integrals We often want to integrate power over a given solid angle in the far field. There are 2 ways this can be done 1. We integrate the fraction of total electric field intensity (|E|2) over the solid angle that we are interested in, and multiply by the normalized power transmission through the monitor in the near field. 2. We calculate the Poynting vector in the far field and integrate the power over a given solid angle. We then normalize to the original source power. In the far field, we can use plane wave relationships between E and H. Therefore the Poynting vector is simply

0 0

Both methods will give the same result. Coordinate Systems The 3D far field projections use the direction cosine coordinate system to specify far field positions. Direction cosine units provide a convenient way to specify locations on a hemispherical surface, which is what the far field projections typically return. Also, when calculating vector far field field data (to obtain polarization information), you can choose to return the data using cartesian or spherical coordinates. For more information, please see the Coordinate systems page.

2003 - 2012 Lumerical Solutions, Inc

Scripting Language For more information on Far field projections, please see Allen Taflove, Computational Electromagnetics: The Finite-Difference Time-Domain Method. Boston: Artech House, (2005).

361

See Also Near to far field projections 358 , Coordinate systems 361 , farfield2d 363 , farfieldvector2d 364 , farfieldpolar2d 365 , farfield3d 367 , farfieldvector3d 368 , farfieldpolar3d 369 , farfieldexact2d 372 , farfieldexact3d 373 , Grating calculations 376

8.14.2 Coordinate systems


The far field and grating functions use the direction cosine coordinate system to specify far field locations. Direction cosine units are a convenient way to specify locations on a hemispherical surface, which is how the far field data is usually returned. The direction cosines of a vector (ux ,uy ,uz) are the cosines of the angles between the vector and the three coordinate axes. Direction cosines are related to the spherical coordinate system by the following equations:

ux uy uz uz

sin( ) cos( ) sin( ) sin( ) cos( )


2 2 1 ux uy

2 2 ux uy u z2

r 1 acos(u z ) atan( uy ux )

When calculating vector field information, you can choose either cartesian or spherical coordinates, depending on which function you call.

2003 - 2012 Lumerical Solutions, Inc

362

Reference Guide Cartesian coordinates Spherical coordinates

Note on performing integrals We typically want to perform integrals in spherical coordinates such as the following

power

P ( , ) R 2 sin( )d d

where P is the poynting vector and R is the radius. When changing integration variables from ( , ) to (ux ,uy ), it can be shown that

power

P( , ) R 2 sin P(u x , u y ) R 2

d d cos

du x du y

Care must be taken to avoid numerical errors due to the cos( ) term. See Also Far field projections 359 ,Grating calculations 376

8.14.3 farfieldfilter
The far field filter is used to remove ripples in the far field projection due to clipping of the near fields. It should be used when the near fields at the edge of the monitor are small but not precisely zero. The far field filter has a single input parameter, which is a number between 0 and 1. By default, it is 0, which turns the filter off. This filter is applied to all far field projections.

2003 - 2012 Lumerical Solutions, Inc

Scripting Language

363

The bumpy blue line of the figure shows the near field electric field that will be used for a far field projection. In this case, the field does not go to zero at the edge of the monitor, which will lead to ripples in the far field projection. The green line shows the the spatial filter that will be applied to the fields, ensuring they go to zero. The filter parameter defines the width of the filter by the following formula: =(a)/(a+b).

Syntax out = farfieldfilter; farfieldfilter(alpha);

Description Get the current far field filter setting. Set the current far field filter setting.

Note: Periodic structures The far field filter option should not be used for periodic structures. Set it to zero when using the 'assume periodic' option. See Also farfield2d 363 , farfield3d 367 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No No

8.14.4 farfield2d
Projects a given power or field profile monitor to the far field. The electric field intensity |E|2 is returned. Syntax E2 = farfield2d("mname", f, n, illumination, periods, index, direction); Description Projects a given power or field profile monitor to the far field.

2003 - 2012 Lumerical Solutions, Inc

364

Reference Guide

Parameter mname f n illumination required optional optional optional

Default value

Type string

Description Name of the monitor Index of the desired frequency point. The number of points in the far field. For periodic structures Gaussian illumination: 1 Plane wave illumination: 2 number of periods to be used The index of the material to use for the projection. Direction: this can be +1 or -1.

1 2000 1

number number number

periods index

optional optional

1 value at monitor center direction of max power flow

number number

direction

optional

number

See Also Far field projections 358 , farfield3d 367 , farfieldangle 365 , farfieldvector2d 364 , farfieldpolar2d 365 , farfieldexact2d 372 , farfieldfilter 362 , farfieldexact 374 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No No

8.14.5 farfieldvector2d
The function farfieldvector2d is similar to farfield2d, but it returns the complex electric fields, rather than field intensity. The data is returned as matrix of Nx3, where the last index refers to Ex, Ey and Ez which are the complex components of the electric field vector. Syntax out = farfieldvector2d Description Returns the cartesian complex electric fields. Same

2003 - 2012 Lumerical Solutions, Inc

Scripting Language ( "mname",...); See Also farfield2d 363 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No No arguments as farfield2d.

365

8.14.6 farfieldpolar2d
The function farfieldpolar2d is similar to farfield2d, but it returns the complex electric fields, rather than field intensity. The data is returned as matrix of Nx3, where the last index refers to Er, E and Ez, in cylindrical coordinates. For TM simulations, this function gives precisely the result of farfieldvector2d because the only non-zero field component is Ez. Syntax out = farfieldpolar2d ( "mname",...); Description Returns the polar complex electric fields. Same arguments as farfield2d.

See Also farfield2d 363 , farfieldvector2d 364 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No No

8.14.7 farfieldangle
Used for 2D simulations. It returns the matrix of angles, in degrees, corresponding to the data in farfield2d. This is required because the projection does not use a set of linearly spaced angles for the projection. It is often useful to re-interpolate the data onto a set of linearly spaced angles using the interp or spline functions. Syntax theta = farfieldangle Description Returns the matrix of angles corresponding to the data in

2003 - 2012 Lumerical Solutions, Inc

366

Reference Guide ( "mname", f, n, index); Parameter mname f n index required optional optional optional 1 2000 value at monitor center farfield2d Default value Type string number number number Description Name of the monitor from which far field is calculated Index of the desired frequency point. The number of points in the far field. The index of the material to use for the projection.

See Also farfield2d 363 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No No

8.14.8 farfield2dintegrate
Used in 2D simulations, this function integrates the far field projection over some range of theta. Angles are specified in degrees, but the integral is done in radians. 2

E ( )d

Syntax out = farfield2dintegrate (E2, theta, halfangle, theta0); Parameter

Description Integrate 2D far field projection data.

Default value

Type

Description

2003 - 2012 Lumerical Solutions, Inc

Scripting Language E2 theta halfangle required required optional 90 matrix matrix vector E field data from farfield2d Theta from farfieldangle

367

Half angle (in degrees) of the integration region. Must have same length as theta0 or length 1. Center angle (in degrees) theta of the integration region. Must have same length as halfangle or length 1.

theta0

optional

vector

See Also Near to far field projections 358 , farfield2d 363 , farfieldangle 365 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No No

8.14.9 farfield3d
Projects a given power or field profile monitor to the far field. The electric field intensity |E|2 is returned. Syntax out = farfield3d("mname",f, na, nb, illumination, periodsa, periodsb, index, direction); Description Projects a given power or field profile monitor to the far field. For directions, when projecting in x: a is y and b is z y: a is x and b is z z: a is x and b is y Default value required optional optional 1 150 Type string number number Description Name of the monitor Index of the desired frequency point. The number of points in the far

Parameter mname f na

2003 - 2012 Lumerical Solutions, Inc

368

Reference Guide field. nb illumination optional optional 150 1 number number The number of points in the far field. For periodic structures. Gaussian illumination: 1 Plane wave illumination: 2 number of periods to be used for periodic illumination number of periods to be used for periodic illumination The index of the material to use for the projection. Direction: this can be +1 or -1.

periodsa periodsb index

optional optional optional

1 1 value at monitor center direction of max power flow

number number number

direction

optional

number

See Also Far field projections 358 , farfield2d 363 , farfieldvector3d 368 , farfieldpolar3d 369 , farfieldux 369 , farfielduy 370 , farfieldexact3d 373 , farfieldfilter 362 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No No

8.14.10 farfieldvector3d
The function farfieldvector3d is similar to farfield3d, but it returns the complex electric fields, rather than field intensity. The data is returned as matrix of NxMx3, where N and M are spatial indices and the last index refers to Ex, Ey and Ez. The components Ex, Ey and Ez are the complex components of the electric field vector. Syntax out = farfieldvector3d ( "monitorname",...); See Also Description Returns the cartesian complex electric fields. Same arguments as farfield3d.

2003 - 2012 Lumerical Solutions, Inc

Scripting Language farfield3d 367 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No No

369

8.14.11 farfieldpolar3d
The function farfieldpolar3d is similar to farfield3d, but it returns the complex electric fields, rather than field intensity. The data is returned as matrix of NxMx3, where N and M are spatial indices and the last index refers to Er, E and E , in spherical coordinates. The components Er, E and E are the complex components of the electric field vector. Syntax out = farfieldpolar3d ( "monitorname",...); Description Returns the spherical complex electric fields. Same arguments as farfield3d.

See Also farfield3d 367 , farfieldvector3d 368 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No No

8.14.12 farfieldux
Used for 3D simulations. It returns the matrix of ux corresponding to the data in farfield3d. When projecting in x: ux corresponds to y y: ux corresponds to x z: ux corresponds to x Syntax farfieldux("mname",f,na,nb, index); Description See farfield3d help. Arguments are same as for farfield3d.

2003 - 2012 Lumerical Solutions, Inc

370

Reference Guide See Also farfield3d 367 , farfielduy 370 , farfieldspherical 370 , farfieldexact 374 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No No

8.14.13 farfielduy
Used for 3D simulations. It returns the matrix of uy corresponding to the data in farfield3d. When projecting in x: uy corresponds to z y: uy corresponds to z z: uy corresponds to y Syntax farfielduy("mname",f,na,nb, index); Description See farfield3d help. Arguments are same as for farfield3d.

See Also farfield3d 367 , farfieldux 369 , farfieldspherical 370 , farfieldexact 374 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No No

8.14.14 farfieldspherical
This functions interpolates far field data (3D simulations) from E(ux,uy) to E(theta,phi). The far field projections functions generally return the projection as a function of ux,uy (direction cosines). farfieldspherical can be used to interpolate this data into the more common units of theta, phi. Syntax out = farfieldspherical( E2, ux, uy, theta, phi); Description interpolate far field data to spherical coordinates.

2003 - 2012 Lumerical Solutions, Inc

Scripting Language Parameter E2 ux uy theta phi required required required required required Default value Type matrix vector vector vector vector Description E field data from farfield3d ux data from farfieldux uy data from farfielduy

371

theta vector, in degrees. Must have length L or 1. phi vector, in degrees. Must have length L or 1.

See Also Far field projections 358 , farfield3d 367 , farfieldux 369 , farfielduy 370 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No No

8.14.15 farfield3dintegrate
Used in 3D simulations, this function integrates the far field projection over a cone centered at theta0 and phi0, with a width specified by halfangle. The far field electric field is a function of the direction cosines (ux,uy), but farfield3dintegrate automatically does the change of variables. Similarly, angles are specified in degrees, but converted to radians before the integral is calculated.

E 2 ux, uy sin( )d d
,

Syntax out = farfield3dintegrate (E2, ux, uy, halfangle, theta0, phi0); Parameter

Description Integrate 3D far field projection data.

Default value

Type

Description

2003 - 2012 Lumerical Solutions, Inc

372

Reference Guide E2 ux uy halfangle required required required optional 90 matrix vector vector vector E field data from farfield3d ux data from farfieldux uy data from farfielduy half angle of the integration cone. unit in degrees. must have length L or 1. center angle theta of the integration cone. unit in degrees. must have length L or 1. center angle phi of the integration cone. unit in degrees. must have length L or 1.

theta0

optional

vector

phi0

optional

vector

See Also Near to far field projections 358 , farfield3d 367 , farfieldux 369 , farfielduy 370 , farfieldspherical
370

Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No No

8.14.16 farfieldexact2d
This function projects complete complex vector fields to specific locations. It is expected to be correct down to distances on the order of one wavelength. The projections from multiple monitors can be added to create a total far field projection. farfieldexact2d projects any surface to the grid points defined by the vectors x, y. The data is returned in the form of a matrix that is of dimension NxMx3 where N is the length of the x vector, M is the length of the y vector and the final index represents Ex, Ey, and Ez. Note that N and M can be 1; when they are both 1, the function is the same as farfieldexact. Syntax out = farfieldexact2d ( "mname", x, y, f, index); Description Projects a given power or field profile monitor to the far field at grid points specified by the vectors x,y.

2003 - 2012 Lumerical Solutions, Inc

Scripting Language

373

Parame ter mname x y f index required required required optional optional

Default value

Type string vector vector

Description name of the monitor from which far field is calculated x coordinates of the grid points where far field is calculated y coordinates of the grid points where far field is calculated

1 index at monitor center

number Index of the desired frequency point. number The index of the material to use for the projection.

See Also farfield2d 363 , farfieldexact3d 373 , farfieldexact 374 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No No

8.14.17 farfieldexact3d
The three dimension form of farfieldexact2d. This function projects complete complex vector fields to specific locations. It is expected to be correct down to distances on the order of one wavelength. The projections from multiple monitors can be added to create a total far field projection. farfieldexact3d projects any surface to the grid points defined by the vectors x,y and z. The data is returned in a matrix of dimension NxMxKx3 where N is the length of the vector x, M the length of the vector y, K is the length of the vector z and the final index represents Ex, Ey, and Ez. Note that N, M and K can be 1, and when they are all 1, the function is the same as farfieldexact. Syntax Description

out = farfieldexact3d Projects a given power or field profile monitor to the far field ( "mname", x, y, z, f, index); at grid points specified by the vectors x,y,z.

2003 - 2012 Lumerical Solutions, Inc

374

Reference Guide

Parameter mname x y z f index required required required required optional optional

Default value

Type string vector vector vector

Description name of the monitor from which far field is calculated x coordinates of the grid points where far field is calculated y coordinates of the grid points where far field is calculated z coordinates of the grid points where far field is calculated Index of the desired frequency point. The index of the material to use for the projection.

1 value at monitor center

number number

See Also farfield3d 367 , farfieldexact2d 372 , farfieldexact 374 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No No

8.14.18 farfieldexact
This function projects complete complex vector fields to specific locations. It is expected to be correct down to distances on the order of one wavelength. The projections from multiple monitors can be added to create a total far field projection. farfieldexact projects any surface fields to a series of points defined by vector lists. The x,y, z coordinates of each evaluation point are taken element-by-element from the vector lists. i. e., the i-th point in a 2D simulation would be at [x(i),y(i)]. 3D Vectors lists x,y,z must have the same length L or be length 1. The data is returned in a matrix of dimension Lx3. The first index represents positions defined by one element from

2003 - 2012 Lumerical Solutions, Inc

Scripting Language

375

each of x,y, z. [x(i),y(i),z(i)]; the second index represents Ex, Ey, and Ez. 2D Vector lists x, y must have the same length L or be length 1. The data is returned in the form of a matrix that is of dimension Lx3. The first index represents positions defined by one element from each of x,y. [x(i),y(i)]; The second index represents Ex, Ey, and Ez. Syntax Description

out = farfieldexact("mname", 2D far field exact projection x, y, f, index) out = farfieldexact("mname", 3D far field exact projection x, y, z, f, index); Parameter mname x Default required required Default value Type string vector Description name of the monitor from which far field is calculated x coordinates of points where far field is calculated. must have length L or 1. y coordinates of points where far field is calculated. must have length L or 1. z coordinates of points where far field is calculated. must have length L or 1. Index of the desired frequency point. The index of the material to use for the projection.

required

vector

required

vector

f index

optional optional

1 value at monitor center

number number

See Also farfield2d 363 , farfield3d 367 , farfieldexact2d 372 , farfieldexact3d 373 Available in

2003 - 2012 Lumerical Solutions, Inc

376

Reference Guide FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No No

8.15 Grating projections


Grating calculations 376 Command grating 378 gratingn 379 gratingm 379 gratingpolar 380 gratingvector 381 gratingperiod1 382 gratingperiod2 382 gratingbloch1 384 gratingbloch2 385 gratingu1 383 gratingu2 384 gratingangle 383 Description Returns the strength of all physical grating orders. Returns vector of integers corresponding to data from grating function. Returns vector of integers corresponding to data from grating function Returns the relative strength of all physical grating orders in spherical coordinates. Returns the relative strength of all physical grating orders in Cartesian coordinates. Returns grating period ax. Returns grating period ay. Returns bloch vector (k in)x . Returns bloch vector (k in)y . Returns first component of the unit vector ux . Returns first component of the unit vector uy . Returns the angle of each order.

8.15.1 Grating calculations


The grating functions are used to calculate the direction and intensity of light reflected or transmitted through a periodic structure. The order directions of a 2D grating can be calculated from the well known grating equation

a x sin m

sin i

For our purposes, it's more convenient to re-write this equation in terms of the wave vector k:

2003 - 2012 Lumerical Solutions, Inc

Scripting Language

377

(km ) x

(kin ) x

2 ax

In 3D, these equations become:

( k n, m ) x ( k n, m ) y

(kin ) x (kin ) y

2 ax 2 ay

where ax and ay are the grating periods in the x and y directions respectively and (n,m) are any integers where the condition

| k n, m | k

index / o

is satisfied. It's important to remember that the grating order directions are defined entirely by the device period, the source wavelength and angle of incidence, and the background refractive index. The grating order directions can be calculated without running a simulation, however the simulation must first be meshed in order to obtain necessary information such as the dimensions and period of the structure. The functions gratingn, gratingm, gratingu1, gratingu2 and gratingangle can be used to calculate the direction of each order. After running a simulation the grating commands can be used to calculate the fraction of power that is scattered in each direction. The grating function uses a technique similar to a far field projection to calculate what fraction of near field power propagates in each grating order direction. To get polarization and phase information, use gratingpolar and gratingvector. Coordinate Systems The grating projections use the direction cosine coordinate system to specify far field positions. Direction cosine units provide a convenient way to specify locations on a hemispherical surface, which is how the grating data is returned. Also, when calculating vector field data (to obtain polarization information), you can choose to return the fields using cartesian or spherical coordinates. For more information, please see the Coordinate systems page.

2003 - 2012 Lumerical Solutions, Inc

378

Reference Guide

The grating function is closely related to far field projection functions. For more information on these calculations, please see Allen Taflove, Computational Electromagnetics: The Finite-Difference Time-Domain Method. Boston: Artech House, (2005). See Also Far field projections 359 , Coordinate systems 361 , grating 378 , gratingn 379 , gratingperiod1 382 , gratingbloch1 384 , gratingu1 383 , gratingangle 383 , gratingpolar 380 , gratingvector 381

8.15.2 grating
Returns the relative strength of all physical grating orders for a given simulation. The result corresponds to the fraction of power that is reflected or transmitted into a particular order. Results are normalized such that the sum of all the orders is equal to 1. To normalize to the source power, multiply the grating results by the power transmission at that frequency. 3D simulations: Data is returned in a N x M matrix where N,M are the number of grating orders. 2D simulations: Data is returned in a N matrix where N is the number of grating orders. Syntax Description

out = grating("monitorname", Returns the strength of all physical grating orders from f, index, direction ); monitorname. Parameter monitorname f index required optional optional 1 value at monitor center direction of max power flow Default value Type string number number Description name of the monitor from which far field is calculated Index of the desired frequency point. The index of the material to use for the projection. Direction: this can be +1 or -1.

direction

optional

number

See Also Grating projections 376 , Grating calculations 376 , gratingn 379 , gratingperiod1 382 , gratingbloch1 384 , gratingu1 383 , gratingangle 383 , gratingpolar 380 , gratingvector 381

2003 - 2012 Lumerical Solutions, Inc

Scripting Language

379

Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No No

8.15.3 gratingn
Returns the vector of integers, n, corresponding to the values returned by grating. See the Grating calculation page for more information. Syntax out = gratingn ( "monitorname",...); Description Same arguments as grating function.

See Also Grating projections 376 , Grating calculations 376 , grating 378 , gratingm 379 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No No

8.15.4 gratingm
Returns the vector of integers, m, corresponding to the values returned by grating. Only used in 3D simulations. See the Grating calculation page for more information. Syntax out = gratingm ( "monitorname",...); Description Same arguments as grating function.

See Also Grating projections 376 , Grating calculations 376 , grating 378 , gratingn 379 Available in

2003 - 2012 Lumerical Solutions, Inc

380

Reference Guide FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No No

8.15.5 gratingpolar
Returns the relative strength of all physical grating orders for a given simulation. The result corresponds to the fraction of power that is reflected or transmitted into a particular order. Results are normalized such that the sum of all the orders is equal to 1. Very similar to the basic grating function, except that the vector field information is returned in spherical coordinates. This is useful when studying the polarization effects. 3D simulations: Data is returned in a N x M x 3 matrix where N,M are the number of grating orders. The third dimension is Er, Etheta, Ephi. 2D simulations: Data is returned in a N x 3 matrix where N is the number of grating orders. The second dimension is Er, Etheta, Ephi. Syntax Description

out = gratingpolar( "mname", Returns the strength of all physical grating orders from the f, index, direction); monitor. Output is in spherical coordinates.

Parameter mname f index required optional optional

Default value

Type string

Description name of the monitor from which far field is calculated Index of the desired frequency point. The index of the material to use for the projection. Direction: this can be +1 or -1.

1 value at monitor center direction of max power flow

number number

direction

optional

number

See Also Grating projections 376 , Grating calculations 376 , grating 378 , gratingn 379 , gratingperiod1 382 , gratingbloch1 384 , gratingu1 383 , gratingangle 383 , gratingvector 381

2003 - 2012 Lumerical Solutions, Inc

Scripting Language

381

Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No No

8.15.6 gratingvector
Returns the relative strength of all physical grating orders for a given simulation. The result corresponds to the fraction of power that is reflected or transmitted into a particular order. Results are normalized such that the sum of all the orders is equal to 1. Very similar to the basic grating function, except that the vector field information is returned in Cartesian coordinates. This is useful when studying the polarization effects. 3D simulations: Data is returned in a N x M x3 matrix where N,M are the number of grating orders. The third dimension is Ex, Ey, Ez. 2D simulations: Data is returned in a N x3 matrix where N is the number of grating orders. The second dimension is Ex, Ey, Ez. Syntax out = gratingvector ( "mname", f, index, direction); Parameter mname f index required optional optional 1 value at monitor center direction of max power flow Description Returns the strength of all physical grating orders from monitorname. Output is in Cartesian coordinates.

Default value

Type string number number

Description name of the monitor from which far field is calculated Index of the desired frequency point. The index of the material to use for the projection. Direction: this can be +1 or -1.

direction

optional

number

See Also

2003 - 2012 Lumerical Solutions, Inc

382

Reference Guide Grating projections 376 , Grating calculations 376 , grating 378 , gratingn 379 , gratingperiod1 382 , gratingbloch1 384 , gratingu1 383 , gratingangle 383 , gratingpolar 380 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No No

8.15.7 gratingperiod1
Returns the grating period ax based on the value from the simulation area. See the Grating calculation page for more information. Syntax out = gratingperiod1 ( "monitorname", ...); Description Same arguments as grating function.

See Also Grating projections 376 , Grating calculations 376 , grating 378 , gratingperiod2 382 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No No

8.15.8 gratingperiod2
Returns the grating period ax based on the value from the simulation area. Only used in 3D simulations. See the Grating calculation page for more information. Syntax out = gratingperiod2 ( "monitorname", ...); Description Same arguments as grating function.

See Also Grating projections 376 , Grating calculations 376 , grating 378 , gratingperiod1 382 Available in

2003 - 2012 Lumerical Solutions, Inc

Scripting Language FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No No

383

8.15.9 gratingangle
Returns the angle of each order corresponding to the values returned by grating, in degrees. Only available for 2d simulations. See the Grating calculation page for more information. Syntax out = gratingangle ( "monitorname", ...); Description Same arguments as grating function.

See Also Grating projections 376 , Grating calculations 376 , grating 378 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No No

8.15.10 gratingu1
Returns first component of the unit vector (ux ) corresponding to the values returned by grating. See the Grating calculation page for more information. Syntax out = gratingu1 ( "monitorname", ...); Description Same arguments as grating function.

See Also Grating projections 376 , Grating calculations 376 , grating 378 , gratingu2 384 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No No

2003 - 2012 Lumerical Solutions, Inc

384

Reference Guide

8.15.11 gratingu2
Returns first component of the unit vector (uy ) corresponding to the values returned by grating. Only used in 3D simulations. See the Grating calculation page for more information. Syntax out = gratingu2 ( "monitorname", ...); Description Same arguments as grating function.

See Also Grating projections 376 , Grating calculations 376 , grating 378 , gratingu1 383 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No No

8.15.12 gratingbloch1
Returns the value of the bloch vector (k in)x used for the calculation, based on the value for the simulation area. See the Grating calculation page for more information. Syntax out = gratingbloch1 ( "monitorname", ...); Description Same arguments as grating function.

See Also Grating projections 376 , Grating calculations 376 , grating 378 , gratingbloch2 385 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No No

2003 - 2012 Lumerical Solutions, Inc

Scripting Language

385

8.15.13 gratingbloch2
Returns the value of the bloch vector (k in)y used for the calculation, based on the value for the simulation area. Only used in 3D simulations. See the Grating calculation page for more information. Syntax out = gratingbloch2 ( "monitorname", ...); Description Same arguments as grating function.

See Also Grating projections 376 , Grating calculations 376 , grating 378 , gratingbloch1 384 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No No

8.16 Material database


The following commands are used to add or copy materials in the material database, as well as to set any material property and verify the resulting complex index of a given material at any frequency. (The permittivity can be easily obtained by squaring the index.) Please see the chapter on the material database to understand the usage of these commands. Command addmaterial 386 copymaterial 386 setmaterial 387 getmaterial 387 getindex 388 getfdtdindex 388 getmodeindex 389 Description Adds a new material into the material database. Copies an existing material in the material database Sets any property of an existing material in the material database. Returns properties of a material in the material database. Returns the complex index of a material. Returns the material index as it will be in an actual FDTD simulation. Returns the material index as it will be in an actual

2003 - 2012 Lumerical Solutions, Inc

386

Reference Guide MODE simulation. getnumericalpermittivity 390 An advanced function that returns permittivity, taking into account the effect of finite size of dt in an FDTD simulation.

8.16.1 addmaterial
Adds a new material to the material database. Syntax ?addmaterial; out = addmaterial ("materialtype"); Description Displays all types of materials that can be added into the material database. Adds a new material and returns the name of the new material. The argument "materialtype" is has to match correct string exactly.

See Also Material database 385 , setmaterial 387 , getindex 388 , getfdtdindex 388 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No Yes

8.16.2 copymaterial
Makes a copy of a material in the material database. Syntax out = copymaterial ("materialname"); Description Creates a copy of the material "materialname". The new name is returned.

See Also Material database 385 , setmaterial 387 , getindex 388 , getfdtdindex 388 Available in

2003 - 2012 Lumerical Solutions, Inc

Scripting Language FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No Yes

387

8.16.3 setmaterial
Modifies properties of a material in the material database. Syntax ?setmaterial ("materialname"); Description Displays the property names of the specified material that can be modified.

setmaterial( "materialname", Sets the property named "propertyname" of the material "propertyname", newvalue); with the name "materialname" to newvalue. The argument newvalue can be a number or a string. The arguments "propertyname" and "materialname" have to match correct string exactly. For example, setmaterial("Si","Mesh order",4); will set the property "mesh order" of the materials "Si" to 4. See Also Material database 385 , addmaterial 386 , getmaterial 387 , getindex 388 , getfdtdindex 388 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No Yes

8.16.4 getmaterial
Returns properties of a material in the material database. Syntax ?getmaterial ( "materialname"); out = getmaterial ( "materialname", "propertyname"); Description Displays the property names of the specified material that can be modified. Returns the property named "propertyname" of the material with the name "materialname". The returned variable is either a matrix or a string, depending on the property in the

2003 - 2012 Lumerical Solutions, Inc

388

Reference Guide query.

See Also Material database 385 , addmaterial 386 , setmaterial 387 , getindex 388 , getfdtdindex 388 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No Yes

8.16.5 getindex
Returns the complex index of any material that is in the material database. The index at the specified frequency is interpolated from the neighboring frequencies where the index data is available. Syntax out = getindex ( "materialname", f); getindex( "materialname", f, component); Description Returns the complex index of the material with the given name. The index is returned for the specified frequency f. Frequency f is in Hz. Optional argument component can be 1, 2 or 3 to specify the x, y or z component for anisotropic materials. The default is 1.

See Also Material database 385 , getfdtdindex 388 , getmodeindex 389 , addmaterial 386 , setmaterial 387 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No No

8.16.6 getfdtdindex
This function returns the material index of a material in the database as it will be used in an actual FDTD simulation. Many materials (such as Sampled materials) have properties that depend on frequency.

2003 - 2012 Lumerical Solutions, Inc

Scripting Language

389

Using getfdtdindex, you can specify frequency range, and the fitting routine will find a best fit of the material data over that range. The index evaluated at the specified f is then returned. Note that the fit result depends on the fit parameters, Max coefficients and Tolerance set for the material, thus getfdtdindex result depends on those parameters as well. Syntax out = getfdtdindex ( "materialname", f, fmin, fmax); Description Returns the complex index of the material with the given name. The index is returned for the specified frequency f. Similar to getindex, but you also specify fmin and fmax, the span of frequency of the FDTD simulation. All frequency units are in Hz.

getfdtdindex("materialname", Optional argument component can be 1, 2 or 3 to specify f,fmin, fmax, component); the x, y or z component for anisotropic materials. The default is 1. See Also Material database 385 , getindex 388 , getmodeindex 389 , addmaterial 386 , setmaterial 387 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No No

8.16.7 getmodeindex
This function returns the material index of a material in the database as it will be used in an actual MODE simulation. Many materials (such as Sampled Materials) have properties that depend on frequency. Using getmodeindex, you can obtain the refractive index as a function of the specified frequency, f, as it will be used in MODE calculations. Note that when multi-coefficient models are used, the fit result depends on the fit parameters, Max coefficients and Tolerance set for the material. Syntax out = getmodeindex ( "materialname", f); Description Returns the complex index of the material with the given name. The index is returned for the specified frequency f. This result is identical to getindex unless the optional arguments fitsampled and fitanalytic are used. All

2003 - 2012 Lumerical Solutions, Inc

390

Reference Guide frequency units are in Hz. getmodeindex ("materialname", f, component); getmodeindex ("materialname", f, component, fitsampled, fitanalytic, fmin, fmax); Optional argument component can be 1, 2 or 3 to specify the x, y or z component for anisotropic materials. The default is 1. Optional arguments to specify if Sampled Materials or Analytic Materials should be fitted using Lumerical's multicoefficient model (MCM), which is commonly used in FDTD simulations. If either of these options are set to 1 (true) then you must supply a minimum and maximum frequency for fitting. The MCM is typically used in MODE Solutions for Sampled Materials when calculating waveguide dispersion, and for Analytic Materials only for the purpose of using precisely the same materials in both FDTD and MODE simulations. The default values are 0 (false) for fitsampled and fitanalytic.

See Also Material database 385 , getindex 388 , getfdtdindex 388 , addmaterial 386 , setmaterial 387 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No No

8.16.8 getnumericalpermittivity
This advanced function returns the permittivity of a material in the database as it will be used in an actual FDTD simulation, including the effects of a finite time step, dt. In FDTD, the relationship between the displacement field, D, and the electric field, E, is given by

0 r

, dt E

In the limit where dt tends to zero, we have lim dt 0 r , dt n 2 where n( ) is the refractive index returned by the script function getfdtdindex, or shown in the Materials Explorer. If you set dt to zero when calling this function, it will return exactly the same result as the square of getfdtdindex. The name of the function is a reminder that it returns the numerical permittivity, ie, the ratio

2003 - 2012 Lumerical Solutions, Inc

Scripting Language

391

of D and E, which is different from the refractive index, ie the ratio of the speed of light in a vacuum to the phase velocity of light in the medium. To understand the relationship between the them, we must consider the full, numerical dispersion relation between and k which is given by
r

1 , dt sin cdt

dt 2

k dx 1 sin x dx 2

k y dy 1 sin dy 2

1 k dz sin z dz 2

In the limit where dt, dx, dt and dz tend to zero, it is easy to show that we have the expected result

ck r ( , dt

0)

ck n( )

The spatial FDTD mesh and time step are generally chosen to obtain a desired level of simulation accuracy, essentially by ensuring that the arguments of the sine functions are sufficiently small that sin(x)~x and that the simulation is stable. For some materials, it may be desired to further reduce the value of the time step, dt, without modifying the spatial FDTD mesh, in order to obtain a higher level of accuracy for r( ,dt). This script function makes it possible to calculate, in advance, the value of dt required to obtain the desired accuracy for the permittivity. Syntax out = getnumericalpermittivity ( "materialname", f, fmin, fmax, dt); getnumericalpermittivity ("materialname", f,fmin, fmax, dt, component); Description Returns the complex permittivity of the material with the given name. The permittivity is returned for the specified frequency f. This is similar to getfdtdindex except for the additional parameter dt. All frequency units are in Hz. Optional argument component can be 1, 2 or 3 to specify the x, y or z component for anisotropic materials. The default is 1.

See Also Material database 385 , getindex 388 , addmaterial 386 , setmaterial 387 , getfdtdindex 388 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes No No

2003 - 2012 Lumerical Solutions, Inc

392

Reference Guide

8.17 User defined GUIs


Custom GUIs can be created with the following commands. Command message 392 newwizard 393 newwizardpage 393 wizardwidget 394 runwizard 395 wizardgetdata 396 killwizard 396 wizardoption 397 fileopendialog 397 filesavedialog 398 Description Creates a message window that displays some text. Used to create a new user defined wizard. This creates a page for the wizard. Adds a new widget to the current wizard window. Runs the wizard and returns a value indicating which button was pressed. Returns data entered into a specific widget. This closes the wizard window. Sets some options for wizard widgets and labels. Calls the standard windows file open dialog. Calls the standard windows file save dialog.

Typically, a wizard will be created with the following steps 1. Open a new wizard with newwizard 393 2. Add a new wizard page with newwizardpage 393 3. Add widgets to the wizard page with wizardwidget 394 4. Call runwizard 395 to run the wizard 5. Use wizardgetdata 396 to obtain values entered into widgets by the user 6. Depending on the values returned by runwizard 395 , the wizard can be closed with killwizard 396 , or a new wizard page is started with newwizardpage 393 .

8.17.1 message
Creates a message window that displays some text. The user must hit Enter, or click the OK button to continue. Syntax message("text"); Description Creates a window that displays text. This function does not return any data.

See Also User defined GUI 392 , newwizard 393

2003 - 2012 Lumerical Solutions, Inc

Scripting Language

393

Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.17.2 newwizard
Used to create a new user defined wizard. Opens a new wizard window. Syntax newwizard( w, h, "title"); Description w and h (width and height) are specified in pixels. The minimum values for w and h are 200. title is the wizard window title.

See Also User defined GUI 392 , message 392 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.17.3 newwizardpage
This creates a page for the wizard and should be done before adding any widgets. Syntax newwizardpage( "label1"); newwizardpage( "label1", "label2"); Description Creates a button with the label "label1". Typically, this will be "Done" or "OK". Creates two buttons with labels "label1" and "label2". These will typically be "Next" and "Back" or "Done" and "Back".

See Also User defined GUI 392 , newwizardpage 393 Available in

2003 - 2012 Lumerical Solutions, Inc

394

Reference Guide FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.17.4 wizardwidget
Adds a new widget to the current wizard window. This command should only be done after creating a new wizard page with the command newwizard. Syntax wizardwidget( "type", "name"); Description type can be "number" for a numeric input field "string" for a alphanumeric field "checkbox" for a checkbox "menu" for a pulldown menu field "label" to add a string label (wizardgetdata does not return information for labels) name is a string used to give the input field, checkbox, menu item or label a name.

wizardwidget( "type", "label", defaultValue provides a default value for numeric inputs, defaultValue); checkboxes, menu items or strings. wizardwidget( "type", "label", If the "type" of widget is a "menu", then the menu choices "choices", defaultValue); must be provided. These choices should be separated by the character "|". For example, to create a pulldown widget with the name "simulation type" and 3 choices "TE","TM","3D", with the default choice "3D", the command is wizardwidget("menu","simulation type","TE|TM|3D",3); See Also User defined GUI 392 , newwizardpage 393 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

2003 - 2012 Lumerical Solutions, Inc

Scripting Language

395

8.17.5 wizarddata
This command will cause the wizard window to wait until the user selects OK or Cancel. It then returns value data from the matrix in a N+1 length matrix, where N is the number of widgets (excluding labels) in the current wizard page. This function is only available in MODE Solutions. Syntax out = wizarddata; Description The values of out are out(1) = 0, 1 or -1. 0 means the user pressed Cancel, 1 means the user pressed the first button (typically "OK" or "Next") and -1 means the user pressed the second button (typically "Back") out(2:N+1) gives the numeric values that the user entered for each input field when out(1) is 1. Note that check boxes return 1 if checked and 0 if unchecked. Menu items return a number between 1 and M where M is the number of choices in the menu. If out(1) is 0 or -1, all the values out(2:N+1) are zero.

See Also User defined GUI 392 , newwizard 393 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.17.6 runwizard
Runs the wizard and returns a value indicating which button was pressed. Syntax out = runwizard; Description Returns either 0, +1 or -1. 0 means the user pressed Cancel, 1 means the user pressed the first button (created by calling newwizardpage) and -1 means the user pressed the second button (created by calling newwizardpage).

See Also User defined GUI 392 , newwizardpage 393


2003 - 2012 Lumerical Solutions, Inc

396

Reference Guide

Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.17.7 wizardgetdata
Returns data entered into a specific widget. This function is only available in MODE Solutions. Syntax out = wizardgetdata(N); Description Returns the value that the user entered into the Nth widget. Out will be a number or a string, depending on the type of widget.

See Also User defined GUI 392 , newwizardpage 393 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.17.8 killwizard
This closes the wizard window. It should only be called after a wizard window has been created with the newwizard command. Syntax killwizard; Description This closes the wizard window.

See Also User defined GUI 392 , newwizardpage 393 Available in

2003 - 2012 Lumerical Solutions, Inc

Scripting Language FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

397

8.17.9 wizardoption
Sets some options for wizard widgets and labels. Syntax wizardoption ("optionname", setting); Description The options are "fontsize" sets the font size to any value between 8 and 40 "fieldwidth" sets the width of each widget field to any value between 20 and the full width of the wizard window. "fieldheight" sets the height of each field to any value between 8 and the full height of the wizard window. "margin", sets size of the left margin to any value between 0 and full width of the wizard window.

See Also User defined GUI 392 , newwizard 393 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.17.10 fileopendialog
Calls the standard windows file open dialog. Syntax out = fileopendialog; out = fileopendialog(".ext"); Description Brings up the open file dialog box and returns the path that the user selects. Brings up the open file dialog box, displaying only files with the extension .ext. Returns the path of the file that the user selects.

See Also

2003 - 2012 Lumerical Solutions, Inc

398

Reference Guide User defined GUIs 392 , filesavedialog 398 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.17.11 filesavedialog
Calls the standard windows file save dialog. Syntax out = filesavedialog; out = filesavedialog(".ext"); Description Brings up the save file dialog box and returns the path that the user selects. Brings up the save file dialog box, displaying only files with the extension .ext. Returns the path of the file that the user selects.

See Also User defined GUIs 392 , fileopendialog 397 Available in FDTD Solutions MODE Solutions INTERCONNECT DEVICE Yes Yes Yes Yes

8.18 Creating your own script commands


You can run any script file simply by typing the name of the file (without the .lsf extension), as long as the file is in your current working directory or in the current path (see getpath 170 and addpath 170 ). For example, if you create the file create_array.lsf, you can run this file from the command prompt, or another script file, with the command create_array; The directory C:\Program Files\Lumerical\FDTD\scripts (Windows) /usr/local/lumerical/scripts (Linux) is always in the path. Therefore, you can save any script files to that directory and they will always be in the path.

2003 - 2012 Lumerical Solutions, Inc

Scripting Language

399

Script files must follow these formatting rules: Multiple commands are allowed on a single line. Blank lines, space and tabs will be ignored. Therefore you can format your script files any way you choose. Each command should terminate with a semicolon. On any line, all characters after a # symbol are ignored. The last line in the script file must have a carriage return. Finally, you can not define a variable or assign values to a variable that has the same name as one of the script commands. For example, the following lines sum = matrix(1,2); angle = acos(pi/2); are not valid statements and will return an error.

Note: All script files use a common variable space. As a consequence, variables defined in the scripts are global, and the script files have access to all variables defined in the simulation project file. This can lead to problems when two script files use the same variable names. For example, script_1.lsf (defined below) will print the value 10 to the command line since script_2.lsf modified the variable i. script_1.lsf i=1; script_2; ?i; script_2.lsf for(i=1:10) { # do something }

2003 - 2012 Lumerical Solutions, Inc

Index

401

Index
' 203 195 ! 201, 202 != 197 " 202 # 205 % 184 & 199, 200 * 194 / 194 : 183 ? 204 [] 184 ^ 196 | 200, 201 ~ 202 + 195 < 198 <= 198 = 183 == 196 > 199 >= 198 abs 213 absolute 213 access 190 acos 211 addanalysisgroup 265 addbulkgen 280 addcircle 266 addcustom 267 adddevice 278 adddiffusion 279 adddipole 273 addeigenmode 271 addfdtd 270
2003 - 2012 Lumerical Solutions, Inc

addgaussian 273 addgridattribute 280 addgroup 264 addimage 267 addimportdope 279 addimportedsource 275 addimportgen 280 addindex 275 addition 195 addjob 318 addmaterial 386 addmesh 272 addmode 272 addmodesource 273 addmovie 276 addobject 266 addpath 170 addplane 274 addpoly 268 addpower 277 addprofile 276 addpropagator 271 addpyramid 267 addrect 268 addring 269 addsphere 270 addstructuregroup 265 addsurface 270 addtfsf 274 addtime 276 addtogroup 290 addtriangle 269 adduserprop 291 almostequal 196 analysis 336 analysis group 104, 134 analysis tools 133 and 200 angle 214

402

Reference Guide cos 209 cosine 209 coupling 338 cp 164 createbeam 277 cross 220 ctranspose 229 currentfilename 167 custom primitive 75 cwnorm 325 czt 238 data export 138 del 162 delete 285 deleteall 285 detail 74 Dielectric 117 dipolepower 328 dir 162, 163 division 194 dot 219 double quote 202 drude 117 edit 54 eig 220 eigenvalue 220 eigenvector 220 else 252 endl 204 eps0 191 equal 183 equal to 196 equation interpreter 114 escape 172 eval 230 exit 165 exp 216 exponential 216 exportfigure 260
2003 - 2012 Lumerical Solutions, Inc

anisotropic 121 apodization 108 arccos 211 arcsin 210 arctan 211, 212 array 183, 184, 190, 191 asap 91, 176, 177 asapexport 176 asapimport 177 asapload 176 asin 210 assign 190 assignment 183 atan 211 atan2 212 bestoverlap 340 boundary conditions 86 break 172 c 191 CAD layout 51 calculate modes 337 cd 163 ceil 246 centroid 240 changing CAD layout 64 clear 189 clearanalysis 352 cleardcard 353 clearjobs 319 clearsourcedata 307 closeall 261 comment 205 comparison 196 component 62 conductivity 117 conj 213 conjugate 213 copy 164, 290 copydcard 351

Index farfield2d 363 farfield2dintegrate 366 farfield3d 367 farfield3dintegrate 371 farfieldangle 365 farfieldexact 374 farfieldexact2d 372 farfieldexact3d 373 farfieldfilter 362 farfieldpolar2d 365 farfieldpolar3d 369 farfieldspherical 370 farfieldux 369 farfielduy 370 farfieldvector2d 364 farfieldvector3d 368 feval 231 fft 233 fftk 236 fftw 235 filebasename 167 filedirectory 168 fileexists 166 fileextension 168 fileopendialog 397 filesavedialog 398 find 227 findmodes 337 findpeaks 228 findstring 232 finite 249 flip 222 floor 246 for 251 format 173 framerate 312 frequencysweep 338 gaussian 248 gds 178
2003 - 2012 Lumerical Solutions, Inc

403

gdsii 77, 178 geometry 74 get 294 getcommands 169 getdata 349 getelectric 353 getfdtdindex 388 getglobalmonitor 298 getglobalsource 298 getindex 388 getmagnetic 354 getmaterial 387 getmodeindex 389 getnamed 296 getnamednumber 297 getnumber 296 getnumericalpermittivity 390 getpath 170 getsolver 299 getsourceangle 323 getsweepdata 348 getview 311 graphics graphical rendering 74 grating 376, 378 gratingangle 383 gratingbloch1 384 gratingbloch2 385 gratingm 379 gratingn 379 gratingperiod1 382 gratingperiod2 382 gratingpolar 380 gratingu1 383 gratingu2 384 gratingvector 381 greater than 199 greater than or equal to 198 groupscope 284 havedata 351

404

Reference Guide ls 163 main 52 main title bar 52 material 74, 117 material database 116 material models 117 matlab 138, 179 matlabget 181 matlabput 181 matlabsave 179 matrix 185, 191, 221 max 218 Max coefficients 117 mesh 127, 336 mesh refinement region 83 meshgrid3dx 187 meshgrid3dy 188 meshgrid3dz 188 meshgrid4d 188 meshgridx 186 meshgridy 187 message 392 min 219 mod 246, 247 model 117 modulus 246 monitor 104 mouse mode 55 move 165, 289 moving windows 64 mu0 191 multiplication 194 multiply 221 mv 165 natural 215 negative 195 new2d 159 new3d 159 newmode 160
2003 - 2012 Lumerical Solutions, Inc

haveproperty 299 if 252 imag 212 image 258 imaginary 212 import 77, 178 import object 70 importnk 302 importnk2 304 importsurface 300 importsurface2 301 inpoly 241 integrate 225 integrate2 226 integration 49 interp 224 interpolate 224, 225 interptri 224 inverse 237 invfft 237 Kerr nonlinear 117 killwizard 396 layoutmode 264 legend 257 length 217 less than 198 less than or equal to 198 library 62 linecross 245 lineintersect 244 linspace 185 ln 215 load 161, 173 loaddata 173 location 74 log 215 log10 215 loop 251 lorentz 117

Index newproject 158 newwizard 393 newwizardpage 393 nonorm 324 normal 248 normalization 37 not 197, 201, 202 num2str 229 object tree 60 Optimization 150 or 201 orbit 311 order 127 output 204 overlap 339 Particle Swarm Optimization path 170, 171 pause 171 PEC 117 permeability 191 permittivity 191 permute 222 phase 214 pi 191 pinch 217 plasma 117 plot 253 plotxy 254 polar 255 polar2 256 polarimage 257 polyand 242 polyarea 239 polydiff 243 polygrow 241 polyintersect 240 polyor 242 polyxor 244 power 196
2003 - 2012 Lumerical Solutions, Inc

405

150

priorities 127 product 219, 220 propagate 341 PSO 150 pwd 164 quit 165 rand 248 randmatrix 186 random 248 randreset 248 readdata 175 real 212 redo 313 redraw 307 redrawmode 309 redrawoff 308 redrawon 308 replace 232 replacestring 233 reshape 223 rm 162 rotations 74 round 246, 247 run 169, 317 runanalysis 350 runjobs 318 running a simulation 132 runparallel 317 runsetup 295 runsweep 319 runwizard 395 sampled data 117 save 161, 174 savedata 174 savedcard 174 screen 204 script 169 scripting editor prompt command line seed 248

63

406

Reference Guide sqrt 215 square root 215 str2num 230 string to number 230 strings 202, 203 structure 70 structures group 70 substring 231 subtraction 195 sum 218 surface 80 surface object 80 switchtolayout 264 system 166 tan 210 tangent 210 Tolerance 117 toolbar 52 transmission 321 transmission_avg 322 transmission_pavg 323 transparency 74 transpose 228 undo 313 units 37 unselectall 286 unwrap 214 updatesourcemode 306 variables with spaces 184 view 57 view ports perspective 60 visualize 259 which 171 wizarddata 395 wizardgetdata 396 wizardoption 397 wizardwidget 394 workspace 189 write 175
2003 - 2012 Lumerical Solutions, Inc

select 287 selectall 285, 286 selectfigure 259 selectmode 337 selectpartial 287 Sellmeier 117 set 292 set analysis 335 setanalysis 335 setglobalmonitor 293 setglobalsource 294 setmaterial 387 setnamed 292 setplot 260 setsourcesignal 305 setview 310 shiftselect 288 shiftselectpartial 289 sign 247 simulation 58 simulation region 83 sin 209 sine 209 single quote 203 size 74, 216 solar 249 source 91 sourceintensity 333 sourceintensity_avg 333 sourceintensity_pavg 334 sourcenorm 325 sourcenorm2_avg 326 sourcenorm2_pavg 327 sourcepower 329 sourcepower_avg 330 sourcepower_pavg 331 spectral averaging 108 speed of light 191 spline 225

Index z-transform 238

407

2003 - 2012 Lumerical Solutions, Inc

Vous aimerez peut-être aussi