Automation and Scripting
1. Why automate simulations?
Once a device structure has been set up, the natural next step is often to ask questions such as: “What happens to my solar cell efficiency if I change the mobility of the active layer?” or “How does the emission wavelength of my laser shift if I vary the thickness of the quantum well?” Answering these questions requires systematically changing one or more material or device parameters over a range of values and analysing the resulting data. Automation is equally important for fitting and parameter extraction. In many cases, the model is fitted to experimental measurements—such as a measured J–V curve—in order to extract physically meaningful parameters (for example mobilities, recombination rates, or contact properties). Performing such fits manually is slow, error-prone, and difficult to reproduce.
Beyond individual fits, automated simulations make it practical to generate large, consistent data sets by sweeping parameters or device structures in a controlled way. These data sets are increasingly valuable for statistical analysis and for training machine-learning models, where thousands or millions of simulations may be required. In all of these cases, automation provides a scalable and reliable way to explore design spaces, extract parameters, and gain insight into device physics.
2. Examples of automation
OghmaNano offers several approaches to automating simulations, depending on your level of coding experience and the complexity of the task:
-
Parameter Scan Window: The parameter scan window allows you to vary one or more parameters in steps using the graphical user interface. No coding knowledge is required, making it ideal for quick exploratory studies. This method covers the majority of everyday use cases where you simply want to see how a parameter influences the results.
-
Python Scripting: For more fine-grained control, OghmaNano supports Python scripting. Python is open source, widely used in scientific computing, and provides maximum flexibility to automate large batch runs or integrate with external analysis tools.
-
MATLAB Scripting: Another option is MATLAB scripting. MATLAB is familiar to many scientists and engineers, but it is commercial software. GNU Octave is a free alternative, although it currently lacks full JSON support.
-
Machine-learning data generation: Automated workflows can generate large, consistent data sets by systematically varying device structures, material parameters, or operating conditions for use in machine-learning models.
-
Automated fitting and parameter extraction: Automation can also be used to fit experimental data by running the model repeatedly, for example when extracting parameters from measured J–V curves or optical spectra.
3. How automation works under the hood
All of these approaches rely on the same underlying principle: the OghmaNano simulation file (sim.oghma) is systematically edited,
and the core engine (oghma_core.exe) is executed to generate new results.
A key point to understand is that sim.oghma is simply a ZIP archive containing a JSON file (sim.json).
This file format is described in more detail
here.
If you can edit this JSON file—using Python, MATLAB, or indeed any programming language (C, C++, Java, Perl, PHP, Ruby, etc.)—you can automate OghmaNano.
👉 Next step: Now continue to understand the Oghma file format, including its structure and how simulation parameters are stored.