def DensityModel(Phi, Rhomat, Rhofl):
    """
    DENSITY MODEL
    Linear porosity-density relation.
    Written by Dario Grana (August 2020)

    Parameters
    ----------
    Phi : float or array_like
        Porosity (unitless).
    Rhomat : float
        Density of the solid phase (g/cc).
    Rhofl : float
        Density of the fluid phase (g/cc).

    Returns
    -------
    Rho : float or array_like
        Density of saturated rock (g/cc).

    References: Grana, Mukerji, Doyen, 2021, Seismic Reservoir Modeling: Wiley - Chapter 2.1
    """

    Rho = (1 - Phi) * Rhomat + Phi * Rhofl
    
    return Rho