Measurement models that have a chemical composition as one of the arguments require special attention when used with the law of propagation of uncertainty from the Guide to the expression of uncertainty in measurement. The constraint that the amount fractions in a composition add exactly to unity does not only affect the covariance matrix associated with the composition, but also impacts the differentiation of the measurement model to obtain the expressions and values of the sensitivity coefficients. Differentiating the measurement model with respect to each variable individually is not possible as it involves evaluating the model for infeasible inputs, leading to an undefined output. In this work, a numerical method for constrained partial derivatives is presented, enabling using the law of propagation of uncertainty for measurement models with compositions as one of their arguments. The numerical method enables treating the measurement model as a black box and using it with measurement models in the form an algorithm. The numerical method is demonstrated by showing how the uncertainty associated with composition, temperature and pressure can be propagated through an equation of state, in this case the GERG-2008 equation of state. It is shown that this propagation can be done in a few simple steps, requiring only a valid implementation of the measurement model that provides an output value for given input quantities. The numerical differentiation method applies in principle to all differentiable functions of a composition.