Skip to main content

Altair PSIM Python APIs

A Python package for Altair PSIM Python APIs and commands

Key Features of psimapipy

This package allows you to automate workflows that would otherwise require manual interaction with the PSIM GUI:

  • Simulation Control: Start, pause, and stop simulations.
  • Parameter Tuning: Modify component values (like resistance or capacitance) before running a simulation.
  • Data Extraction: Load .smv or .txt simulation results directly into Python (often as NumPy arrays or Pandas DataFrames).
  • Batch Processing: Run hundreds of simulation iterations with different variables for sensitivity analysis.

Following functions are implemented:

psimapipy/psimapipy.py
#------ PSIM 2023.1:
# get_psim_version
#
# PsimSimulate
# PsimSimulate_HyperSpice
# PsimSimulate_LTSpice

# PsimASimulate

# PsimReadGraphFile
# PsimWriteGraphFile

# PsimFileOpen
# PsimFileSave
# PsimFileNew

# PsimIsSubcircuit

# PsimGetElementList
# PsimSetElmValue
# PsimSetElmValue2
# PsimEnableElm
# PsimEnableElm2
# PsimCreateNewElement

# RunSimview

#------ PSIM 2024:
# PsimConvertToPython
# PsimEnableElm3
# PsimSetElmValue3

#------ PSIM 2025.0:
# Psim_DS_UpdateParameters
# Psim_DS_GetParameters
# Psim_DS_RunScript
#
# Psim_GetUndefinedParameters


#------ PSIM 2026.0:
# Psim_GetProbes
# Psim_RunScriptFile
# Psim_RunScript
# Psim_RunScriptInfo
#
# get_psim_version
# get_psim_version_name

Example: Getting PSIM Version

psimapipy/psimapipy.py
import Psim_Class

# 1. Initialize the PSIM object
# If you leave PsimPath empty, it will attempt to find the path in the Windows registry
psim = Psim_Class.PSIM(PsimPath="")

# 2. Access the version components stored in the object
# The constructor automatically populates these values
major = psim.m_nVersion
minor = psim.m_nSubVersion
patch = psim.m_nSubSubVersion
build = psim.m_nSubSubSubVersion

# 3. Print the formatted version
print(f"PSIM Version: {major}.{minor}.{patch}.{build}")

# 4. Access the 'Vertical' version (e.g., 564 for GUI, 864 for Solver)
print(f"Vertical ID: {psim.m_nVertical}")