import math


def calc_rb_max(n_pe, beam_tot_z, beam_num_ptcl):
    """
    Calculate the maximum radius of the plasma bubble

    Valid in "strong bubble regime", where rb_max*k_pe >> 1.
    Args:
        n_pe:           number density of the electron plasma
        beam_tot_z:     total length of the drive beam
        beam_num_ptcl:  number of e- in the drive beam
    Returns:
        rb_max: maximum radius of the plasma bubble
    """
    # from Eq. (12) of LBN2017
    rb_max = pow(2,7/8.)*pow(beam_num_ptcl/math.pi/n_pe,3/8.)/pow(beam_tot_z,1/8.)
    return rb_max