Qucs / qucsator

Circuit simulator of the Qucs project
http://qucs.sourceforge.net
GNU General Public License v2.0
23 stars 10 forks source link

Frequency dispersion of impedance and dielectric constant is not used to compute the losses of microstripline #34

Open mhuser opened 2 years ago

mhuser commented 2 years ago

While the frequency dispersion of impedance and dielectric constant of the microstripline are computed, they are not used to compute the losses. https://github.com/Qucs/qucsator/blob/22126bb9efe0f3d91d2c772cebde3f7ff1b619ef/src/components/microstrip/msline.cpp#L75-L80 However they are properly used to compute gamma. https://github.com/Qucs/qucsator/blob/22126bb9efe0f3d91d2c772cebde3f7ff1b619ef/src/components/microstrip/msline.cpp#L82-L86 The original paper of Hammerstad and Jensen is ambiguous about this, as it used the same variable names for these values with or without dispersion. On the other hand, it sounds strange to use the quasi-static constant value for losses and a frequency-dependant value for gamma. This eventually cause Qucs to have a small difference in simulated insertion loss if compared against Keysight ADS (using frequency invariant dielectric and kirschning models, but the loss computation is Hammerstad and Jensen).

felix-salfelder commented 2 years ago

Thanks for reporting this.

On Tue, May 10, 2022 at 10:42:10AM -0700, mhuser wrote:

While the frequency dispersion of impedance and dielectric constant of the microstripline are computed, they are not used to compute the losses.

I think you best bet is so send a patch. It does sound like an oversight in the current model.

This eventually cause Qucs to have a small difference in simulated insertion loss if compared against Keysight ADS (using frequency invariant dielectric and kirschning models).

Will the difference completely disappear with your changes? This would be a strong point -- perhaps there is no need to keep a wrong version.

mhuser commented 2 years ago

You are welcome. I will prepare some plots to illustrate the behaviour with/without the proposed modification compared to an ADS generated s-parameter file.

mhuser commented 2 years ago

First let me introduce the context: I am contributing to scikit-rf a Python package that provide standard microwave network operations, such as reading/writing Touchstone files (.sNp files), connecting or de-embedding N-port networks, .... and advanced operations such as communication with Vector Network Analyzer (VNA) amongst other things that are interesting to automate in scripts without a graphical interface.

Of course, we are not rewriting this great tool that is QUCS in Python, instead we are using it to build networks out of its extensive component library and process later with the resulting s-parameters files.

At a point, it appeared it was useful to implement the msline model into the package to use Python optimizations to fit microstripline models on measurement, e.g. to determine relative permittivity of substrates. We inspired highly of qucsator qucs msline implementation because it is open and the equations are very-well documented.

We checked that our implementation follows qucsator, but during the process we had a chance to compare to ads mlin which is a closed commercial solution. We noticed a discrepancy in the insertion loss results and after looking at it, using the frequency-dispersed values for the loss computation significantly enhance the agreement. The original paper use the same variables names for quasi-static or frequency-dispersed values so there is an ambiguity, but it make sense to use frequency-dependant values here (they are used for propagation, which will also embed the losses).

qucs_vs_ads

image

mhuser commented 2 years ago

This is our issue for reference: https://github.com/scikit-rf/scikit-rf/issues/647

There is also a difference between QUCS and ADS on the Return Loss. But ADS implementation is questionable there as they use a complex permittivity (ep_r - 1j ep_r * tand), which lead to characteristic of the line having a complex value. I think this is done to use their dielectric frequency-dispersion model (Svensson/Djordjecic wideband Debye) implementation.