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

Function _zeroValue

SLiCAP/SLiCAPmath.py:383–411  ·  view source on GitHub ↗

Returns the zero frequency (s=0) value of numer/denom. :param numer: Numerator of a rational function of the Laplace variable :type numer: sympy.Expr :param denom: Denominator of a rational function of the Laplace variable :type denom: sympy.Expr :return: zero freq

(numer, denom, var)

Source from the content-addressed store, hash-verified

381 return (newPoles, newZeros)
382
383def _zeroValue(numer, denom, var):
384 """
385 Returns the zero frequency (s=0) value of numer/denom.
386
387 :param numer: Numerator of a rational function of the Laplace variable
388 :type numer: sympy.Expr
389
390 :param denom: Denominator of a rational function of the Laplace variable
391 :type denom: sympy.Expr
392
393 :return: zero frequency (s=0) value of numer/denom.
394 :rtype: sympy.Expr
395 """
396 # numer = sp.simplify(numer)
397 # denom = sp.simplify(denom)
398 numerValue = numer.xreplace({var: 0})
399 denomValue = denom.xreplace({var: 0})
400 if numerValue == 0 and denomValue == 0:
401 try:
402 gain = sp.limit(numer/denom, var, 0)
403 except:
404 gain = sp.sympify("undefined")
405 elif numerValue == 0:
406 gain = sp.N(0)
407 elif denomValue == 0:
408 gain = sp.oo
409 else:
410 gain = sp.simplify(numerValue/denomValue)
411 return gain
412
413def findServoBandwidth(loopgainRational):
414 """

Callers 1

_doPZFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected