def _compute_non_linear_term(self, C, pga_only, sites):
        """
        Compute non-linear term, equation (3a) to (3c), page 20.
        """
        Vref = 750.0
        Vcon = 1000.0
        lnS = np.zeros_like(sites.vs30)

        # equation (3a)
        idx = sites.vs30 < Vref
        lnS[idx] = (
            C['b1'] * np.log(sites.vs30[idx] / Vref) +
            C['b2'] * np.log(
                (pga_only[idx] + C['c'] * (sites.vs30[idx] / Vref) ** C['n']) /
                ((pga_only[idx] + C['c']) * (sites.vs30[idx] / Vref) ** C['n'])
            )
        )

        # equation (3b)
        idx = (sites.vs30 >= Vref) & (sites.vs30 <= Vcon)
        lnS[idx] = C['b1'] * np.log(sites.vs30[idx]/Vref)

        # equation (3c)
        idx = sites.vs30 > Vcon
        lnS[idx] = C['b1'] * np.log(Vcon/Vref)

        return lnS
def _compute_non_linear_term ( self , C , pga_only , sites ) : Vref = 750.0 Vcon = 1000.0 lnS = np . zeros_like ( sites . vs30 ) idx = sites . vs30 < Vref lnS [ idx ] = ( C [ 'b1' ] * np . log ( sites . vs30 [ idx ] / Vref ) + C [ 'b2' ] * np . log ( ( pga_only [ idx ] + C [ 'c' ] * ( sites . vs30 [ idx ] / Vref ) ** C [ 'n' ] ) / ( ( pga_only [ idx ] + C [ 'c' ] ) * ( sites . vs30 [ idx ] / Vref ) ** C [ 'n' ] ) ) ) idx = ( sites . vs30 >= Vref ) & ( sites . vs30 <= Vcon ) lnS [ idx ] = C [ 'b1' ] * np . log ( sites . vs30 [ idx ] / Vref ) idx = sites . vs30 > Vcon lnS [ idx ] = C [ 'b1' ] * np . log ( Vcon / Vref ) return lnS
Compute non-linear term, equation (3a) to (3c), page 20.