Abstract The coupling of electromagnetic waves in the Ion Cyclotron Range of Frequencies (ICRF) is an important method to heat magnetically confined plasmas. Changing plasma conditions, which originate from processes like L-mode to H-mode transition or gas puffing, vary the load impedance of the ICRF antennas. To optimize the power transfer from the radio frequency (RF) generators to the antennas and consequently to the plasma, as well as to protect the RF sources against too high reflected power, a system that matches (i.e. transforms) the antenna input impedance to the impedance required by the generator is necessary. At ASDEX Upgrade this matching system consists of two stub tuners for each antenna, which match the antenna impedance for a value preset before the discharge. The length of the stubs cannot be changed fast enough to compensate plasma variations even on the moderate timescale of the confinement time in ASDEX Upgrade. The use of 3 dB-couplers allows operation even with varying load, at the cost of a reduced power to the plasma. When adjustable capacitors are applied in parallel to the stubs, dynamic matching becomes possible on the tens of ms timescale. The paper describes first the calculation of the required capacitance using transmission line theory. In a second model a minimum search algorithm finds, for a given antenna impedance, the length of the stubs needed for matching, now including the initial values of the capacitors. For the chosen pre-match point in the Smith chart, the range of impedances around this point is calculated for which the voltage standing wave ratio (VSWR) can be lowered below a minimum value by readjusting the capacitors within their maximum and minimum values. The matching range is thereby significantly larger than without the application of adjustable capacitors, at least with a frequency of 30 MHz and 36.5 MHz.