MCPcopy Index your code
hub / github.com/SLiCAP/SLiCAP_python / _convertDCsolve

Function _convertDCsolve

SLiCAP/SLiCAPexecute.py:489–505  ·  view source on GitHub ↗

At the start of a dc variance analysis, the DC solution is calculated from the original (unconverted) network. This function coverts the results of this dc solve instruction to the desired conversion type.

(instr)

Source from the content-addressed store, hash-verified

487 return instr
488
489def _convertDCsolve(instr):
490 """
491 At the start of a dc variance analysis, the DC solution is calculated from
492 the original (unconverted) network. This function coverts the results of
493 this dc solve instruction to the desired conversion type.
494 """
495 if instr.convType != None:
496 if isinstance(instr.dcSolve, sp.Basic):
497 instr = _convertMatrices(instr)
498 instr.dcSolve = instr.A**(-1)*instr.dcSolve
499 if instr.convType == "dd" or instr.convType=="cd":
500 instr.dcSolve = sp.Matrix([instr.dcSolve[i] for i in range(len(instr.Dv))])
501 elif instr.convType == "dc" or instr.convType=="cc":
502 instr.dcSolve = sp.Matrix([instr.dcSolve[i - len(instr.Dv)] for i in range(len(instr.Dv))])
503 else:
504 print("The DC solution is not converted into CM or DM variables!")
505 return instr
506
507def _correctDMcurrentinstr(instr):
508 """

Callers 1

_doDCvarFunction · 0.85

Calls 1

_convertMatricesFunction · 0.85

Tested by

no test coverage detected