SimulationSession guide¶
SimulationSession is the recommended entry point for library and CLI code.
It holds CellParameters, sweep specs, optional LTspice
overlays, and measured EIS data.
Quick start¶
from psc_sim import CellParameters, SimulationSession, SweepSpec
session = SimulationSession(CellParameters(Iph=0.03, Rs=1.0))
V, I, P = session.iv_curve()
isc = session.solve_i(0.0)
met = session.metrics()
Vb, SR = session.sr_vs_bias()
im, sr_inv = session.rs_extraction_series()
rs_hat = session.extract_rs_from_sr_inv(im, sr_inv)
f, zre, zim = session.eis_default_sweep()
Custom sweeps¶
Override per-call sweep limits (defaults come from iv_spec / sr_spec / rs_spec):
session.iv_curve(v_min=0.0, v_max=0.9, step=0.005)
session.sr_vs_bias(v_min=0.1, v_max=0.85, step=0.02)
Or set specs on the session (used by the GUI via session_bridge):
session.iv_spec = SweepSpec(-0.2, 1.0, 0.01)
result = session.iv_result()
LTspice and measured EIS¶
if session.ltspice_available("/path/to/XVIIx64.exe"):
session.run_ltspice_iv(ltspice_exe="/path/to/XVIIx64.exe")
assert session.lt_iv_result is not None
from psc_sim.eis_csv import load_eis_csv
from psc_sim.simulation.types import MeasuredEIS
freqs, zre, zim = load_eis_csv("measured.csv")
session.measured_eis = MeasuredEIS(freqs=freqs, zre=zre, zim=zim)
Legacy SolarCellModel¶
Removed in v3.0.0. Use SimulationSession (see migration guide).