<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def friction_velocity(u, w, v=None, perturbation=False, axis=-1):
 r"""Compute the friction velocity from the time series of velocity components. Compute the friction velocity from the time series of the x, z, and optionally y, velocity components. Parameters u : array_like The wind component along the x-axis w : array_like The wind component along the z-axis v : array_like, optional The wind component along the y-axis. perturbation : {False, True}, optional True if the `u`, `w`, and `v` components of wind speed supplied to the function are perturbation velocities. If False, perturbation velocities will be calculated by removing the mean value from each component. Returns ------- array_like The corresponding friction velocity Other Parameters axis : int The index of the time axis. Default is -1 See Also -------- kinematic_flux : Used to compute the x-component and y-component vertical kinematic momentum flux(es) used in the computation of the friction velocity. Notes ----- The Friction Velocity is computed as: .. math:: u_{*} = \sqrt[4]{\left(\overline{u^{\prime}w^{\prime}}\right)^2 + \left(\overline{v^{\prime}w^{\prime}}\right)^2}, where :math: \overline{u^{\prime}w^{\prime}} and :math: \overline{v^{\prime}w^{\prime}} are the x-component and y-components of the vertical kinematic momentum flux, respectively. If the optional v component of velocity is not supplied to the function, the computation of the friction velocity is reduced to .. math:: u_{*} = \sqrt[4]{\left(\overline{u^{\prime}w^{\prime}}\right)^2} For more information on the subject, please see [Garratt1994]_. """

    uw = kinematic_flux(u, w, perturbation=perturbation, axis=axis)
    kf = uw * uw
    if v is not None:
        vw = kinematic_flux(v, w, perturbation=perturbation, axis=axis)
        kf += vw * vw
    # the friction velocity is the 4th root of the kinematic momentum flux
    # As an optimization, first do inplace square root, then return the
    # square root of that. This is faster than np.power(..., 0.25)
    np.sqrt(kf, out=kf)
    return np.sqrt(kf)