Theoryο
Resonator formalismο
The longitudinal impedance of a purely resonant structure can be modeled by an equivalent parallel RLC (Resistor, Inductor, Capacitor) resonator circuit.
Impedance resonator formulaο
Single:ο
Multiple:ο
Both found in the Impedances class as the functions Resonator_longitudinal_imp and n_Resonator_longitudinal_imp.
The three key parameters to characterize a resonatorβs impedance: shunt resistance (\(R_s\)), quality factor (\(Q\)), and resonant frequency (\(f_r = Ο_r/2Ο\) ).
Equivialently, the wake function can be described by these three parameters.
Wake function resonator formulaο
Single:ο
Multiple:ο
Both found in the Wakes class as the functions Resonator_longitudinal_wake and n_Resonator_longitudinal_wake.
Transverse functions are available as Resonator_transverse_wake, n_Resonator_transverse_wake, Resonator_transverse_imp and n_Resonator_transverse_imp.
Fitting Resonators with Differential Evolutionο
Differential Evolution (DE) is a metaheuristic optimization method in the field of evolutionary algorithms inspired by the principles of natural selection and evolution.
DE algorithms operate by evolving a population of candidate solutions over several generations. The key steps and workings of the algorithm are:
Population Initialization The algorithm begins by initializing a population of \(N\) individuals (candidate solutions) randomly within the bounds of the search space. Each individual is represented as a vector of decision variables:
where \(D\) is the dimensionality of the roblem. Each variable \(x_{i,j}\) is to be initialized by some stochastic process like a uniform distribution or by some sampling that tries to maximize coverage of the available parameter space. SciPy uses Latin Hypercube sampling to maximize coverage and avoid clustering. In either case, boundary constraints of the variable are needed:
Mutation Mutation generates a mutant vector \(\mathbf{v}_i\) for each individual \(\mathbf{x}_i\) in the population. Many mutation strategies are available, this project will stick to the \(DE/rand/1\) strategy. This strategy combines randomly selected individuals:
where \(\mathbf{F}\) is the mutation constant, also known as the differential weight and integers \(r1, r2, r3\), are chosen randomly from the interval \([1, N]\). The parameter \(F\) is typically specified as a range (min,max), enabling the use of dithering. Dithering introduces random variation to the mutation constant on a generation-by-generation basis, following a uniform distribution. This technique can significantly accelerate convergence by balancing exploration and exploitation. While increasing the mutation constant expands the search radius, it may also slow down the convergence process.
Crossover
Crossover combines the mutant vector \(\mathbf{v}_i\) with the current solution \(\mathbf{x}_i\) to create a trial vector \(\mathbf{u}_i\). The crossover is introduced so as to increase the diversity of the perturbed parameter vectors. For each dimension \(j\):
where \(r_j\) is a random variable between 0 and 1. \(\text{CR}\) is the Crossover Probability, also bounded to be between 0 and 1. Finally the \(j_{r}\) assigns a random dimension, to ensure at least one dimension comes from the mutant vector, preventing \(\mathbf{u}_i = \mathbf{x}_i\)
Selection
Finally, the trial vector \(\mathbf{u}_i\) competes with the current individual \(\mathbf{x}_i\) for survival into the next generation. The one with the better fitness value is selected:
\(\mathbf{f(\cdot)}\) is the objective function to be minimized.
Stopping criteria The algorithm iterates through mutation, crossover, and selection until a predefined stopping criterion is met, such as:
A maximum number of generations or function evaluations
Convergence tolerance (e.g., minimal change in the best solution across generations)
Achieving a target fitness value