SPICE-based solar cell solver

When the two diode model is used to define the junctions in a MJ solar cell, then larger scale circuits can be constructed. Solcore includes two levels of large scale equivalent circuits: quasi-3D solar cell modelling and solar array modelling. Both solvers are based on the interface between Solcore and SPICE, allowing for a fast calculation of complex structures with many elements.

This solver has been tested with NGSPICE, only. Check the installation instructions for Windows and for MacOS.

Spice solver files

Solves an electrical circuit using SPICE. The input must be a correctly formated SPICE file and the output will be the raw result from SPICE or after some processing, depending of what is requested.

exception solcore.spice.spice.SpiceSolverError[source]
class solcore.spice.spice.spice[source]
engine = ''
input_file = 'current_spice.cir'
output_file = 'current_spice.out'
solcore.spice.spice.solve_circuit(spice_file_contents, engine='', raw=True)[source]

Sends the spice-readable file to the spice engine which will run it and store the data in a temporary folder. Once the process is finished, it collects the data and returns it.

If raw=False, this function will return only lines that start with a number. Depending of what was the output, the result might make sense or not. It is safer to ask for the raw data as it allows you to collect all the output from spice and deal with it as convenient, depending on the application.

  • spice_file_contents – string formated as a spice-readable file contaning the design of the circuit and the instructions
  • engine – the spice engine.
  • raw – whether to produce the raw output or after some processing.

depending of the value of raw, this might be all the output of spice or just an array of data

solcore.spice.spice.get_raw_from_spice(spice_file_contents, engine=<class 'solcore.spice.spice.spice'>)[source]

Dummy function included for backwards compatibility with solcore3

solcore.spice.spice.send_to_spice(spice_file_contents, engine=<class 'solcore.spice.spice.spice'>)[source]

Dummy function included for backwards compatibility with solcore3