def compute_energy_from_density(density, x_dimension, y_dimension, chemical_potential):
    """Computes energy from energy density."""
    return (x_dimension * y_dimension) * (density - chemical_potential)