MCPcopy Create free account
hub / github.com/SLiCAP/SLiCAP_python / _doSolve

Function _doSolve

SLiCAP/SLiCAPexecute.py:967–994  ·  view source on GitHub ↗

Solves the network: calculates the Laplace transform of all dependent variables. :param instr: SLiCAP instruction object that holds instruction data. :type instr: SLiCAPinstruction.instruction :return: instr of the execution of the instruction. :rtype: SLiCAPinstruction.in

(instr)

Source from the content-addressed store, hash-verified

965 return instr
966
967def _doSolve(instr):
968 """
969 Solves the network: calculates the Laplace transform of all dependent
970 variables.
971
972 :param instr: SLiCAP instruction object that holds instruction data.
973 :type instr: SLiCAPinstruction.instruction
974
975 :return: instr of the execution of the instruction.
976 :rtype: SLiCAPinstruction.instruction
977 """
978 if instr.step:
979 if ini.step_function:
980 instr = _makeAllMatrices(instr, reduce=False)
981 sol = _doPySolve(instr).solve[0]
982 instr.solve = _stepFunctions(instr.stepDict, sol)
983 else:
984 stepVars = list(instr.stepDict.keys())
985 numSteps = len(instr.stepDict[stepVars[0]])
986 for i in range(numSteps):
987 for j in range(len(stepVars)):
988 instr.parDefs[stepVars[j]]=instr.stepDict[stepVars[j]][i]
989 instr = _makeAllMatrices(instr, reduce=False)
990 instr = _doPySolve(instr)
991 else:
992 instr = _makeAllMatrices(instr, reduce=False)
993 instr.solve = _doPySolve(instr).solve[0]
994 return instr
995
996def _doDCsolve(instr):
997 """

Callers 2

_doInstructionFunction · 0.85
_doTimeSolveFunction · 0.85

Calls 3

_makeAllMatricesFunction · 0.85
_doPySolveFunction · 0.85
_stepFunctionsFunction · 0.85

Tested by

no test coverage detected