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

Function _doTimeSolve

SLiCAP/SLiCAPexecute.py:1037–1063  ·  view source on GitHub ↗

Calculates the time-domain solution of the circuit. The instr will be stored in the .timeSolve attribute of the instr object. :param instr: SLiCAP instruction object that holds instruction data. :type instr: SLiCAPinstruction.instruction :return: instr of the execution of the

(instr)

Source from the content-addressed store, hash-verified

1035 return instr
1036
1037def _doTimeSolve(instr):
1038 """
1039 Calculates the time-domain solution of the circuit.
1040
1041 The instr will be stored in the .timeSolve attribute of the instr object.
1042
1043 :param instr: SLiCAP instruction object that holds instruction data.
1044 :type instr: SLiCAPinstruction.instruction
1045
1046 :return: instr of the execution of the instruction.
1047 :rtype: SLiCAPinstruction.instruction
1048 """
1049 instr = _doSolve(instr)
1050 if instr.step:
1051 for solution in instr.solve:
1052 timeSolution = sp.zeros(len(solution), 1)
1053 for i in range(len(solution)):
1054 laplaceinstr = solution[i]
1055 timeSolution[i] = ilt(laplaceinstr, ini.laplace, sp.Symbol('t'))
1056 instr.timeSolve.append(timeSolution)
1057 else:
1058 timeSolution = sp.zeros(len(instr.solve), 1)
1059 for i in range(len(instr.solve)):
1060 laplaceinstr = instr.solve[i]
1061 timeSolution[i] = ilt(laplaceinstr, ini.laplace, sp.Symbol('t'))
1062 instr.timeSolve = timeSolution
1063 return instr
1064
1065def _doMatrix(instr):
1066 """

Callers 1

_doInstructionFunction · 0.85

Calls 2

iltFunction · 0.90
_doSolveFunction · 0.85

Tested by

no test coverage detected