Estimating and controlling the COVID-19 pandemic is essential to reduce the spread of the disease and help decision-making efforts in combating public health crises. However, the potential presence of multiple dynamic changes in the reported count data or the occurrence of another wave of the pandemic emerges as a challenge for simulating the evolution of the disease over a long period. In this chapter, to account for the dynamic changes in the COVID-19 curves, the authors propose a rate function based on multiple branches of a logistic function. They assumed in a compartmental model that the recovery and disease transmission rates are time-dependent, and they assign to each the rate function. Then, they apply the model to daily COVID-19 data on infection counts in Morocco between March 2, 2020 and December 31, 2021 using curve fitting through the Nelder-Mead optimization method. The simulation outcomes demonstrate the model's ability to replicate the COVID-19 pandemic in Morocco over two waves, with the goodness of fit depending on the number of logistic branches composing the rate function.