Capacitance versus voltage simulation

[1]:
import os, sys
try:
    import pySIMsalabim as sim
except ImportError: # add parent directory to sys.path if pySIMsalabim is not installed
    sys.path.append('..')
    import pySIMsalabim as sim
from pySIMsalabim.experiments.CV import *

# Use the default input files shipped with the pySIMsalabim tests (pySIMsalabim/tests/sim_inputs/default):
# check that they match the SIMsalabim version and copy them into SIMsalabim/SimSS and SIMsalabim/ZimT
sys.path.append(os.path.join('..', 'pySIMsalabim', 'tests'))
from sim_inputs_setup import prepare_test_inputs, cleanup_test_inputs
prepare_test_inputs(convert=False)
Test inputs for SimSS: version matches SIMsalabim 5.37
Test inputs for ZimT: version matches SIMsalabim 5.37
Copying the SimSS test inputs to /home/lecorre/Desktop/pySIMsalabim/SIMsalabim/SimSS
Copying the ZimT test inputs to /home/lecorre/Desktop/pySIMsalabim/SIMsalabim/ZimT

Setup the simulation

[2]:
# Set the path to the simulation setup file
cwd = os.path.abspath('..')
session_path = os.path.join(cwd, 'SIMsalabim','ZimT')
zimt_device_parameters = os.path.join(session_path, 'simulation_setup_test.txt')

# Set the CV parameters
tVG_name = os.path.join(session_path,'tVG.txt')
freq = 1e4
V_min = -0.8
V_max = 1.2
V_step = 0.1
del_V = 0.01
G_frac = 0
# Run the CV simulation
ret, mess = run_CV_simu(zimt_device_parameters, session_path, freq, V_min, V_max, V_step ,G_frac, del_V, run_mode=False, tVG_name = tVG_name, output_file = 'CapVol.dat', tj_name = 'tj.dat')

Plot results

[3]:
plot_capacitance(session_path, output_file='CapVol.dat')
../_images/examples_CV_5_0.png
../_images/examples_CV_5_1.png
[4]:
# Clean up the output files (comment out if you want to keep the output files)
sim.clean_all_output(session_path)
sim.clean_up_output('CapVol',session_path)
sim.delete_folders('tmp',session_path)

# Remove the test input files copied into the SIMsalabim folder
cleanup_test_inputs()