def GassmannModel(Phi, Kdry, Gdry, Kmat, Kfl):
    """
    GASSMANN MODEL
    Gassmann's equations.
    Written by Dario Grana (August 2020)

    Parameters
    ----------
    Phi : float or array_like
        Porosity (unitless).
    Kdry : float
        Bulk modulus of dry rock (GPa).
    Gdry : float
        Shear modulus of dry rock (GPa).
    Kmat : float
        Bulk modulus of solid phase (GPa).
    Kfl : float
        Bulk modulus of the fluid phase (GPa).

    Returns
    -------
    Ksat : float or array_like
        Bulk modulus of saturated rock (GPa).
    Gsat : float or array_like
        Shear modulus of saturated rock (GPa).

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

    # Bulk modulus of saturated rock
    Ksat = Kdry + ((1 - Kdry / Kmat) ** 2) / (Phi / Kfl + (1 - Phi) / Kmat - Kdry / (Kmat ** 2))
    # Shear modulus of saturated rock
    Gsat = Gdry
    
    return Ksat, Gsat