User guide · 2.0 development

Getting Started

First, import the SHOTpy module and create a solver. A problem is then created with SHOTpy.Problem(solver), which uses the settings of the solver, e.g., when finalize() rewrites the model. SHOTpy.Problem(solver.getEnvironment()) is the same.

import math
import os
import sys

# Add current directory to Python path to find SHOTpy module
sys.path.insert(0, os.path.dirname(os.path.abspath('__file__')) if '__file__' in dir() else os.getcwd())

import SHOTpy

# Create a SHOT solver
solver = SHOTpy.Solver()
print("SHOT solver created successfully!")