Skip to main content

ScatSol

License: GPL v3 Docs

ScatSol computes time-harmonic electromagnetic scattering from concentric cylindrical and spherical regions. It returns complex electric and magnetic fields at user-specified points.

The cylindrical solver supports TM and TE plane-wave incidence, layered materials, and a perfect electric conductor (PEC) core. The spherical solver uses both electric and magnetic multipole channels for an x-polarized plane wave. Materials can have real or complex relative permittivity and permeability.

Install

Clone the repository, then install its dependencies with uv:

uv sync

Quick start: cylinder

This example solves TM scattering from a dielectric cylinder in vacuum. Lengths are in meters and frequency is in hertz.

import numpy as np

from scatsol import (
    CylindricalGeometry,
    CylindricalRegion,
    CylindricalSolver,
    Material,
    Polarization,
)

vacuum = Material.vacuum()
dielectric = Material(epsilon_r=4.0)
geometry = CylindricalGeometry([
    CylindricalRegion(0.0, 0.5, dielectric),
    CylindricalRegion(0.5, float("inf"), vacuum),
])

solution = CylindricalSolver(geometry, frequency=300e6).solve(
    n=50, polarization=Polarization.TM
)
points = np.array([[0.75, 0.0, 0.0], [1.0, 0.5, 0.0]])
e_z = solution.e_z(points)
electric, magnetic = solution.total_field(points)

Points are Cartesian (x, y, z) coordinates in an (N, 3) array. Field components and full fields are complex; .real, .imag, and np.abs(...) provide access to the real part, imaginary part, or magnitude.

Quick start: sphere

The spherical solver returns both electric and magnetic multipole channels for each solution:

import numpy as np

from scatsol import Material, SphericalGeometry, SphericalRegion, SphericalSolver

vacuum = Material.vacuum()
geometry = SphericalGeometry([
    SphericalRegion(0.0, 1.0, Material(epsilon_r=2.56)),
    SphericalRegion(1.0, float("inf"), vacuum),
])
solution = SphericalSolver(geometry, frequency=300e6).solve(n=50)
points = np.array([[0.0, 0.0, 2.0], [1.5, 0.0, 0.0]])
magnetic_y = solution.h_y(points)

Examples and documentation

Run a demonstration from the repository root, for example:

uv run python demo/cylinder_diel.py
uv run python demo/sphere_diel.py

The documentation home includes the equations and conventions, API reference, and runnable examples. Build the documentation site with:

uv run mkdocs build

Reference

Jin, Jian-Ming. Theory and Computation of Electromagnetic Fields. 2nd ed. Hoboken, NJ: Wiley-IEEE Press, 2015.

License

ScatSol is licensed under the GNU General Public License v3.0 or later.

Metadata

Release files for scatsol 0.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for scatsol 0.2.2
File Size Uploaded Provenance
scatsol-0.2.2.tar.gz 109.5 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for scatsol 0.2.2
File Interpreter ABI Platform
scatsol-0.2.2-py3-none-any.whl Python 3 none any Details

Total release size: 135.6 kB

Release files / scatsol-0.2.2.tar.gz

Download URL scatsol-0.2.2.tar.gz
Size 109.5 kB
Tags Source
SHA-256 checksum
How to use checksums
d1c43f65ad66c23933a8c1ec8cf02579515f9df666d0f16a2f19785ae2c8f1ec
BLAKE2b-256 checksum
How to use checksums
3adcc2cbe475b494636f3c757bc644e86b0121548444d903a089fe2157faf7d3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 17, 2026.

Transparency log

Release files / scatsol-0.2.2-py3-none-any.whl

Download URL scatsol-0.2.2-py3-none-any.whl
Size 26.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
86cbbbf7a20e126ac1fe6c6bea09898cc6e3649be51a250c510b93b47c7b5424
BLAKE2b-256 checksum
How to use checksums
b30956bf3df2b851da659c392f8beec03d890f7ee967de5d6bb10878046ed878
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 17, 2026.

Transparency log

Security for scatsol 0.2.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for scatsol-0.2.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 17, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page