parameters: (rhs,name, mode="python", initial_tabs = 1,max_index=30,aux_dict={})
return_statement: return outstring
docstring: This method converts into text the RHS vector (only non-zero terms)
  
      Keyword arguments:
      rhs -- The RHS vector
      name -- The name of the variables
      mode -- The mode of output
      initial_tabs -- The number of tabulations considered
      max_index -- The maximum index
      aux_dict -- Auxiliar dictionary
docstring_summary: This method converts into text the RHS vector (only non-zero terms)
docstring_tokens: This method converts into text the RHS vector ( only non - zero terms )
function: def OutputVectorNonZero(rhs,name, mode="python", initial_tabs = 1,max_index=30,aux_dict={}):
      """ This method converts into text the RHS vector (only non-zero terms)
  
      Keyword arguments:
      rhs -- The RHS vector
      name -- The name of the variables
      mode -- The mode of output
      initial_tabs -- The number of tabulations considered
      max_index -- The maximum index
      aux_dict -- Auxiliar dictionary
      """
      initial_spaces = ""
      for i in range(0,initial_tabs):
          initial_spaces += "    "
  
      outstring = ""
      for i in range(0,rhs.shape[0]):
  
          if mode == "python":
              outstring += initial_spaces + name + "[" + str(i) + "]+=" + str(rhs[i,0]) + "\n"
          elif mode=="c":
              if rhs[i] != 0:
                  if "// Not supported in C:" in sympy.ccode(rhs[i,0]):
                      var = rhs[i,0]
                      if  "Derivative" in str(var):
                          for constantname, constantexp in aux_dict.items():
                              var = var.replace(constantname, constantexp)
                          aux_string = str(var)
                          outstring += initial_spaces + name +  "[" + str(i) + "]="  + "//subsvar_"+aux_string.replace("// Not supported in C:","")+ ";\n"
                      else:
                          outstring += initial_spaces + name +  "[" + str(i) + "]+=" + "//subsvar_" + sympy.ccode(rhs[i,0]).split("\n",2)[2]+ ";\n"
                  else:
                      outstring += initial_spaces + name +  "[" +str(i)+ "]+=" + sympy.ccode(rhs[i,0])+ ";\n"
  
      # Matrix entries (two indices)
      for i in range(0, max_index):
          for j in range(0, max_index):
              if mode == "python":
                  replacement_string =  "[" + str(i) + "," + str(j) + "]"
              elif mode=="c":
                  replacement_string =  "(" + str(i) + "," + str(j) + ")"
              to_be_replaced  =  "_" +str(i)+ "_" +str(j)
              if not "//subsvar_" in outstring:
                  newstring = outstring.replace(to_be_replaced, replacement_string)
                  outstring = newstring
  
      # Vector entries(one index)
      for i in range(0,max_index):
          replacement_string =  "[" +str(i)+ "]"
          to_be_replaced  =  "_" +str(i)
          if not "//subsvar_" in outstring:
              newstring = outstring.replace(to_be_replaced, replacement_string)
              outstring = newstring
  
      return outstring
function_tokens: def OutputVectorNonZero ( rhs , name , mode = "python" , initial_tabs = 1 , max_index = 30 , aux_dict = { } ) : initial_spaces = "" for i in range ( 0 , initial_tabs ) : initial_spaces += "    " outstring = "" for i in range ( 0 , rhs . shape [ 0 ] ) : if mode == "python" : outstring += initial_spaces + name + "[" + str ( i ) + "]+=" + str ( rhs [ i , 0 ] ) + "\n" elif mode == "c" : if rhs [ i ] != 0 : if "// Not supported in C:" in sympy . ccode ( rhs [ i , 0 ] ) : var = rhs [ i , 0 ] if "Derivative" in str ( var ) : for constantname , constantexp in aux_dict . items ( ) : var = var . replace ( constantname , constantexp ) aux_string = str ( var ) outstring += initial_spaces + name + "[" + str ( i ) + "]=" + "//subsvar_" + aux_string . replace ( "// Not supported in C:" , "" ) + ";\n" else : outstring += initial_spaces + name + "[" + str ( i ) + "]+=" + "//subsvar_" + sympy . ccode ( rhs [ i , 0 ] ) . split ( "\n" , 2 ) [ 2 ] + ";\n" else : outstring += initial_spaces + name + "[" + str ( i ) + "]+=" + sympy . ccode ( rhs [ i , 0 ] ) + ";\n" # Matrix entries (two indices) for i in range ( 0 , max_index ) : for j in range ( 0 , max_index ) : if mode == "python" : replacement_string = "[" + str ( i ) + "," + str ( j ) + "]" elif mode == "c" : replacement_string = "(" + str ( i ) + "," + str ( j ) + ")" to_be_replaced = "_" + str ( i ) + "_" + str ( j ) if not "//subsvar_" in outstring : newstring = outstring . replace ( to_be_replaced , replacement_string ) outstring = newstring # Vector entries(one index) for i in range ( 0 , max_index ) : replacement_string = "[" + str ( i ) + "]" to_be_replaced = "_" + str ( i ) if not "//subsvar_" in outstring : newstring = outstring . replace ( to_be_replaced , replacement_string ) outstring = newstring return outstring