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

Antenna results in Python

A solved CENOS RF case holds more answers than the Results Viewer shows: the numbers behind every curve, the far field at any frequency, and enough to work out a link budget, a large array or a report. This page shows how to get them with the CENOS Python package, cenos-py, after the solve. For changing the design from Python (sweeps, tuning, tolerances), see Parameter studies in Python.

Before you start

You need cenos-py 0.3.4 or newer and a solved case. Installation, the trace file and the recommended way of working are on the Python scripting page. Every example below starts like this:

import numpy as np
import cenos_py

case = cenos_py.CenosCaseRF()
case.open(r"C:\cases\dualband_ifa")      # a case you solved in the GUI

The examples use cases from our application pages: a dual-band printed inverted-F antenna for 800 and 1700 MHz, a UHF RFID label and a 2.45 GHz patch antenna.
Dual-band printed IFA, current at 800 and 1700 MHz

Port results

Everything the Results Viewer shows for a port is in case.results, as one value per solved frequency. Wrap them in np.ravel to get plain numpy arrays.

Function Returns Unit
get_frequency() solved frequencies Hz
get_s_parameter("S11") S-parameter magnitude, S11 to S44 dB
get_s_parameter_phase("S21") S-parameter phase deg
get_s_parameter_active(port) active reflection of a port, all ports on (arrays) dB
get_impedance(port) input impedance Ω
get_resistance(port), get_reactance(port) real and imaginary part Ω
get_reflection_coefficient(port), get_VSWR(port) match –
get_accepted_power(port), get_radiated_power(port) power into the port, power radiated W
get_dielectric_losses(entity, port) loss in a dielectric body, or “Total” W
get_lumped_element_losses(element, port) loss in a lumped element W
get_power_imbalance(port) power balance check –

Each function has a docstring with its unit, so your editor shows it while you type.

r = case.results
f = np.ravel(r.get_frequency())
s11 = np.ravel(r.get_s_parameter("S11"))
accepted = np.ravel(r.get_accepted_power())
radiated = np.ravel(r.get_radiated_power())
fr4 = np.ravel(r.get_dielectric_losses("Total"))

i = np.argmin(s11)
print(f"dip {f[i] / 1e6:.0f} MHz, {s11[i]:.1f} dB")
print(f"radiated {radiated[i] / accepted[i]:.0%}, in the board {fr4[i] / accepted[i]:.1%}")

matched = f[s11 <= -10]                    # -10 dB band (one band only)
print(f"-10 dB from {matched.min() / 1e6:.0f} to {matched.max() / 1e6:.0f} MHz")

For the dual-band antenna this gives:

Band S11 dip −10 dB band Radiated / accepted
Low 797 MHz, −22.1 dB 783–811 MHz 80 %
High 1705 MHz, −32.9 dB 1655–1754 MHz 85 %

S11 of the dual-band antenna read with case.results, bands below -10 dB shaded

NOTE! Results come on the frequency grid of the solve, here about 7 MHz apart. If one number matters, narrow the frequency range or fit a parabola through the three points around the dip. A dual-band response has two dips: search each band separately.

Conductor losses are not in case.results yet. You can read every stored result, including “Conductor losses (port 1)”, by name with the report helper below (available_results()).

Theory: from impedance to efficiency

With the port impedance Z and the reference Z0 (50 Ω):

Γ    = (Z − Z0) / (Z + Z0)            reflection coefficient
S11  = 20 · log10 |Γ|                  in dB
VSWR = (1 + |Γ|) / (1 − |Γ|)
radiation efficiency  η_rad = P_radiated / P_accepted
total efficiency      η_tot = η_rad · (1 − |Γ|²)

−10 dB means 10 % of the power is reflected; −20 dB means 1 %. The accepted power is what is left after the reflection; the losses in the board, the metal and lumped elements take it from there to the radiated power.

Far field

FarField reads the radiation pattern at one frequency. If the case does not hold a far field at that frequency yet, it is calculated from the solved fields on first use, without a new solve.

from cenos_py.tools.rf import FarField

ff = FarField(case, 1700e6)
print(ff.peak_gain, ff.peak_directivity)       # dBi, dB
s11 = np.interp(1700e6, np.ravel(case.results.get_frequency()),
                np.ravel(case.results.get_s_parameter("S11")))      # dB at the port
print(ff.peak_gain + 10 * np.log10(1 - 10 ** (s11 / 10)))         # realized gain, dBi

angles, gain = ff.cut("ZX")                    # principal cut, degrees and dBi
ff.plot("XY", quantity="directivity")          # polar plot with matplotlib

theta, phi, g = ff.sphere("gain")              # the whole sphere, shape (theta, phi)
beam = ff.beam()                               # main beam and largest side lobe
print(beam.beam_angle, beam.beam_gain, beam.lobe_level)
Member What it gives
peak_gain, peak_directivity peak values over the sphere, dBi and dB
cut(plane, quantity) a principal-plane cut: “XY”, “ZX” or “YZ”; quantity “gain” or “directivity”
plot(plane, quantity, ax) the same cut as a polar plot
sphere(quantity) theta, phi in degrees and the values on the full sphere
beam(quantity, front_only) a BeamPattern: beam direction and gain, largest side lobe and its level

For the dual-band antenna, realized gain: 1.4 dBi at 800 MHz and 3.6 dBi at 1700 MHz. It is well matched, so this is within 0.1 dB of the gain.

Theory: directivity, gain and realized gain

directivity  D = 4π · U_max / P_radiated
gain         G = η_rad · D           (per accepted power)
realized     G_r = G · (1 − |Γ|²)    (per power offered to the port)

Directivity says how focused the pattern is. Gain also counts the losses in the antenna; realized gain also counts the mismatch. A lossy FR4 board can make gain several dB lower than directivity.
Realized gain in the XZ, YZ and XY planes at 800 and 1700 MHz, 0 degrees = +z in XZ and YZ

NOTE! Gain and efficiency are only as good as the air box. For quoted numbers below 1 GHz, set the air padding to at least half a wavelength; the automatic padding can read the far field a few percent high.

Link budget and read range

Antenna and RFSystem turn a solved antenna into a radio link: received power, field strength and range. Free space only: no walls, ground or multipath.

Antennas

from cenos_py.tools.rf import Antenna, RFSystem, chip_impedance

tag = Antenna.from_case(case)                               # gain and impedance from a solved case
reader = Antenna(gain_dbi=6.0, impedance=50)                # from a datasheet
module = Antenna.from_touchstone("measured.s1p", gain_dbi=2.0)   # measured impedance + a gain

Theory: the link budget

RFSystem uses the Friis equation with a mismatch term at each end:

P_rx = P_tx + M_tx + G_tx + G_rx + M_rx + 20·log10(λ / (4π d)) − L      all in dB
range: d = λ/(4π) · 10^((P_tx + M_tx + G_tx + G_rx + M_rx − L − S) / 20)
load match: τ = 4 · R_ant · R_load / |Z_ant + Z_load|²,   M = 10·log10 τ

For a passive RFID tag the reader also has to hear the reply. That round trip counts the gains twice, so the backscatter range falls off with the fourth root of the budget (Nikitin and Rao, IEEE AP Magazine, 2006). calculate_range returns the shorter of the two when you give return_sensitivity_dbm. The tag chip is the receiver load, not 50 Ω: use chip_impedance(f, R, C) for a parallel R and C.

Range

The example is the UHF RAIN label from our RFID page. The tag is matched to its chip, so the chip is the receiver load: 1.5 kΩ in parallel with 1.2 pF.

f = 866e6
link = RFSystem(reader, tag, frequency=f, receiver_load=chip_impedance(f, 1500, 1.2e-12))
r = link.calculate_range(transmit_power_dbm=29.2,        # 2 W ERP with the 6 dBi reader antenna
                         receiver_sensitivity_dbm=-20,   # chip sensitivity
                         additional_loss_db=3)           # circular reader antenna, linear tag
print(f"{r:.1f} m")                                      # 12.3 m
Method What it gives
calculate_range(...) the largest distance where the link works, in m. With return_sensitivity_dbm it also works out the backscatter (reader) link and returns the shorter of the two
calculate_received_power(distance, ...) power into the receiver load, dBm, for one distance or an array
calculate_electric_field(distance, ...) incident field strength, V/m
link_budget(distance, ...) every term and margin at one distance; .table() prints it
calculate_range_vs_angle(plane, ...) range for each angle in one plane, from the solved pattern
calculate_range_over_band(...) range at each frequency of a band; .worst_range, .worst_frequency and which link limits it
from cenos_py.tools.rf import calculate_range_over_band

band = calculate_range_over_band(reader, tag, np.arange(902e6, 928.1e6, 2e6),
                                 transmit_power_dbm=29.2, receiver_sensitivity_dbm=-20,
                                 receiver_load=lambda f: chip_impedance(f, 1500, 1.2e-12),
                                 additional_loss_db=3)
print(band.worst_range, band.worst_frequency)

print(link.link_budget(5.0, transmit_power_dbm=29.2, receiver_sensitivity_dbm=-20).table())

The label reads about 12 m in the European band and 9.6–10.8 m in the US band, where it is tuned less well.
Read range of the label over frequency from RFSystem

Large arrays from one unit cell

A 64-element array is too big to solve element by element on a desktop. When all elements are the same, CENOS solves one unit cell with periodic boundaries, so the cell sees its neighbours. Set this up on the Periodic array tab in the GUI, or from Python:

case.update_tab_property("periodicArrayTab", "periodicArray", True)
case.update_tab_property("periodicArrayTab", "continuousBase", True)      # one large board
case.update_tab_property("periodicArrayTab", "elementsInFirstDirection", 8)
case.update_tab_property("periodicArrayTab", "secondDirection", True)
case.update_tab_property("periodicArrayTab", "elementsInSecondDirection", 8)
case.calculate()

ArrayBeamExplorer then builds the finite array from the solved cell. Steering and tapers are post-processing: each new beam takes seconds.

from cenos_py.tools.rf import ArrayBeamExplorer, FarField, Taper, make_taper

explorer = ArrayBeamExplorer(case)
explorer.steer(2.378e9, theta_deg=30, phi_deg=0)
beam = explorer.measure()                        # BeamPattern of the last beam
print(beam.beam_angle, beam.beam_gain, beam.lobe_level)

taylor = make_taper(explorer.elements, Taper.TAYLOR, sidelobe_level_db=-30)
explorer.steer(2.378e9, theta_deg=30, phi_deg=0, amplitudes=taylor)
explorer.plot("ZX", quantity="gain")

array_ff = FarField(case, 2.378e9, array=True)   # the finite array result, not the unit cell
Member What it does
steer(f, theta_deg, phi_deg, amplitudes) beam toward a direction
calculate_far_field(f, phase_first_deg, phase_second_deg, amplitudes) beam from progressive phase steps
steer_scan(f, thetas_deg, phi_deg), scan(...) many beams at once, with beam and side-lobe data per setting
measure() main beam and largest side lobe of the last beam
plot(plane, quantity) polar cut of the array
grating_lobe_free_angle(f, pitch_m) largest steer angle without a grating lobe
element_counts=(nx, ny) try other array sizes from the same cell
make_taper(shape, Taper.X) amplitudes: UNIFORM, HANN, HAMMING, BLACKMAN, TAYLOR, CHEBYSHEV

The 8 × 8 array of probe-fed 2.45 GHz patches has 18.3 dBi realized gain straight up (22.7 dB directivity; the FR4 board takes most of the difference). Steered to 30° the beam lands at 29° with 17.6 dBi; a Taylor taper lowers the side lobes for another 1.4 dB. The realized gain is the array gain plus the mismatch of the cell’s active S11 (−19.2 dB, so −0.05 dB). Inside the array the neighbours pull the cell’s best match from 2446 to 2378 MHz, which is why an array element is tuned in its array.
Realized gain of an 8 x 8 array from one unit cell in the XZ plane, steered and tapered

NOTE! ArrayBeamExplorer needs a solved single-port periodic unit-cell case. It does not work on a case with several separate elements.

Theory: steering and grating lobes

phase step between neighbours   Δφ = 360° · (d / λ) · sin θ0
no grating lobe while          sin θ0 ≤ λ / d − 1
directivity of N elements      ≈ element directivity + 10·log10 N

d is the element pitch and θ0 the steer angle. At half-wavelength pitch the beam can be steered to 90° without a grating lobe; at 0.7 λ only to about 25°. A taper lowers the side lobes and costs some directivity, because the outer elements do less work.

PDF reports

CENOS has its own case report. When you want your own sections in your own order, or one report for each of twenty variants, CenosPDFReport builds the PDF from a script:

from cenos_py.pdf_report import CenosPDFReport

report = CenosPDFReport("Dual-band IFA, 800 / 1700 MHz", case=case)
print(report.available_results())                      # every stored result, with its unit

report.insert_heading("Summary")
report.insert_paragraph("Both bands are matched below <b>-10 dB</b>.")
report.add_result_plot(["S11"], limit=-10, limit_label="-10 dB")
report.add_result_plot(["Resistance (port 1)", "Reactance (port 1)"], title="Input impedance")
report.add_results_table(["S11", "VSWR (port 1)"])     # min and max, and where
report.insert_figure(my_figure, caption="Gain cuts")    # any matplotlib figure or image file
report.save("dualband_ifa.pdf")
Method Adds
insert_heading, insert_paragraph text; paragraphs accept <b>, <i>, <br/>
insert_table(rows) a table from a list of rows
insert_figure(source) an image file or a matplotlib figure
add_plot(x, y, ...) your own line plot in the report style
add_result_plot(names, limit) a stored result against frequency
add_table(names), add_results_table(names) solved values per step, or their min and max
insert_space, insert_page_break layout

Page 1 of a PDF report written by CenosPDFReport

Examples

The example library that comes with the installer (see Python scripting) has runnable scripts for these tools. To change the design from Python, continue with Parameter studies 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