skrf.mathFunctions.find_correct_sign

skrf.mathFunctions.find_correct_sign(z1, z2, z_approx)[source]

Create new vector from z1, z2 choosing elements with sign matching z_approx.

This is used when you have to make a root choice on a complex number. and you know the approximate value of the root.

\[z1,z2 = \pm \sqrt(z^2)\]
Parameters:
  • z1 (array-like) – root 1

  • z2 (array-like) – root 2

  • z_approx (array-like) – approximate answer of z

Returns:

z3 – array built from z1 and z2 by z1 where sign(z1) == sign(z_approx), z2 else

Return type:

np.array