Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vector fitting: Passivity assessment not always working correctly #702

Closed
Vinc0110 opened this issue Jun 12, 2022 · 1 comment · Fixed by #678
Closed

Vector fitting: Passivity assessment not always working correctly #702

Vinc0110 opened this issue Jun 12, 2022 · 1 comment · Fixed by #678
Assignees
Labels

Comments

@Vinc0110
Copy link
Collaborator

The passivity violations of vector fitted models returned by VectorFitting.passivity_test() are sometimes incomplete. Consequently, passivity enforcement fails for these models, as it's missing some frequency bands of passivity violation.

Example with the Coax 2-port from this post: #524 (comment)

import skrf
import numpy as np
import matplotlib.pyplot as mplt

nw = skrf.Network('/home/vinc/Downloads/Coax_test_v6_iter-0.s2p')
i_re = 1
i_cc = 5
freqs = np.linspace(0, 10e9, 1001)

vf = skrf.VectorFitting(nw)
vf.vector_fit(i_re, i_cc)

print('VF passive? {}'.format(vf.is_passive()))
violations = vf.passivity_test()
print('violations:\n{}'.format(violations))

fig, ax = mplt.subplots(1, 1)
vf.plot_s_singular(freqs=freqs, ax=ax)
y_min, y_max = ax.get_ylim()

for violation in violations:
    ax.plot([violation[0], violation[0]], [y_min, y_max], color='r')
    ax.plot([violation[1], violation[1]], [y_min, y_max], color='r')

ax.grid(True)
fig.tight_layout()
mplt.show()

Output:

VF passive? False
violations:
[[0.00000000e+00 8.65201086e+07]
 [3.30821054e+09 4.01429811e+09]]

singular_violations_incomplete

It clearly misses the violation of $\sigma_1$ starting from about 5 GHz.

@Vinc0110 Vinc0110 self-assigned this Jun 12, 2022
@Vinc0110 Vinc0110 added Bug Confirmed Bug VectorFitting labels Jun 12, 2022
@Vinc0110
Copy link
Collaborator Author

Vinc0110 commented Jun 12, 2022

The passivity assessment was filtering unbounded violation bands. This is now also fixed in PR #678. The enforcement routine had to be adapted accordingly, so I did not create a new PR for this issue (they are related).

New output for unbounded violations:

VF passive? False
violations:
[[0.00000000e+00 8.65201086e+07]
 [3.30821054e+09 4.01429811e+09]
 [4.93075857e+09            inf]]

singular_violations_complete

@Vinc0110 Vinc0110 linked a pull request Jun 12, 2022 that will close this issue
Vinc0110 added a commit that referenced this issue Jun 12, 2022
Vector Fitting: Bug fix for #677 and #702
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant