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)
| 965 | return instr |
| 966 | |
| 967 | def _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 | |
| 996 | def _doDCsolve(instr): |
| 997 | """ |
no test coverage detected