Skip to main content

ScatSol

License: GPL v3 Docs PyPI GitHub

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

Install the published package from PyPI with pip:

python -m pip install scatsol
Other installation options

Install directly from the latest GitHub source with pip or uv:

python -m pip install git+https://github.com/tiagovla/scatsol.git
uv pip install git+https://github.com/tiagovla/scatsol.git

To add the GitHub source as a dependency in a uv project:

uv add git+https://github.com/tiagovla/scatsol.git

To work from a local clone, install its dependencies with uv:

git clone https://github.com/tiagovla/scatsol.git
cd scatsol
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.

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.3

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.3
File Size Uploaded Provenance
scatsol-0.2.3.tar.gz 143.0 kB With provenance Details

Built distribution (wheel)

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

Total release size: 169.3 kB

Release files / scatsol-0.2.3.tar.gz

Download URL scatsol-0.2.3.tar.gz
Size 143.0 kB
Tags Source
SHA-256 checksum
How to use checksums
da514df505e1482a5e869f51dbf89e2e00c7ae592d297bf204d9a45977e9a217
BLAKE2b-256 checksum
How to use checksums
a911dee0e11fd4a85e59e1a1c98d6b5b7cb2312416109368a3fa0a26a4de9f1a
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.3-py3-none-any.whl

Download URL scatsol-0.2.3-py3-none-any.whl
Size 26.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c414e85387519a669e6b210e5df970f7614e8df0acc3ee933a77dbf416dd8a47
BLAKE2b-256 checksum
How to use checksums
0a7059d17d4da59c183749e20920fc6e88da37a79f41d711e48e93596ea15be1
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.3

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.3.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