REMI Lab
OPEN KNOWLEDGE / TOOLS

Simulation API

이 페이지의 내용

This page is a map of the calls you use in almost every model and the objects they return. Each row links to the API page with the full signature and arguments. For every public symbol, see the generated reference.

The workflow in calls

sim = Simulation(freq_max, domain, dx=..., boundary="cpml") # domain and mesh
sim.add_material(...); sim.add(shape, material=...) # materials, geometry
sim.add_source(...) or sim.add_port(...) # excitation
sim.add_probe(...); sim.add_flux_monitor(...) # observables
sim.preflight() # check
result = sim.run(n_steps=...) # solve -> Result

Building a model

CallDoesReference
Simulation(freq_max, domain, *, dx, boundary, cpml_layers, dz_profile, ...)domain, mesh, boundariesSimulation
add_material(name, *, eps_r, sigma, mu_r, debye_poles, lorentz_poles)a named materialGeometry & Materials
add(shape, *, material)fill a Box, Sphere, Cylinder, PolylineWire, Via, MeshShape…Geometry & Materials
add_thin_conductor(shape, *, surface_impedance_f0=None)a copper sheetGeometry & Materials
add_source(position, component, *, waveform, amplitude_kind="current")point source, no impedanceSources & Ports
add_tfsf_source(...)plane waveSources & Ports
add_port, add_msl_port, add_waveguide_port, add_coaxial_portports for S-parametersSources & Ports
add_probe, add_dft_plane_probe, add_flux_monitor, add_ntff_boxobservablesResults & Observables

Checking and running

CallReturnsReference
preflight()PreflightReport (read .ok, .errors, .warnings)Simulation
fidelity_report()where each shape landed on the gridSimulation
run(n_steps= / num_periods= / until_decay=, ...)ResultSimulation
forward(eps_override=..., ...)ForwardResult, differentiable with JAXSimulation
plan_mesh(...), Simulation.auto(...)a proposed mesh and domainAutomation

S-parameters

Each port family has its own calculator:

PortsCallReturns
lumped / wire add_portrun(compute_s_params=True, s_param_freqs=...)Result.s_params, Result.freqs
microstrip add_msl_portcompute_msl_s_matrix()MSLSMatrixResult
waveguide add_waveguide_portcompute_waveguide_s_matrix()WaveguideSMatrixResult
coaxial add_coaxial_portcompute_coaxial_line_reflection() or compute_coaxial_two_port()CoaxialLineReflectionResult, CoaxialTwoPortResult

sim.compute_s_matrix() chooses the calculator from the registered ports, and sim.s_matrix_lane() tells you which one it would use. Microstrip and coaxial ports are not computed by run(compute_s_params=True). Details: Sources & Ports.

Reading results

ObjectMain contentsReference
Resulttime_series, dt, settling_db, s_params, freqs, flux_monitors, dft_planes, ntff_data, snapshots; find_resonances(), s11(), s_db()Results & Observables
ForwardResulttime_series, s_params, dft_planes, ntff_dataResults & Observables
S-parameter resultsS or s_params indexed [receiver, driven, freq]Results & Observables

Before you trust a spectrum, check result.settling_db (below about −40 dB). For what is supported, limited or refused, see Support Boundaries.

Back to top ↑