This document shows how to run electromagnetic field simulations using the software package `JCMsuite`

.
The examples are organized into application areas.
The archive EMTutorial.zip contains all
examples discussed in this tutorial.
Each example is placed in a separate sub-folder containing the
project folders with the simulation specification. To run a project within `JCMcontrol`

open the corresponding `.jcmp`

project file.

Download tutorial examples

Please download the archive EMTutorial.zip which contains the project files for all examples discussed in this tutorial.

Usage from Matlab® ([1])

In each project folder you also find a script `run_project.m`

which can be used to run the project within Matlab. Before you can use `JCMsuite`

within Matlab you have to add the sub-folder `ThirdPartySupport/Matlab`

of your `JCMsuite`

installation directory (here called JCMROOT) to the Matlab search path

```
jcm_root = getenv('JCMROOT'); % Linux: use: jcm_root = <JCMROOT> -> set your JCMROOT installation directory
addpath(fullfile(jcm_root, 'ThirdPartySupport', 'Matlab'));
```

To learn more about the Matlab interface to `JCMsuite`

see the document Matlab Interface. In most examples of the tutorial the script `run_project.m`

is a direct call of the solver:

```
results = jcmwave_solve('project.jcmp')
```

followed by an analysis of the results.

*Parameter scans*

Many examples are supplemented with *parameterized* `.jcmt`

input files (`layout.jcmt`

, `sources.jcmt`

, etc.) and corresponding driver scripts (name similar to `run_scan.m`

) which show you how to run parameter scans within Matlab (e.g. geometry variations, wavelength or incidence angle scans,

Running the test suite

To check your installation we have equipped all examples with reference results. Please download the testsuite archive EMTutorialTestSuite.zip which contains a verification script `test_jcm_installation.m`

that will verify the accuracy of the results and runtime performance.

[1] | Matlab is a registered trademark of The MathWorks, Inc. |

[2] | Octave is mostly compatible to Matlab and is freely available from http://www.gnu.org/software/octave/ under the terms of the GNU General Public License (GPL) as published by the Free Software Foundation. |

**Table Of Contents**