Skip to content

Mode solver sweeps using interpolation #2530

@dbochkov-flexcompute

Description

@dbochkov-flexcompute

Is your feature request related to a problem? Please describe.
Sometimes it is of interest to obtain the waveguide mode field profiles and/or propagation constants at a large number of frequency points. Given that waveguide modes often exhibit smooth frequency dependence, it could be much faster and still accurate to solve for waveguide modes only at a smaller number of selected frequencies and then interpolate found solutions onto frequency points in-between, as opposed to directly solving mode equations at each frequency point.

Describe the solution you'd like
Various types of interpolations such as piecewise linear, quadratic, spline, etc can be considered. In the first version of such a feature it probably makes most sense to use Chebyshev interpolation given its high accuracy. One approach to implement this consists in adding a field sweep_spec in the ModeSolver class, that could take values of ModeSweepSpecType = Union[DirectSolveSpec, ChebyshevInterpSpec] (default: DirectSolveSpec()). Internally, ModeSolver should wrap this part of code https://github.com/flexcompute/tidy3d/blob/develop/tidy3d/components/mode/mode_solver.py#L463-L464 such that if sweep_spec is an instance of class ChebyshevInterpSpec:

  • it detects the range of frequency sample points where the mode solutions are requested
  • create an auxiliary ModeSolver instance that differs from the original one only by value of field freqs, which now would be chebyshev nodes in the detected frequency range (the number of chebyshev nodes to use should be a field in ChebyshevInterpSpec class)
  • retrieves ModeSolverData from this auxiliary ModeSolver
  • applies mode tracking to ModeSolverData to facilitate correct interpolation
  • interpolates all quantities (propagation index, fields, grid correction factors, etc) onto the original frequency sample points and constructs a new ModeSolverData based on these interpolated values.

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions