def z_to_params(z, P, n_m, n_t):
    """Convert single vectors of unknowns z into separate vectors of unknowns."""
    lambda_ = z[0:n_m]
    beta = z[n_m : 2 * n_m]
    betat = z[2 * n_m : 2 * n_m + n_t]
    T = z[2 * n_m + n_t :]
    return lambda_, beta, betat, T