Returns the symbolic or numeric value of a parameter of an element. This function is called by _makeMatrices(). :parm elmt: element object :type elmt: SLiCAPprotos.element :param param: parameter of interest ('value', 'noise', 'dc' or 'dcvar') :type param: str :param
(elmt, param, numeric, parDefs, substitute)
| 44 | |
| 45 | |
| 46 | def _getValue(elmt, param, numeric, parDefs, substitute): |
| 47 | """ |
| 48 | Returns the symbolic or numeric value of a parameter of an element. |
| 49 | |
| 50 | This function is called by _makeMatrices(). |
| 51 | |
| 52 | :parm elmt: element object |
| 53 | :type elmt: SLiCAPprotos.element |
| 54 | |
| 55 | :param param: parameter of interest ('value', 'noise', 'dc' or 'dcvar') |
| 56 | :type param: str |
| 57 | |
| 58 | :param numeric: If True is uses full substitution and sympy.N for converting |
| 59 | parameters to sympy floats |
| 60 | :type numeric: bool |
| 61 | |
| 62 | :param parDefs: Dict with key value pairs: |
| 63 | |
| 64 | - key : parameter name (sympy.Symbol) |
| 65 | - value: numeric value of sympy expression |
| 66 | :type parDefs: dict |
| 67 | |
| 68 | :return: value: sympy expresssion or numeric value of the element parameter |
| 69 | :return type: sympy.Expr, int, float, sympy.Float |
| 70 | """ |
| 71 | try: |
| 72 | if param not in list(elmt.params.keys()): |
| 73 | value = None |
| 74 | except: |
| 75 | value = None |
| 76 | if param in list(elmt.params.keys()): |
| 77 | value = elmt.params[param] |
| 78 | if substitute == True: |
| 79 | value = float2rational(fullSubs(value, parDefs)) |
| 80 | if numeric == True: |
| 81 | value = float2rational(sp.N(value)) |
| 82 | return value |
| 83 | |
| 84 | |
| 85 | def _createDepVarIndex(circuitObject): |
no test coverage detected