simulate_model#
- simpleEMS.fdtd_standalone_model.simulate_model(structure_xml_path: str | Path, output_path: str | Path | None = None, num_points: int = 1000, run: bool = True, freqs: ndarray[tuple[Any, ...], dtype[_ScalarT]] | None = None) tuple[SimData, SimSetup, float, nf2ff]#
Load a
structure.xml, run the simulation and compute network parameters.- Parameters:
structure_xml_path (str | Path) – Path to the
structure.xmlfile exported by CSXCAD.output_path (str | Path, optional) – Directory where simulation results will be written / already exist. Defaults to
cwd / "Sim_Path".num_points (int) – Number of frequency points for post-processing. Default
1000. Ignored whenfreqsis given.run (bool) – Whether to execute the FDTD solver. Default
True. Set toFalseto only post-process existing results.freqs (NDArray, optional) – Explicit post-processing frequency points (Hz). By default the band is derived from the model’s own Gaussian excitation (
get_freq_range()); pass this to post-process over a narrower band, or when the model uses a non-Gaussian excitation that defines no band of its own.
- Returns:
A tuple containing:
sim_data (SimData) – Named tuple with
freqs,s11,s21,z11,vswr, andinput_power.sim (SimSetup) – Named tuple with
CSX,FDTD, andfreqs.charac_imp (float) – Characteristic (reference) impedance in ohms, extracted from the loaded model’s lumped-port resistance.
nf2ff_box (nf2ff) – NF2FF recording box registered on the model, for far-field post-processing after the run.
- Return type:
tuple[SimData, SimSetup, float, nf2ff]
- Raises:
RuntimeError – If no ports are found in the loaded structure.