Substitutes values for step parameters in *function* and returns a list of functions with these substitutions.
(stepDict, function)
| 1214 | return instr |
| 1215 | |
| 1216 | def _stepFunctions(stepDict, function): |
| 1217 | """ |
| 1218 | Substitutes values for step parameters in *function* and returns a list |
| 1219 | of functions with these substitutions. |
| 1220 | """ |
| 1221 | stepVars = list(stepDict.keys()) |
| 1222 | numSteps = len(stepDict[stepVars[0]]) |
| 1223 | functions = [] |
| 1224 | for i in range(numSteps): |
| 1225 | newFunction = function |
| 1226 | for j in range(len(stepVars)): |
| 1227 | newFunction = newFunction.xreplace({stepVars[j]: stepDict[stepVars[j]][i]}) |
| 1228 | newFunction = sp.sympify(str(sp.N(newFunction)), rational=True) |
| 1229 | functions.append(newFunction) |
| 1230 | return functions |
| 1231 | |
| 1232 | # Functions for converting the MNA matrix and the vecors with independent and |
| 1233 | # dependent variables into equivalent common-mode and differential-mode variables. |
no outgoing calls
no test coverage detected