'How to write results from simulate to a csv file and import them for parmest

I am new with Pyomo, and I am starting with some examples available. One of the applications I would like to handle with Pyomo is parameter estimation especially from DAE models.

My questions are:

  1. how to save the data obtained from a simulation (using the Simulator) to a .csv file? Here, data are the time instants and the solution profiles;
  2. how to import a .csv file for parameter estimation? Any suggestions are welcome.


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source