This document discusses different techniques for modelling optical properties of nanostructures, including frequency domain and time domain methods. It provides examples of the rigorous coupled wave analysis (RCWA) frequency domain method and finite difference time domain (FDTD) time domain method. RCWA is suitable for periodic gratings and involves representing fields with Fourier expansions. FDTD discretizes Maxwell's equations in time and space using Yee's algorithm and is applicable to arbitrary structures but time consuming. Examples show using these methods to design tunable photonic crystal cavities.