RF PCB toolbox analysis inconsistency.

Hi,
I've been developing an application using the RF PCB Toolbox for quite some time. Essentially, the application creates a microstrip resonator based on parameters provided by the user and then analyzes its scattering parameters using the Method of Moments (MOM) algorithm. However, my results vary depending on the frequency range of the analysis. The resonator's frequency response changes in completely unrelated ways, and I can't figure out why this is happening. My code is intentionally kept simple, without any custom mesh settings or advanced solver configurations.
function SingleLoadedAnalyzeButtonPushed(app, event)
app.FBegin = (app.FBeginField.Value)*1e9;
app.FEnd = (app.FEndField.Value)*1e9;
app.FPoints = (app.FPointsField.Value);
fsweep = linspace(app.FBegin,app.FEnd,app.FPoints);
if app.InterpOptionCheck.Value == 1
interpOption = "interp";
else
interpOption = "direct";
end
spar = sparameters(app.singleResonator,fsweep,...
"SweepOption",interpOption);
rfplot(app.EMResponsePlot,spar);
end
Has anyone experienced similar issues with RF PCB Toolbox for microstrip resonators?

3 Comments

Hi @Nuri,

Looking at your plots, the shifting resonant frequency and changing response characteristics as you extend from 3 GHz to 4 GHz indicates a mesh resolution problem with the Method of Moments solver. Here's what's happening in simple terms: electromagnetic waves get shorter at higher frequencies, and if the solver's mesh (think of it like a grid that divides your PCB into small pieces for calculation) isn't fine enough, it can't accurately represent the electromagnetic behavior - it's like trying to draw detailed curves with building blocks that are too big. The RF PCB Toolbox uses method of moments to mesh the PCB surface into triangles for computing the full-wave solution, and the automatic meshing may not maintain consistent accuracy across your extended frequency range.

Try these fixes in order:

1. Force a finer mesh before analysis: mesh(app.singleResonator, 'MaxEdgeLength', 0.3);

2. Use consistent frequency steps: fstep = 10e6; fsweep = app.FBegin:fstep:app.FEnd; instead of fixed point counts

3. Stick with "direct" mode rather than "interp" to avoid interpolation artifacts

To verify if it worked: Run your original 1-3 GHz analysis, then run 1-4 GHz with the fixes - the resonant peak should appear at the same frequency in both cases. If the mesh fix doesn't help, try analyzing just a narrow range around your resonance (like 1.8-2.2 GHz) to isolate whether this is specifically a high-frequency meshing issue or something else entirely.

References:

Nuri
Nuri on 25 Sep 2025
Edited: Nuri on 25 Sep 2025
Hi @Umar
A mesh() function call with appropriate an "MinEdgeLength" value resolved the issue. Meshing with approximately 1200 triangular elements seems to be a good compromise betwen simulation time and accuracy for my problem configuration. Although I understand the importance of the mesh() function, I still cannot grasp the difference between the "interp" and "interpwithgrad" modes.
Thank you.

Hi @Nuri,

Thank you for your follow-up question regarding the SweepOption parameters in the RF PCB Toolbox sparameters function. I'm pleased to hear that implementing proper meshing with MinEdgeLength resolved your frequency-dependent analysis issues.

Regarding your question about the difference between "interp" and "interpwithgrad" modes, let me provide a technical explanation based on the MathWorks documentation and underlying computational methods:

”interp" Mode: This mode uses standard rational interpolation techniques to estimate S-parameters at frequencies between computed points. The solver calculates S-parameters at a subset of your specified frequency points and then uses mathematical interpolation to fill in the remaining values. This approach is computationally efficient but relies purely on the magnitude and phase information from the calculated points.

"interpwithgrad" Mode: This enhanced interpolation mode incorporates gradient information (derivatives) in addition to the standard interpolation approach. By considering how the S-parameters change with respect to frequency (the gradient or slope), this method can provide more accurate interpolations, particularly in regions where the frequency response exhibits rapid changes or sharp resonances—exactly the type of behavior you encounter with microstrip resonators.

Practical Implications for Your Application: Given that you're analyzing microstrip resonators, which typically exhibit sharp resonant peaks with high Q-factors, "interpwithgrad" would theoretically provide superior accuracy around these critical frequency regions. The gradient information helps the interpolation algorithm better understand the curvature and sharp transitions near resonances, leading to more faithful representation of the true electromagnetic response.

However, this enhanced accuracy comes with increased computational overhead, as the solver must compute not only the S-parameters but also their frequency derivatives at the sample points.

Recommendation: For your microstrip resonator analysis, particularly given that you've now established proper meshing practices, I would suggest comparing both interpolation modes with a reference "direct" calculation over a narrow frequency band around your resonance. This will help you determine whether the additional computational cost of "interpwithgrad" provides meaningful improvement in accuracy for your specific geometry and frequency ranges.

The choice between these modes often depends on the trade-off between computational efficiency and the required accuracy for your particular application. Since you've already achieved good results with proper meshing, the interpolation method may have less impact on your overall solution quality.

This response is based on MathWorks RF PCB Toolbox documentation and established electromagnetic simulation principles. For the most current implementation details, please refer to the official MathWorks documentation at _ https://www.mathworks.com/help/rfpcb/ _

Sign in to comment.

Answers (0)

Categories

Products

Release

R2025a

Asked:

on 24 Sep 2025

Commented:

on 25 Sep 2025

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!