def pde_string(w, rhs_description, ut = 'u_t', print_imag=False):
    """
    Prints a pde based on:
    w: weights vector
    rhs_description: a list of strings corresponding to the entries in w
    ut: string descriptor of the time derivative
    print_imag: whether to print the imaginary part of the weights
    Returns:
    pde: string with the pde
    """
    pde = ut + ' = '
    first = True
    for i in range(len(w)):
        if w[i] != 0:
            if not first:
                pde = pde + ' + '
            if print_imag==False:
                pde = pde + "(%.5f)" % (w[i].real) + rhs_description[i] + "\n "
            else:
                pde = pde + "(%.5f %0.5fi)" % (w[i].real, w[i].imag) + rhs_description[i] + "\n "
            first = False

    return pde