CENOS : Simulation Software : Induction Heating : Radio Frequency : Wireless Charging
  • Products
    • Radio Frequency
    • Induction Heating
    • Wireless Charging
    • Electromagnetic Stirring and Pumping of Liquid Metals
    • Busbar Heating
  • Resources
    • News and articles
    • Case studies
    • User stories
    • Academic stories
    • Testimonials
  • Documentation
  • Academic
  • About
  • Contact
  • Book a demo
  • Menu Menu

Parameter studies in Python

Study from the CENOS Python package solves a case again and again while it changes named parameters. It runs three kinds of study: a sweep to learn what a dimension does, a search that tunes the design for you, and a tolerance check before production. This page shows all three on a dual-band printed inverted-F antenna for 800 and 1700 MHz.

Before you start

You need cenos-py 0.3.4 or newer. Installation and the trace file are on the Python scripting page. Build and solve the case in the GUI first. A study can only change what the case exposes:

  • Geometry variables of a case built from a Python geometry script, or from a template. A case imported from STEP has no geometry variables.
  • Material properties, written as group.property, for example Solid_1.epsilon. The group is the material group name in the case.
NOTE! A study changes values, not topology. A variable that adds or removes a meander turn or a hole needs a separate case.

Current on the dual-band IFA at 1700 MHz over one RF period

How a study works

import numpy as np
import cenos_py
from cenos_py.tools.study import Study

case = cenos_py.CenosCaseRF()
case.open(r"C:\cases\dualband_ifa")

study = Study(case,
              {"high_len": (26.0, 22.0, 30.0)},       # name: (nominal, low, high)
              workspace=r"C:\studies\high_len")
  • Parameters: each name gets (nominal, low, high). The study checks that material names exist in the case and stops with a clear error if they do not.
  • Workspace: every solved design is stored there. Run the script again and solved designs are read back, not solved again, so a study that stops at solve 4 of 5 continues where it left off.
  • Capture: what is kept from each solve. The standard one for RF keeps frequency, S11, VSWR, resistance and reactance. Pass your own to keep more:
def capture(case):
    r = case.results
    return {"frequency": r.get_frequency(),
            "S11": r.get_s_parameter("S11"),
            "radiated": r.get_radiated_power()}

study = Study(case, {"high_len": (26.0, 22.0, 30.0)}, capture=capture, workspace=r"C:\studies\high_len")

Other members: study.defaults (nominal values), study.bounds, study.nominal (the nominal design, solved on first read) and study.evaluate({...}) (solve one design, or read it from the workspace).

Sweep

sweep takes a grid (every combination of the lists) or an explicit list of designs, and returns the solved designs. A measure turns each design into one number:

solved = study.sweep({"high_len": [22, 24, 26, 28, 30]})

def high_dip(run):
    """Frequency of the deepest S11 point between 1.4 and 2 GHz, refined with a parabola."""
    f, s11 = np.ravel(run["frequency"]), np.ravel(run["S11"])
    band = np.flatnonzero((f > 1.4e9) & (f < 2.0e9))
    i = band[np.argmin(s11[band])]
    a, b, c = np.polyfit(f[i - 1:i + 2], s11[i - 1:i + 2], 2)
    return -b / (2 * a)

dips = solved.metric(high_dip)          # one number per solved design
for values, dip in zip(solved.values, dips):
    print(values["high_len"], f"{dip / 1e6:.0f} MHz")

solved.values and solved.snapshots hold the inputs and the captured results; solved.plot(measure) draws a histogram. Five solves of about 14 minutes each gave: each extra millimetre of branch lowers the high band by about 46 MHz (1908 MHz at 22 mm, 1541 MHz at 30 mm), while the low band moves only 1.7 MHz/mm. So the two bands can be tuned one after the other.
S11 for five branch lengths from one Study.sweep call

NOTE! Results come on the solver’s frequency grid. A plain argmin jumps from grid point to grid point, and an optimizer then sees flat steps instead of a slope. Refine the dip with a parabola, as above.

Search

minimize searches for the design with the lowest cost. A cost is one number per design, zero when the design is right:

study = Study(case, {"high_len": (22.0, 18.0, 32.0)}, workspace=r"C:\studies\tune")

def cost(run):
    return abs(high_dip(run) - 1700e6) / 1700e6

solved = study.minimize(cost, max_solves=10)
print(solved.best, solved.cost, solved.converged)

From a poor start at 22 mm (1908 MHz) it found 26.1 mm, with the dip at 1698.9 MHz, in ten solves (about 2.3 h).
The search solve by solve: high-band dip and branch length against solve number, target 1700 plus or minus 5 MHz shaded
Ready-made costs from cenos_py.tools.rf:

Cost Zero when
resonance_error(f) the deepest S11 point sits at f (grid point, no refinement)
band_miss((f1, f2), level_db=-10) S11 stays under the level across the whole band
negative_bandwidth(level_db=-10) never; more negative means a wider matched band
  • The default method is Nelder-Mead, which needs no gradient: the mesh is rebuilt for every design, so a finite-difference gradient would measure mesh noise.
  • It stops at max_solves. Check converged before you trust the answer.
  • For another optimizer, drive the study yourself with study.evaluate and study.bounds.

Theory: how the search works

Nelder-Mead keeps n + 1 designs for n parameters (a simplex) and replaces the worst one by reflecting it through the others, stretching or shrinking the step as the cost improves or not. It needs no derivatives, which matters here: every design is meshed again, so a finite-difference gradient would mostly measure mesh noise. Its first steps are set by the parameter range, so parameters with very different effects per unit need scaling.

TIP! Sweep before you search, and keep searches to one or two parameters. With two lengths that move their bands at very different rates (the low-band length moves its band five to ten times less per mm), a search that tuned both bands at once only partly: after 12 solves the low band was still 49 MHz off. Scale the parameters, or tune one band at a time.

Tolerances and yield

solve_limits answers which tolerance matters, in 2n + 1 solves for n parameters: the nominal design, then each parameter at its low and its high limit.

study = Study(case, {
    "w":               (1.5, 1.4, 1.6),       # trace width, mm
    "board_t":         (1.6, 1.45, 1.75),     # board thickness, mm
    "Solid_1.epsilon": (4.4, 4.2, 4.6),       # FR4 permittivity
}, workspace=r"C:\studies\tolerance")

report = study.solve_limits(high_dip)         # 7 solves
print(report.ranked)                          # largest effect first
report.plot_sensitivity()

sigmas = {"w": 0.033, "board_t": 0.05, "Solid_1.epsilon": 0.067}   # limits taken as 3 sigma
print(report.sigma(sigmas))                                        # spread of the dip, Hz
f0 = high_dip(study.nominal)
print(report.yield_within(0.99 * f0, 1.01 * f0, sigmas))           # fraction within +-1 %
print(report.variance_contributions(sigmas))
report.plot(sigmas, low=0.99 * f0, high=1.01 * f0)

A second measure costs nothing: study.solve_limits(low_dip) reads the seven stored designs.

ToleranceReport member What it gives
ranked parameters, largest effect first
slopes, second_derivatives() the fitted model per parameter
parameters_without_effect() parameters whose low and high gave the same result: usually a misspelled name
sigma(sigmas) standard deviation of the measure
yield_within(low, high, sigmas) fraction of parts inside the limits
variance_contributions(sigmas) share of the spread from each parameter
plot(sigmas), plot_sensitivity() histogram and shift per limit

Theory: the tolerance model

From the three solves of each parameter (low, nominal, high, a step h from nominal) the report fits a slope and a curvature:

s = (f_high − f_low) / (2h)                  slope
q = (f_high − 2·f_nom + f_low) / (2h²)       curvature
f ≈ f_nom + Σ ( s·Δx + q·Δx² )
σ_f² = Σ ( s²·σ² + 2·q²·σ⁴ )

Each parameter is treated on its own: interactions between parameters are left out. The yield is the share of random parameter draws (thousands, from the model, no solves) that land inside your limits.
For the dual-band antenna, the high band moved about +20/−19 MHz with permittivity 4.2/4.6 and +20/−13 MHz with thickness 1.45/1.75 mm. With the limits as ±3σ, the dip spreads by about 10 MHz and about 93 % of boards land within ±1 %.
Shift of the high-band dip with each parameter at its limits
Spread of the high-band dip over 20,000 virtual boards with the plus and minus 1 percent limits

NOTE! The yield model fits each parameter on its own and leaves out interactions. If a parameter gives a lopsided result (a large shift one way, almost none the other), the effect may be close to what the mesh can resolve: solve those points again on a finer mesh before acting on it. For real random draws, use study.sample(sigmas, count), which solves every draw.

Examples

Runnable scripts are in the example library that comes with the installer (see Python scripting). To read more out of solved cases, see Antenna results in Python.

Print Friendly, PDF & Email

Pages

  • About
  • Academic & non–commercial
  • Academic use
  • Antenna placement simulation
  • BBH academic download
  • BBH download
  • BBH free trial
  • BBH request demo
  • BBH trial
  • Book a demo
  • Busbar Heating Simulation Software
  • Career
  • CENOS : simulation software for practical engineers in Europe and Americas
  • Contact
  • Documentation
  • Drone antenna simulation
  • Electromagnetic Stirring and Pumping of Liquid Metals Simulation Software
  • EMS academic download
  • EMS download
  • EMS free trial
  • EMS request demo
  • EMS trial
  • IH academic download
  • IH download
  • IH free trial
  • IH request demo
  • IH trial
  • Induction Heating
  • Induction Heating Simulation Software
  • Industrial & meter antenna simulation
  • IoT antenna simulation
  • Multiport antenna simulation
  • Parameter sweep antenna simulation
  • PCB & patch antenna simulation
  • PCB, patch antennas
  • Privacy & Data Policy
  • Products
  • Radio Frequency
  • Radio Frequency Simulation Software
  • Resources
  • RF academic download
  • RF download
  • RF free trial
  • RF request demo
  • RF trial
  • RFID & NFC antenna simulation
  • Slot, PIFA & IFA antenna simulation
  • Start free trial
  • Terms & Conditions
  • Testimonials
  • Thank you downloading for academic use
  • Thank you for booking product demo
  • Thank you for starting a free trial
  • WCH academic download
  • WCH download
  • WCH free trial
  • WCH request demo
  • WCH trial
  • Wearable & medical antenna simulation
  • Wireless Charging
  • Wireless Charging Simulation Software

Categories

  • Academic
  • Antenna Design
  • Busbar Heating
  • Case studies
  • Electromagnetic Stirring and Pumping
  • General news
  • Induction Heating
  • Radio Frequency
  • User testimonials
  • Wireless Charging

Archive

  • December 2026
  • September 2026
  • August 2026
  • July 2026
  • June 2026
  • May 2026
  • April 2026
  • March 2026
  • April 2025
  • January 2025
  • December 2024
  • November 2024
  • October 2024
  • September 2024
  • August 2024
  • June 2024
  • May 2024
  • April 2024
  • March 2024
  • December 2023
  • October 2023
  • August 2023
  • July 2023
  • June 2023
  • February 2023
  • December 2022
  • November 2022
  • June 2022
  • December 2021
  • October 2021
  • September 2021
  • August 2021
  • June 2021
  • May 2021
  • April 2021
  • March 2021
  • February 2021
  • December 2020
  • September 2020
  • July 2020
  • June 2020
  • May 2020
  • April 2020
  • February 2020
  • September 2019
  • August 2019
  • July 2019
  • June 2019
  • May 2019
  • March 2019
  • February 2019
  • October 2018
  • September 2018
  • June 2018
  • April 2018
  • October 2017

We are a software company on a mission to reshape the engineering process by providing engineers of all disciplines with truly accessible simulation tools for practical work.

caotica.ee veebidisain, kodulehe disain, veebi arendus, kodulehe arendus, kodulehe tegemine, wordpress arendus caotica.ee veebidisain, kodulehe disain, veebi arendus, kodulehe arendus, kodulehe tegemine, wordpress arendus

Products

Radio Frequency
Induction Heating
Wireless Charging
Electromagnetic Stirring, Melting and Pumping of Liquid Metals
Busbar Heating

Resources

Documentation
News and articles
Case studies
Testimonials
About
Career

Get in touch

info@cenos-platform.com

Americas

C. Héroe de Nacozari 25B-int V-2210, Centro, 76000 Santiago de Querétaro, Qro., Mexico.
(US) +1 614 705 0681

Europe

Lastadijas street 8-k-1, Riga, Latvia.
(EU) +371 27819253

Print Friendly, PDF & Email
© 2017–2026 CENOS™ SIA. All Rights Reserved. caotica.eu web design, web development, digital marketing, wordpress development caotica.eu web design, web development, wordpress development, digital marketing, online marketing
  • Privacy & Data Policy
  • Terms & Conditions
Scroll to top

This site uses cookies. By continuing to browse the site, you are agreeing to our use of cookies.

AcceptSettings

Cookie and Privacy Settings



How we use cookies

We may request cookies to be set on your device. We use cookies to let us know when you visit our websites, how you interact with us, to enrich your user experience, and to customize your relationship with our website.

Click on the different category headings to find out more. You can also change some of your preferences. Note that blocking some types of cookies may impact your experience on our websites and the services we are able to offer.

Essential Website Cookies

These cookies are strictly necessary to provide you with services available through our website and to use some of its features.

Because these cookies are strictly necessary to deliver the website, refusing them will have impact how our site functions. You always can block or delete cookies by changing your browser settings and force blocking all cookies on this website. But this will always prompt you to accept/refuse cookies when revisiting our site.

We fully respect if you want to refuse cookies but to avoid asking you again and again kindly allow us to store a cookie for that. You are free to opt out any time or opt in for other cookies to get a better experience. If you refuse cookies we will remove all set cookies in our domain.

We provide you with a list of stored cookies on your computer in our domain so you can check what we stored. Due to security reasons we are not able to show or modify cookies from other domains. You can check these in your browser security settings.

Other external services

We also use different external services like Google Webfonts, Google Maps, and external Video providers. Since these providers may collect personal data like your IP address we allow you to block them here. Please be aware that this might heavily reduce the functionality and appearance of our site. Changes will take effect once you reload the page.

Google Webfont Settings:

Google Map Settings:

Google reCaptcha Settings:

Vimeo and Youtube video embeds:

Privacy Policy

You can read about our cookies and privacy settings in detail on our Privacy Policy Page.

Privacy & Data Policy
Accept settings