Fit or optimise a SCAPS device
scaps_optimizeFit measured J-V, QE or C-V curves and optimize solar-cell efficiency, Voc, Jsc or FF using bounded Nelder-Mead parameter searches.
Instructions
Fit device parameters to measured curves, or optimise efficiency, Voc, Jsc or FF, by bounded Nelder-Mead.
Replaces the GUI-only SCAPS curve fitter and supports several measurements at once (light and dark J-V, QE, C-V). Each simplex step is one SCAPS session per measurement condition; long runs continue as a job past wait_seconds, so poll with scaps_jobs.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| goal | Yes | fit measured curves, maximise or minimise a J-V metric, or reach a target value. | |
| metric | No | Metric for maximize, minimize and target. | |
| target | No | Target value of the metric for goal 'target'. | |
| actions | No | SCAPS action commands, e.g. {'iv.startV': 0, 'iv.stopV': 1.2, 'iv.increment': 0.02, 'qe.startlambda': 300, 'cf.points.per.decade': 5, 'intensity.ND': 1, 'spectrumcutoff.on': null, 'spectrumcutoff.longlambda': 800}. Omitted settings keep SCAPS defaults. | |
| measured | No | For fit: curves to match together, e.g. [{'kind': 'iv', 'file': 'Numos Ex 1 light.iv'}, {'kind': 'iv', 'x': [...], 'y': [...], 'illumination': 'dark', 'log': true, 'weight': 1}]. Files come from SCAPS measurements/ and are scaled by their area and units headers. Inline data: x in V, Hz or nm; y in mA/cm2 (SCAPS sign), nF/cm2 or %. Default illumination is light for iv and qe, dark for cv and cf. | |
| spectrum | No | Spectrum file in SCAPS spectrum/; default AM1.5G 1 sun. | |
| variables | Yes | Set or action keys to vary with bounds, e.g. {'layer1.defect1.Ntotal': {'min': 1e12, 'max': 1e16, 'log': true}, 'layer2.thickness': {'min': 0.03, 'max': 0.12, 'start': 0.05}}. | |
| definition | Yes | Definition file in SCAPS def/, e.g. 'example CIGS.def'. | |
| parameters | No | Ordered SCAPS set commands in script units, e.g. {'layer1.thickness': 2, 'layer1.NA': 1e16, 'layer1.defect1.Ntotal': 1e14, 'layer1.defect1.singleacceptor': null, 'interface1.IFdefect1.Ntotal': 1e10, 'contactleft.flatband.off': null, 'contactleft.workfunction': 5.1, 'external.Rs': 0.5, 'illumination.fromleft': null, 'numerical.Shockley-Queisser_limit.always': null}. null marks commands without a value. | |
| wait_seconds | No | Wait this long for the result; longer runs continue as a job. | |
| temperature_k | No | Working point temperature in K. | |
| max_evaluations | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| best | Yes | ||
| checks | Yes | ||
| run_id | Yes | ||
| status | Yes | ||
| history | Yes | ||
| progress | Yes | ||
| objective | Yes | ||
| best_value | Yes | ||
| evaluations | Yes | ||
| best_metrics | Yes |