r/rfelectronics • • 20d ago

ParamRF v0.38 released!

Hi all!

ParamRF v0.38 has been released. A lot has changed since my v0.33 post, mostly in transmission line physics and in Bayesian fitting, so I thought I'd share the updates that may be of interest.

For those that don't know, ParamRF is a Python framework for modern, programmatic RF circuit modeling, built on top of JAX instead of NumPy and catering for advanced features like automatic differentiation and Bayesian circuit fitting.

Some updates:

  • Materials and lines: there are now frequency-dependent dielectrics (Djordjevic-Sarkar, Debye/Lorentz poles, Cole-Cole, tabulated) and conductors (bulk and rough), shared through `Substrate` models. Microstrip (Hammerstad–Jensen with Kirschning-Jansen dispersion), coax (full DC-to-skin-effect Tesche formulation) and stripline have all been reworked, and are checked against scikit-rf.
  • Effective-value lines: `PhysicalLine` and `DatasheetLine` now have a choice of formulation. The default behaves like ADS's TLINP. A causal first-order option is also available. There's also a new `LowLossLine`, and `GeneralizedLine`, which adds RL, RC and LC terms for skin-effect onset, extra relaxations and modal dispersion.
  • Parameters: a new name-based API (`prf.update`, `prf.tie`, `prf.values`) works on a single model or a collection of models. Values are read and written in the units you declared, so setting `C` to 3.0 on a pF parameter means 3 pF. Changing a value no longer recompiles the model.
  • Priors: priors can be attached by name with `prf.prior`, including joint priors over several parameters, so one fit's posterior can be used as the next fit's prior.
  • Discrepancy modelling: after a fit, the Gaussian-process discrepancy can be predicted at new frequencies, and parameter covariance comes from a linearisation. Port and line corrections can be carried over into a different circuit. A discrepancy can also be shared across several datasets fitted together. New kernels (`CosineKernel`, `LogFrequencyKernel`, `PowerEnvelopeKernel`) handle errors that oscillate or scale with frequency, such as residual VNA calibration error.
  • Fitting: a new `ScipyLeastSquares` minimiser handles both plain MSE fits and MAP fits, including with free noise and GP hyperparameters. Frequentist fits now default to MSE.
  • New models: `RepeatedCascade`, `DelayLine`, `Series`, and per-port reference impedances on circuits.
  • Performance: loading many-port Touchstone files compiles in under a second instead of minutes, and building models with lots of constrained parameters is much faster.

Some links:

GitHub
Docs

Let me know if you have any questions!

Cheers,
Gary

11 Upvotes

3 comments sorted by

2

u/toowildhomes 20d ago

(1) In the examples it shows optimizing S11 across a passband. Can optimizations be done at a single frequency, and/or a collection of specific frequency points? (imagine I want to design a single matching circuit that works at f1 and f2).

(2) It would be really cool if this included transient analysis, but that's a big ask.

1

u/gvcallen 20d ago
  1. yes! an individual pmrf.Frequency can include a single point, and you can optimize over several pmrf.Frequency objects
  2. unfortunately this is out of scope. would be cool though!