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)
| 487 | return instr |
| 488 | |
| 489 | def _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 | |
| 507 | def _correctDMcurrentinstr(instr): |
| 508 | """ |
no test coverage detected