Quick Start
Build your first scene and run a simulation with WiTwin Channel
Overview#
Every WiTwin Channel workflow follows the same pattern:
- Build a
Scenewith geometry, materials, transmitters, and receivers - Pick a solver and configure it
- Call
solve()and read the result
Your First Simulation#
The example below places a concrete wall between a transmitter and a receiver grid, then computes a 32×32 coverage map using the deterministic solver.
import numpy as np
import witwin.channel as wc
scene = wc.Scene(
structures=[
wc.Structure(
name="wall",
geometry=wc.Box(
position=(0.0, 0.0, 1.5),
size=(0.25, 4.0, 3.0),
device="cuda",
),
material=wc.Material(eps_r=4.0, sigma_e=0.0),
),
],
transmitters=[
wc.Transmitter("tx", (-2.0, 0.0, 1.5)),
],
receivers=[
wc.ReceiverGrid(
"rm",
axis="z",
position=1.5,
bounds=((-3.0, 3.0), (-3.0, 3.0)),
grid_shape=(32, 32),
),
],
frequency=3.5e9,
device="cuda",
)
result = wc.deterministic.solve(
scene=scene,
transmitter="tx",
receiver="rm",
config=wc.deterministic.Config(
num_samples=256,
max_bounces=1,
max_diffraction_order=0,
edge_policy=wc.EdgePolicy(edge_selection_mode="all_edges"),
),
)
path_gain = np.asarray(result.path_gain, dtype=np.float32)
print(path_gain.shape, float(path_gain.max()))What Just Happened#
Sceneholds all geometry, materials, and endpointswc.Structurepairs aBoxshape with aMaterialwc.Transmitterplaces a radio source at a positionwc.ReceiverGriddefines a 2D measurement grid at heightz=1.5wc.deterministic.solve()runs the simulation and returns aRadioMapResultresult.path_gaincontains the signal strength at every grid point
Choosing a Solver#
Note
Not sure which solver to use? Start with deterministic — it is the fastest and most predictable. Switch to montecarlo for more complex environments or path when you need per-path CIR/CFR data.
| Solver | Use when |
|---|---|
deterministic | You need a fast, repeatable coverage map |
montecarlo | You need sampling-based integration over complex scenes |
path | You need discrete paths, CIR, CFR, or per-path channel data |
Path Solver Result#
When using the path solver, the returned PathResult gives you access to:
.cir()— channel impulse response, returns(coefficients, delays).cfr(frequencies)— channel frequency response over a set of subcarrier frequencies.taps(bandwidth, num_taps)— discrete channel taps at a given bandwidth.filter_by_type(*interaction_types)— filter paths by interaction type (REFLECTION,DIFFRACTION,TRANSMISSION,SCATTERING)