File Exchange

image thumbnail

Interactive Simulation Toolbox for Optics

version (19.5 KB) by Soeren Schmidt
2-dimensional FDTD-Toolbox (Yee Grid,Matrix based,current like sources,PML boundaries, GUI based)


Updated 13 May 2013

View Version History

View License

The interactive FDTD-toolbox for MATLAB is a simulation software to model and
simulate two dimensional optical systems in TE-polarization.
It was designed for educational purposes - no further knowledge of MATLAB or computational physics is required. The software is embedded in a graphical user interface in which all
the simulation parameters can be set. Furthermore, geometrical structures are defined via draggable forms which makes the program very intuitive and easy to use. Even difficult simulation structures can be set up in a few minutes.
The program works very efficient, accurate and reliable. To achieve this, a matrix-based algorithm according to Yee’s FDTD-method was implemented allowing easy
parallelization. Furthermore, perfectly matched layer (PML) boundary conditions and current like sources are included for realistic scenarios.

For tutorials see: in the "Educational Tools" section, i.e. at

Simulation examples:

Photonic crystal - Mode converter:
Beyond the classical reflection law - Reflection at a cylinder -
Waveguide Coupling -
Total Internal Reflection -
Prism Tunneling -
1x3 Photonic Crystal Waveguide Splitter -
Photonic Crystal Waveguide - Defect Reflection -
Photonic Crystal Waveguide Splitter -

Any comments are highly appreciated!

Cite As

Soeren Schmidt (2021). Interactive Simulation Toolbox for Optics (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (7)

Wilfred Mason


Hi Soeren,

first of all, thanks for sharing this wonderful toolbox! I have one (maybe stupid) question. While the package works fine for me for photonic structures, I cannot compile circular, polygons or rectangular structures because 'imellipse', 'impoly' and 'imrect' are said to be "undefined variables. Did I miss something?

Thank you,



Hi Soeren, do you think you can implement the possibility to use complex refractive index profile that is generated elsewhere?


This is a very tidy and handy code to test common FDTD problems. The ease of creating refractive index profiles graphically is the most salient feature of the toolbox.
It will be highly appreciated to see the inclusion of the following additional features:
1) Ability to define complex refractive index profile
2) Ability to define sources of arbitrary size and shape
3) Unidirectional source propagation
4) Ability to measure the individual field and energy
5) full fledged 3D simulation!

Anyway,so far what I have got, I am thankful to Soeren for that.



I'd really love to see you give the user more freedom and maybe implement:

1. if one could load an map that was created outside the drawing tool.

2. option for complex refractive index instead of just epsilon. N and k are simply more common plus you now only offer real permittivity, as far as I can see



This is a very nice toolbox that makes it quite easy to demonstrate basic optic phenomena to students! Also the direct video output is very nice.

Anyways, Soeren should add in the description that the toolbox tutorials and info's are found in the "Educational Tools" section of the website, i.e. at

Thumbs up!

MATLAB Release Compatibility
Created with R2012a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!