General Question about Exporting Results from Simulations

Hi there,

I am running simulations with CADET-Process and I would like to export the chromatograms (e.g. as np.arrays). I am only modeling one unit operation (chromatographic column), so I have input, column and outlet). I store the results in the object simulation_results as:

simulator = Cadet()
simulation_results = simulator.simulate(process)

You will see I have quite a lot of questions below, since I really want to understand how Cadet works and export my results as accurate as possible. I hope no one gets overwhelmed by answering to this issue :stuck_out_tongue_closed_eyes: :see_no_evil:

  • List item
  • First question, is there any direct method associated with exporting the chromatogram data? (similar as there is the .plot() function and the @plotting.create_and_save_figure decorator for exporting the chromatograms figures)

  • I’ve seen that withinin the simulation_results.solution.column.outlet object the results are stored. However, I have some questions since I see that there are several attributes stored within this class:

image

  • Which are the differences between solution and solution_original? The times associated with these two should be time and time_original, respectively?

  • What about the values stored in solution_interpolated? are they used somewhere (during the simulation, plotting,…)?
    While trying to understand how these values were calculated I saw the following:
    I have 4 components, and inside solution_interpolated.solutions I have 4 lists. At the same time inside each list I have the array c (with [4,1] shape) and x (which I assume it’s time)

c has shape [4, 5000], however x [5001, 1]

Is there some documentation about the type of interpolation method used here?

  • As far as I remember from the Cadet Workshop 2022, the default discretization in Cadet is 1 axial cell per second. Is this correct? How could I tune this parameter?

  • I am seeing the array I get from .solution matches with .total_concentration_components. Is this because I only have 1 unit operation in my example? or is there some difference between them?

Finally, my Pycharm console in debug mode was crushing all the time whenever I extend the visualization for some variables, the session broke under this error:

Process finished with exit code -1073741819 (0xC0000005)

Did someone ever experience this?
I am assuming this is happening because simulation_results is a very heavy object, but I would like to hear if this is common/expected.

Thank you very much for taking your time in answering my questions!!

Have a nice evening,
Ignasi

No, we would have to decide on some (binary?) format. Also, it’s not necessarily a good idea to separate the raw output data from its source because then you lose the context in which it was created. But we could consider it if there are some good reasons / ideas on how to do that properly.

Since the SolutionIO (and other Solution classes) also provide methods for interpolation, normalization, splicing etc, we want to make sure that we always keep the original data s.t. we can reset if required.

It is used, for example, when comparing to reference data, you need to make sure that both simulation and experiment are on the same grid. In addition, it is required when creating fractions for specific time intervals.

The interpolated_solution is a custom class that allows simultaneous interpolation for all components, since scipy does not provide a method to interpolate for multiple entries simultaneously. Internally, it uses scipy’s PchipInterpolator so I don’t fully know what they use x and c for. Here maybe a question to you, what information do you actually need?

By default, we use 100 cells for the axial discretization (assuming you’re using the finite volume scheme). You can change this for each unit operation (see here). Time resolution is handled by the simulator (see here). Default resolution is 1 second.

The total_concentration_components is only useful when you have defined subspecies for your ComponentSystem.

I haven’t seen this one before. Please provide an MRE s.t. we can get to the root of it.
How large is your simulation? While definitely not a light object, I haven’t had too many issues with the SimulationResults class.

1 Like