22. September 2020

Interval Evaluation Of The Transfer Report

Interval Evaluation Of The Transfer Report

In this tip, we show you how to automatically compute data via VBA with the help of INOSIM-generated reports to gain more understanding about your process.

Besides the INOSIM Gantt Chart, the automatic Excel Reports created via the user interface offer a great way to access your simulation results. For example, the report Transfers gives a complete list of all transfers involving a specific unit and includes details like mass flow.

Assuming a water tank that distributes water to many different other units, an in-process flow meter will give you a list of the total flow rate in discrete time steps in fixed intervals, e.g., every 15 min.

For model validation you might want to create similar data from your existing simulation model for comparison with existing data. The total flow rate at any given point in time is calculated as the sum of all active transfers from the transfer report at that time. What is the total flow rate of the tank at 11:30? This is not easily done by hand – what about using a VBA script?

Screenshot: Transfer Report in Excel

In another tip, the reporting object was used to access the unit utilization and resource allocation reports in VBA. Of course, the transfer report can also be accessed in VBA (within the EndSim procedure):

Reporting.UnitTransfers(Units("Tank"))

The demo project includes three useful functions:

  • massflow_intervals
  • ressource_intervals
  • Write_Table (Read this tip for further explanations about this function)

Evaluation of the Transfer Report

The function Massflow_Intervals uses the report to create a table object with time stamps and related values for the total in-going (positive) and out-going (negative) flow rates, as well as the sum of in- and outgoing flow rate. The content of the table object can be written into an excel sheet, which yields the following result:

Screenshot: Excel sheet with mass flow rates

The above question “What is the total flow rate from the tank at 11:30?” can now easily be answered: 2.01 kg/s.

To generate the table the function is used as follows:

Function massflow_intervals (u As Unit, Interval As Double, _ 
 Optional StartDate As Double, Optional EndDate As Double) As Table

The function requires a unit object (e.g., the tank) and an interval between time points (e.g., 300 seconds), optionally a start and end date for the period you want to evaluate. If the start or end date are omitted the simulation reference date or the current simulation date will be used respectively.

The function must be called in the EndSim procedure; before this point in the simulation the Reporting object is unavailable. Use the Write_Table function from tip Applying Table Objects to write the table into an Excel sheet, or use your own method.

Set t_massflow_intervals = massflow_intervals(Units("Tank"),5*60)
Write_Table(t_massflow_intervals,0,1,0,0,"Tank Intervals",1,1)

The resulting values can also be plotted to give an overview of the transfer flow rates:

Line Chart: Mass Transfers over time

Please note that you might overlook peak flow rates for durations shorter than the chosen interval.

Evaluation of the resource allocation

The function resource_intervals performs analog evaluations for resource allocation reports.

Downloads

  • Example Project (For registered INOSIM Users only)

More Questions?

Want to know more about this topic or have another question? Please contact us!

More Tips & Tricks

4. October 2019

Applying Table Objects

Applying Table Objects Table objects in INOSIM are indexed tables. By the row or column headline, you can directly access a cell’s content without having…

16. March 2019

Custom Bars

Custom Bars Custom bars are a new feature introduced in INOSIM 12. They allow you to display processes in your Gantt chart which are not…

Graphical auxiliary functions give live to your plant layout: By animation, you dynamically display filling level changes, transport movements of objects, or the status of…

more

INOSIM Support

During usual business hours

Germany +49 231 97 00 250

USA +1 214 663 3101

support@inosim.com