title: How can I put my simulation result into a .txt file when it is an array?
body: <p>I simulated a model with this script and now I just want to substitute T1 with a symbol t1 in a text file</p>
  
  <p>How should change the T1 from array to something else so that I can substitute that ?</p>
  
  <pre><code>from pymodelica import compile_fmu
          from pyfmi import load_fmu
          # Import the plotting library
          import matplotlib.pyplot as plt
          import numpy as np
          # Compile model
          model_name = 'Testerequal'
          mo_file = 'Testerequal.mo'
          VDP_fmu = compile_fmu('Testerequal', compiler_options = {'extra_lib_dirs':'D:\JModelica.org-1.17\Testerequal'})
          # Load model
          vdpid = load_fmu(VDP_fmu, log_level=7)
          res = vdpid.simulate(final_time=86400)
  
          x0= res["int.y"]
          t0= res["time"]
  
          T1 = x0[40] 
  
      f = open('D:/JModelica.org-1.17/Testertwo/That.txt','r')
  filedata = f.read()
  f.close() 
  
      newdata = filedata.replace('t1',T1)
  
      f = open('D:/JModelica.org-1.17/Testertwo/That.txt','w')
  f.write(newdata)
  f.close()
  </code></pre>