# Run Time

Run Time controls how long the simulation evolves electromagnetic fields.

The run_time should be long enough for the fields to decay to a negligible level by the end of the FDTD time stepping. This is important because frequency-domain results are most accurate when the fields are close to zero at both the beginning and the end of the simulation. For a non-resonant device, a practical initial estimate is:

tsimngLc0+tsource t_\mathrm{sim} \approx \frac{n_g L}{c_0} + t_\mathrm{source}

where LL is the largest propagation length, ngn_g is the group index, and tsourcet_\mathrm{source} is the source time. If a shutoff condition is specified, the simulation can terminate early when the field decay criterion is met.

See tidy3d.Simulation.run_time (opens new window).

# Auto

Auto mode computes the simulation run time from a RunTimeSpec (opens new window).

source_factor: Multiplier applied to the longest source time.

  • Type: positive float number
  • Default: 3

quality_factor: Expected quality factor of the device.

  • Type: positive float number

# Manual

Manual mode sets the simulation run_time (opens new window).

set_from_global_frequency: Toggle whether the manual run time is derived from the Global Settings frequency range.

  • Options:
    • True: Compute run_time from the global frequency range and disable manual run time input.
    • False: Enter run_time manually.

When enabled, the run time is computed as:

run_time=601fmaxfmin \mathrm{run\_time} = 60 \frac{1}{f_\mathrm{max} - f_\mathrm{min}}

run_time: Total electromagnetic evolution time.

  • Type: positive float number
  • Unit: s, ms, us, ns (default unit), ps, fs