title: Access FMU system variables during simulation
body: <p>I have a FMU which I am attempting to simulate in JModelica. The <code>input</code> parameter needs to refer to the current state of some of the variables in the JModelica FMU simulation. However, I'm having trouble accessing these.</p>
  
  <p>Reading the documentation, I would be given to believe that the functions <code>.get_variable_nominal()</code> or <code>.get()</code> would provide access to these, but this is not the case.</p>
  
  <p>The basic structure of the code is as follows:</p>
  
  <pre class="lang-py prettyprint-override"><code>from pyfmi import load_fmu
  model = none
  
  def inputFunction(t):
     global model
     # Get current state of desired variable(s)
     variable = model.some_function("object.variable_name")
     # Do some mathematical process to get input value
     input_value = foo(variable)
     return input_value
  
  def main():
      global model
      # FMU's input variables
      inputs = ["list", "of", "input", "variables"]
      # Get model from FMU file
      model = load_fmu("model_name.fmu")
      # Create input object for simulation method
      inputObj = (inputs, inputFunction)
  
      # Do some simulation
      opts = model.simulate_options()
      results = model.simulate(start_time=0, final_time=100.0, input=inputObj, options=opts)
  
  if __name__ == "__main__":
      main()
  </code></pre>
  
  <p>If in the place of <code>.some_function("object.variable_name")</code>, I use <code>.get_variable_nominal("object.variable_name")</code>, the function returns a float value of <code>1.0</code> (I seem to get different arbitrary values if I specify a different FMU variable). Whereas with <code>.get("object.variable_name")</code>, the error <code>FMUException: Failed to get the Real values.</code> is returned. The value I am expecting at the beginning of the simulation is a <code>float</code> value of approximately <code>303</code>.</p>
  
  <p>Note that the FMU simulation behaves correctly if run with fixed input values, so the correct values are indeed stored in the model.</p>
  
  <p>Thank-you to anyone who can help me understand what is going on here.</p>