import math


def calc_jump_power(block_count, total_mass):
    """ Calculate the power required to fully charge the jump drive of a ship

    Given the number of Jump Modules and total ship mass, this function will
    calculate the total power required to fully charge the jump drive.

    Args:
        block_count: The number of Jump Drive Modules (block id 545)
        total_mass: The total mass of the ship

    Returns:
        A float for total power 'e' required to charge the jump drive
    """
    ideal = math.ceil(total_mass * 0.5)
    a = 50.0 - 100.0 * block_count * total_mass
    return (-0.24 * total_mass)*a*a + 4600.0*a + 230000.0 + 1200.0 * ideal