New EcosimPro adding for Microsoft Excel

Fernando Puech. EcosimPro Development Team

EcosimPro 5.2 includes a new complement for Excel that also gives COM access to any model developed in EcosimPro. In other words, you can access an EcosimPro model from any software program written in VB, VBA, VB.NET, C#, C++, Python, etc. The new complement works with any EcosimPro-compatible compiler, from CGG to Microsoft Visual Studio 2010, which was not the case in previous versions. The compatibility does not end there, since the complement has been developed to work with Microsoft Excel 2003, 2007, 2010 and 2013 and on the Microsoft Windows XP, Windows Vista, Windows 7 and Windows 8 operating systems.

The aim when developing the new complement was to make it easier to use, install and set up. The user of the complement only has to install it once, and then choose which EcosimPro installation he wants to use. This step saves the user from having to modify environment variables, with the risks that entails. The speed of the complement has been greatly improved since the earlier versions.

The EcosimPro user interface in Windows 7 and with Microsoft Excel 2010 is as follows:

EN-FPE_1Figure 1. Toolbar in the EcosimPro complement for Excel

The above toolbar can be used to:

  • Simulate the model exactly as defined in EcosimPro (Play button).
  • Pause the simulation.
  • Stop the simulation.
  • Run a transient in the model in whatever time interval the user wants (“New integration”).

EN-FPE_2Figure 2. Creation of a custom integration

  • Carry out a stationary calculation for the current moment (“New steady state”).
  • Save the simulation status, i.e., save the values of the variables in a file.
  • Load the values of the variables using a file of a previously saved state.
  • Reset the model to the initial situation.
  • Associate cells to variables of the model (“watches”) to see how a variable evolves during the simulation and/or to modify values of some of the variables in the model. Values can only be modified when the simulation is paused or stopped; when restarted, the model will continue but using the new values of the variables.

EN-FPE_3Figure 3. Dialogue to associate variables to cells in Excel

EN-FPE_4Figure 4. Associated cells

  • Generate reports on variables that consist of Excel sheets containing the values of a set of variables for each moment in time in the simulation. The user can then use these reports to create graphs. The Figure 4 shows the dialog for choosing variables to produce a report, while Figure 5 shows the report produced.

EN-FPE_5Figure 5. Dialog for creating reports

EN-FPE_6Figure 6. Report created using the “Report” dialog. The results are refreshed every time the simulation is run and the model informs us that it has new data.

The functions of the EcosimPro complement for Excel are flexible enough to generate Excel books as complex as the user wishes. For example, the following figures show the result of a set of simulations. The model depicts a tungsten plate in contact with a gas and the Excel sheet shows the evolution of concentration, pressures and compositions of the gas and the plate. The Figure 6 shows the result of having used association of variables of the model to Excel cells (“watches”), the use of reports that will provide data for graphs and the simulation of the model as developed in EcosimPro. One of the main advantages of this complement for Excel is that it can be used to modify the variables in the model, and therefore make configuring the simulation as easy as associating a cell to a variable and modifying the value in the cell. When the simulation resumes, that variable will take the value stated by the user.

EN-FPE_7Figure 7. Simulation of the default case

The power of the EcosimPro complement for Microsoft Excel is not confined to the toolbar, since it allows accessing the model via COM. In other words, the user may customize his spreadsheet using macros and basing it on the documentation of the functions of the COM interface, as well as the examples of the documentation from EcosimPro.

EN-FPE_8Figure 8. Documentation of the functions of the COM interface of the complement in Excel’s Visual Basic editor.

This article has given a brief description of the possibilities offered by the new EcosimPro toolbar for Microsoft Excel. As can be seen, the only limit is up to the user when developing a calculation book in Microsoft Excel that runs on information from a model developed in EcosimPro.