text: """
      tellurium 1.3.5
  
      auto-generated code
      sedmlDoc: L1V2  
      workingDir: /home/mkoenig/git/tellurium/examples/tellurium-files/phrasedml/results/_te_case_05
      inputType: COMBINE_FILE
  """
  from __future__ import print_function, division
  import tellurium as te
  from roadrunner import Config
  from tellurium.sedml.mathml import *
  import numpy as np
  import matplotlib.pyplot as plt
  import mpl_toolkits.mplot3d
  import libsedml
  import pandas
  import os.path
  Config.LOADSBMLOPTIONS_RECOMPILE = True
  
  workingDir = r'/home/mkoenig/git/tellurium/examples/tellurium-files/phrasedml/results/_te_case_05'
  
  # --------------------------------------------------------
  # Models
  # --------------------------------------------------------
  # Model <mod1>
  mod1 = te.loadSBMLModel(os.path.join(workingDir, 'case_05.xml'))
  
  # --------------------------------------------------------
  # Tasks
  # --------------------------------------------------------
  # Task <task1>
  # Task: <task1>
  task1 = [None]
  mod1.setIntegrator('cvode')
  mod1.timeCourseSelections = ['[S1]', '[S2]', 'time']
  task1[0] = mod1.simulate(start=0.0, end=10.0, steps=100)
  
  # --------------------------------------------------------
  # DataGenerators
  # --------------------------------------------------------
  # DataGenerator <plot_0_0_0>
  __var__task1_____time = np.transpose(np.array([sim['time'] for sim in task1]))
  if len(__var__task1_____time.shape) == 1:
       __var__task1_____time.shape += (1,)
  plot_0_0_0 = __var__task1_____time
  
  # DataGenerator <plot_0_0_1>
  __var__task1_____S1 = np.transpose(np.array([sim['[S1]'] for sim in task1]))
  if len(__var__task1_____S1.shape) == 1:
       __var__task1_____S1.shape += (1,)
  plot_0_0_1 = __var__task1_____S1
  
  # DataGenerator <plot_0_1_1>
  __var__task1_____S2 = np.transpose(np.array([sim['[S2]'] for sim in task1]))
  if len(__var__task1_____S2.shape) == 1:
       __var__task1_____S2.shape += (1,)
  plot_0_1_1 = __var__task1_____S2
  
  # DataGenerator <plot_0_2_1>
  __var__task1_____S1 = np.transpose(np.array([sim['[S1]'] for sim in task1]))
  if len(__var__task1_____S1.shape) == 1:
       __var__task1_____S1.shape += (1,)
  __var__task1_____S2 = np.transpose(np.array([sim['[S2]'] for sim in task1]))
  if len(__var__task1_____S2.shape) == 1:
       __var__task1_____S2.shape += (1,)
  plot_0_2_1 = __var__task1_____S1 / __var__task1_____S2
  
  # DataGenerator <plot_2_0_0>
  __var__task1_____S1 = np.transpose(np.array([sim['[S1]'] for sim in task1]))
  if len(__var__task1_____S1.shape) == 1:
       __var__task1_____S1.shape += (1,)
  plot_2_0_0 = __var__task1_____S1 / np.max(__var__task1_____S1)
  
  # DataGenerator <plot_2_0_1>
  __var__task1_____S2 = np.transpose(np.array([sim['[S2]'] for sim in task1]))
  if len(__var__task1_____S2.shape) == 1:
       __var__task1_____S2.shape += (1,)
  plot_2_0_1 = __var__task1_____S2 / np.max(__var__task1_____S2)
  
  # --------------------------------------------------------
  # Outputs
  # --------------------------------------------------------
  # Output <plot_0>
  plt.figure(num=None, figsize=(9, 5), dpi=80, facecolor='w', edgecolor='k')
  from matplotlib import gridspec
  __gs = gridspec.GridSpec(1, 2, width_ratios=[3, 1])
  plt.subplot(__gs[0])
  for k in range(plot_0_0_0.shape[1]):
      if k == 0:
          plt.plot(plot_0_0_0[:,k], plot_0_0_1[:,k], marker = '.', color='r', linewidth=1.5, markersize=3.0, alpha=0.8, label='task1.S1')
      else:
          plt.plot(plot_0_0_0[:,k], plot_0_0_1[:,k], marker = '.', color='r', linewidth=1.5, markersize=3.0, alpha=0.8)
  for k in range(plot_0_0_0.shape[1]):
      if k == 0:
          plt.plot(plot_0_0_0[:,k], plot_0_1_1[:,k], marker = '.', color='b', linewidth=1.5, markersize=3.0, alpha=0.8, label='task1.S2')
      else:
          plt.plot(plot_0_0_0[:,k], plot_0_1_1[:,k], marker = '.', color='b', linewidth=1.5, markersize=3.0, alpha=0.8)
  for k in range(plot_0_0_0.shape[1]):
      if k == 0:
          plt.plot(plot_0_0_0[:,k], plot_0_2_1[:,k], marker = '.', color='g', linewidth=1.5, markersize=3.0, alpha=0.8, label='task1.S1/task1.S2')
      else:
          plt.plot(plot_0_0_0[:,k], plot_0_2_1[:,k], marker = '.', color='g', linewidth=1.5, markersize=3.0, alpha=0.8)
  plt.title('Example plot', fontweight='bold')
  plt.xlabel('task1.time', fontweight='bold')
  __lg = plt.legend(bbox_to_anchor=(1.05, 1), loc=2, borderaxespad=0.)
  __lg.draw_frame(False)
  plt.setp(__lg.get_texts(), fontsize='small')
  plt.setp(__lg.get_texts(), fontweight='bold')
  plt.savefig(os.path.join(workingDir, 'plot_0.png'), dpi=100)
  plt.show()
  
  # Output <report_1>
  __dfs__report_1 = []
  for k in range(plot_0_0_0.shape[1]):
      print('-'*80)
      print('report_1, Repeat:', k)
      print('-'*80)
      __df__k = pandas.DataFrame(np.column_stack([plot_0_0_0[:,k], plot_0_0_1[:,k], plot_0_1_1[:,k], plot_0_2_1[:,k]]), 
      columns=['task1.time', 'task1.S1', 'task1.S2', 'task1.S1/task1.S2'])
      print(__df__k.head(5))
      __dfs__report_1.append(__df__k)
      __df__k.to_csv(os.path.join(workingDir, 'report_1_{}.csv'.format(k)), sep='	', index=False)
  
  # Output <plot_2>
  plt.figure(num=None, figsize=(9, 5), dpi=80, facecolor='w', edgecolor='k')
  from matplotlib import gridspec
  __gs = gridspec.GridSpec(1, 2, width_ratios=[3, 1])
  plt.subplot(__gs[0])
  for k in range(plot_2_0_0.shape[1]):
      if k == 0:
          plt.plot(plot_2_0_0[:,k], plot_2_0_1[:,k], marker = '.', color='r', linewidth=1.5, markersize=3.0, alpha=0.8, label='task1.S2/max(task1.S2)')
      else:
          plt.plot(plot_2_0_0[:,k], plot_2_0_1[:,k], marker = '.', color='r', linewidth=1.5, markersize=3.0, alpha=0.8)
  plt.title('Normalized plot', fontweight='bold')
  plt.xlabel('task1.S1/max(task1.S1)', fontweight='bold')
  plt.ylabel('task1.S2/max(task1.S2)', fontweight='bold')
  __lg = plt.legend(bbox_to_anchor=(1.05, 1), loc=2, borderaxespad=0.)
  __lg.draw_frame(False)
  plt.setp(__lg.get_texts(), fontsize='small')
  plt.setp(__lg.get_texts(), fontweight='bold')
  plt.savefig(os.path.join(workingDir, 'plot_2.png'), dpi=100)
  plt.show()
  
  # Output <report_3>
  __dfs__report_3 = []
  for k in range(plot_2_0_0.shape[1]):
      print('-'*80)
      print('report_3, Repeat:', k)
      print('-'*80)
      __df__k = pandas.DataFrame(np.column_stack([plot_2_0_0[:,k], plot_2_0_1[:,k]]), 
      columns=['task1.S1/max(task1.S1)', 'task1.S2/max(task1.S2)'])
      print(__df__k.head(5))
      __dfs__report_3.append(__df__k)
      __df__k.to_csv(os.path.join(workingDir, 'report_3_{}.csv'.format(k)), sep='	', index=False)
  
  