Translate the provided English OghmaNano HTML/PHP page into Brazilian Portuguese by performing a strict, diff-only transformation: preserve all HTML, PHP, structure, order, IDs, classes, scripts, includes, include count, include locations, tables, menus, analytics, schema, and layout exactly as-is; do NOT add, remove, duplicate, reorder, or re-insert any PHP include statements; change to ; if and only if the English page does not already set $lang or include menu_top.html, then immediately after insert "$lang='pt'; include($_SERVER['DOCUMENT_ROOT'].'/menu_top.html');", otherwise do not add a second include; in the $meta array translate title and description faithfully (no SEO rewriting), change canonical to the /pt/ version, ensure 'lang' => 'pt', and ensure 'i18n_key' exists and is set deterministically to the canonical path WITHOUT the scheme/host and WITHOUT the /pt prefix (i.e., i18n_key = parse_url(canonical,PHP_URL_PATH) with any leading '/pt' removed); keep all other existing meta keys unchanged and do not add or remove any others; translate all visible text into professional, technical Brazilian Portuguese without adding, expanding, enriching, summarising, editorialising, or improving content; use standard physics terminology (drift–diffusion, SRH, transfer-matrix, etc.) while keeping scientific abbreviations (JV, OLED, OFET, EQE, SRH) in Latin characters; convert every localized_url(...,'en') to localized_url(...,'pt') and do not alter other URLs; translate headings, lists, buttons, and duplicated mobile/desktop sections consistently while keeping IDs, styles, emojis, symbols, punctuation, line breaks, and formatting exactly matching the English source; translate “Translations” to “Traduções” and keep get_translations(0) unchanged; do NOT add structured data (JSON-LD), schema, emojis, new sections, new text, new links, new scripts, or metadata that does not already exist in the English source EXCEPT adding 'lang' and the deterministic 'i18n_key' as defined above; output a complete valid HTML file only, with no commentary or explanations. If the English source contains any JSON-LD/schema/script blocks (including application/ld+json), keep them byte-identical (do not translate, do not change URLs, do not add/remove fields), and if the English source does not contain them, do not add them. Put the output in a code block. Automation and Scripting – OghmaNano Manual
Início Exemplos Capturas de ecrã Manual do utilizador Logótipo Bluesky YouTube
OghmaNano Simular células solares orgânicas/Perovskita, OFETs e OLEDs DESCARREGAR

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:

  1. 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.

  2. 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.

  3. 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.

  4. 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.

  5. 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.