Flow diagram of the PrEP intervention model. The population was divided into 26 compartments (susceptible individuals without PrEP (S), susceptible individuals with PrEP (SP), undiagnosed infections with drug-sensitive (ISj) or drug-resistant strains (IRj), diagnosed but untreated infections with drug-sensitive (DSj) or drug-resistant strains (DRj), and treated infections with drug-sensitive (TSj) or drug-resistant strains (TRj), j = 1, 2, 3, 4 denote the stages of CD4 >=500 cells/μL, 350–499 cells/μL, 200–349 cells/μL and <200 cells/μL. Subscripts S and R denote infected with drug sensitive (blue compartments) and drug-resistant strains (red compartments). Denote λn as the force of HIV infections, n = 1, 2, 3, 4, where λ1 (λ2) was the per capita rate for the susceptible without PrEP to acquire the infection with the HIV drug-sensitive (drug-resistant) strains, and λ3 (λ4) is the per capita rate for the susceptible with PrEP to acquire the infection with the HIV drug-sensitive (drug-resistant) strains, respectively. Denote π as the recruitment rate and m as the exiting rate due to behavior changes (i.e., not engaging in high-risk sexual behavior). ϕ is the PrEP using rate, and ϕoff is the rate discontinuing PrEP. Denote the time-dependent diagnose and treatment rates as φj and δj,j = 1, 2, 3, 4. τj is the rate of acquired drug resistance after first-line therapy. Denote the disease progression rates from stage of CD4 >=500 cells/μL to CD4 350–499 cells/μL, from CD4 350–499 cells/μL to CD4 200–349 cells/μL, and from CD4 200–349 cells/μL to CD4 <200 cells/μL as () among untreated (treated) individuals, respectively, where the superscript U, T denote the untreated and treated individuals. The reversion rates of the above stages after effective treatment are w1,w2,w3, respectively, we assumed reversion rates are not differ in drug-sensitive and drug-resistance infections. The natural death rate among general population (d) and the HIV-related death rates (,) were not shown in this figure.