Curves comparison and plotting algorithm with an emphasis on In-vitro drug dissolution testing.



This paper presents a Python algorithm for evaluation of difference factor 𝑓1 and similarity factor 𝑓2 as a criterion for assessment of similarity between two in-vitro dissolution profiles as proposed in the EMEA and SUPAC-IR Guidance. It accelerates and facilitates the pharmaceutical developers everyday work by providing quick calculations and charts.


Dissolution testing is an important tool for characterizing the performance of oral dosage forms. Its significance is based on the fact that for a drug to be effective, the active pharmaceutical ingredient (API) must first be released from the product and dissolve in the gastrointestinal fluids before absorption into the bloodstream can happen. In other words, the rate and extent of drug absorption are determined by its dissolution from the dosage form. In early phase drug development, dissolution testing aids formulation design and drug delivery optimization it is primarily carried out to assess product stability, monitor formulation changes over time, and establish in-vitro–in-vivo correlations. From a regulatory perspective, dissolution testing plays a major role in the decision-making process, particularly in the development and approval of generic dosage forms, where unnecessary human studies can be avoided without compromising the quality of the generic drug products.

The concept of difference factor 𝑓1 and similarity factor 𝑓2 has been developed by Moore JW and Flanner HH and endorsed by The USA Food and Drug Administration (FDA) and European Agency for the Evaluation of Medicinal Products (EMEA) therefore, it is widely adopted in formulation and development and dossier preparation.

The difference factor 𝑓1, as defined by FDA, calculates the % difference between 2 curves at each time point and is a measurement of the relative error between 2 curves. 

where, 𝑛 = number of time points 𝑅𝑡 = % dissolved at time t of reference product 𝑇𝑡 = % dissolved at time 𝑡t of test product.

The similarity factor 𝑓2 is a logarithmic transformation of the sum-squared error of differences between the test 𝑇𝑡 and reference products 𝑅𝑡 over all time points, n (Moore and Flanner, 1996):

The similarity factor fits the result between 0 and 100. It is 100 when the test and reference profiles are identical and approaches 0 as the dissimilarity increases. This method is more adequate to compare dissolution profile when more than three or four dissolution times points are available and can only be applied if the average difference between 𝑅𝑡 and 𝑇𝑡 is less than 100.

The FDA and EMEA suggested that two dissolution profiles were declared similar if 𝑓2 was between 50 and 100. It should be noted that in the 𝑓2 Scale-up and Post-Approval Changes Guidance for Immediate Release Products (SUPAC-IR) and EMEA Guidance 𝑅𝑡 and 𝑇𝑡 are defined as the percent dissolved in each sampling time point 𝑡t, different from the previous definition proposed by Moore and Flanner. From the context of these guidances it was generally interpreted that 𝑓2 should be computed from average cumulative percent dissolved. The 𝑓2 is insensitive to the shape of the dissolution profiles and do not take into account the information of unequal spacing between sampling time points. The similarity factor 𝑓2 is a sample statistic that cannot be used to formulate a statistical hypothesis for assessment of dissolution similarity. It is, therefore, impossible to evaluate false positive and false negative rates of decisions for approval of drug products based on 𝑓2. Implementation of 𝑓2 to assess dissolution similarity is, in fact, a one-sided problem rather than an interval criterion suggested by FDA and EMEA guidances. For each pair of dissolution profiles using this similarity factor a characteristic 𝑓2 value is obtained. This value use the mean percent dissolved of test and reference products, and do not reflect the dispersion associated with each dissolution profile. In general, no statistical inference can be made, by direct implementation of the criterion based on this 𝑓2 factor, about dissolution dissimilarity from tablet sample to tablet batches population.

This project was created in the The Jupyter Notebook environment. The Jupyter Notebook is an open-source web application that allows you to create and share documents that contain live code, equations, visualizations and narrative text. Uses include: data cleaning and transformation, numerical simulation, statistical modeling, data visualization, machine learning, and much more.

Results and discussion

The current article presents a Python algorithm based on the Moore and Flanner model for calculating the factors 𝑓1 and 𝑓2 and plotting the dissolution curves of the products.

The first part of the algorithm reads from the console the time points and % dissolved API at each time point for the reference and the test product and converts it to array using np.array.

The Python code implementation:

At the next part of the algorithm 𝑓1 factor is calculated according to the Moore and Flanner equation.

The difference factor 𝑓1 calculates the percent % difference between the two curves at each time point and is a measurement of the relative error between the two curves.

The Python code implementation:

The similarity factor 𝑓2 is a logarithmic reciprocal square root transformation of the sum of squared error and is a measurement of the similarity in the percent % dissolution between the two curves. At the next part of the algorithm 𝑓2 factor is calculated according to the Moore and Flanner equation.

The Python code implementation:

After that the calculated factors are printed and a dissolution curves are plotted using 𝑚𝑎𝑡𝑝𝑙𝑜𝑡𝑙𝑖𝑏.𝑝𝑦𝑝𝑙𝑜𝑡 library.

For curves to be considered similar, 𝑓1 values should be close to 0, and 𝑓2 values should be close to 100. Generally, 𝑓1 values up to 15 (0-15) and 𝑓2 values greater than 50 (50-100) ensure sameness or equivalence of the two curves and, thus, of the performance of the test and reference products.

The resulting output:


The presented algorithm is a tool capable to calculate the 𝑓1 and 𝑓2 factors and plot the dissolution curves for reference and test product build on various numbers of data points. It accelerates and facilitates the pharmaceutical developers everyday work by providing quick calculations and well-structured charts. The charts are formatted according to the FDA and AMEA Common Technical Document format requirement. It’s a premise to faster, more efficient and low cost drug development by providing faster and simplified calculation process and reducing the mistakes.


(1) A. Siew, Dissolution Testing  Pharmaceutical Technology Volume 40, Issue 11, pg 56, 64

(2) Food and Drug Administration (FDA) Center for Drug Evaluation and Research (CDER). Guidance for Industry. Modified Release Solid Oral Dosage Forms: Scale up and Post Approval Changes (SUPAC) (1997): Chemistry, Manufacturing and Controls, In Vitro Dissolution Testing and In Vivo Bioequivalence Documentation. Rockville, MD: FDA.

(3) European Medicines Agency  Guideline On The Investigation Of Bioequivalence

(4) Moore JW, Flanner HH (1996) Mathematical comparison of curves with an emphasis on in-vitro dissolution profiles. Pharm Tech 20: 64–74

(5) Wagner, J.G., 1969. Interpretation of percent dissolved-time plots derived from in vitro testing of conventional tablets and capsules. J. Pharm. Sci. 58, 1253–1257.

(6) A. Kakade, Dissolution Analyses: Comparison of Profiles Using f2 Analysis Calculation

(7) O’Hara T, Dunne A,  Review of methodologies for the comparison of

dissolution profile data. Adv Exp Med Biol. 1997; 423:167–71.

(8) Polli J, Rekhi G, Methods to compare dissolution profiles and a rationale for wide dissolution specifications for metoprolol tartrate tablets. J Pharm Sci. 1997; 86:690–700.

Software and libraries used in the project:





matplotlib.pyplot as pl

numpy as np

The Jupyter Notebook.



M.Pharm. Zhivko Ivanov
ISTQB ADVANCED Technical Test Analyst