# Constructing planar nanoparticle chain configurations (MATLAB code)
Nanoparticle-based structures can be used for various applications in photonics.
A simple example would be meta-waveguides where chains of nanoparticles are
used to transport light over large distances in a loss-free fashion.
To enable simulations we would first need to define the nanoparticle-based
structures, such as the particle positions, refractive indices, etc. Here we use
a simple Matlab script to save the particle properties when combining simple
nanoparticle based basic shapes such as linear/curve/circular particle chains and
junctions. The figure below shows an example generated nanostructure.
The example nanoparticle structure above consists of 5 basic clusters combined,
where the first cross-shaped cluster at the bottom is the starting point. The
larger configuration can be easily formed by defining inlet and outlet points
for each shape. Below we disentangle the configuration to show the inlet and
outlet particles colored in green and red respectively.
The nanoparticle shapes themselves are defined by placing particles
next to each other with a specified interparticle distance.
Further rotation and scaling operations provides us with a large number of
combinations with only basic shapes.
For the circle and curve shapes the condition of no overlap
leads to a relation between the number of particles $n$, and the curvature radius $R_c$ :
$$R_c = \frac{R_p}{\sin (\pi/n)},$$ where $R_p$ is the particle radius. This relation
limits the bending radius of curved chains to discrete minimum values.
The idea in this trivial example is that the shapes can be easily defined and
connected, a useful feature for simulations. The particle properties for this
example are then saved in a csv-file and can be used downstream for near-field
simulations. The first rows of the output format are targeted to
[CELES](https://disordered-photonics.github.io/celes/), a MATLAB toolbox to compute
the electromagnetic scattering for clusters of spheres.
## Files
- Main MATLAB script to run the example: construct_cluster.m
- Cluster class constructs the basic shapes: Cluster.m
- Shapes is Enum listing the shapes: Shape.m
- Output csv-file of the example: example_cluster_properties.csv