  The cavity haloscope is among the most widely adopted experimental platforms
designed to detect dark matter axions with its principle relying on the
conversion of axions into microwave photons in the presence of a strong
magnetic field. The Josephson parametric amplifier (JPA), known for its
quantum-limited noise characteristics, has been incorporated in the detection
system to capture the weakly interacting axion signals. However, the
performance of the JPA can be influenced by its environment, leading to
potential unreliability of a predefined parameter set obtained in a specific
laboratory setting. Furthermore, conducting a broadband search requires
consecutive characterization of the amplifier across different tuning
frequencies. To ensure more reliable measurements, we utilize the Nelder-Mead
technique as a numerical search method to dynamically determine the optimal
operating conditions. This heuristic search algorithm explores the
multidimensional parameter space of the JPA, optimizing critical
characteristics such as gain and noise temperature to maximize signal-to-noise
ratios for a given experimental setup. Our study presents a comprehensive
analysis of the properties of a flux-driven JPA to demonstrate the
effectiveness of the algorithm. This approach contributes to ongoing efforts in
axion dark matter research by offering an efficient method to enhance axion
detection sensitivity through the optimized utilization of JPAs.
