<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def internal2external(xi, bounds):
 """ Convert a series of internal variables to external variables"""


    xe = np.empty_like(xi)

    for i, (v, bound) in enumerate(zip(xi, bounds)):

        a = bound[0]  # minimum
        b = bound[1]  # maximum

        if a == None and b == None:  # No constraints
            xe[i] = v

        elif b == None:  # only min
            xe[i] = a - 1. + np.sqrt(v ** 2. + 1.)

        elif a == None:  # only max
            xe[i] = b + 1. - np.sqrt(v ** 2. + 1.)

        else:  # both min and max
            xe[i] = a + ((b - a) / 2.) * (np.sin(v) + 1.)

    return xe