# Dynamic volume flow rate from data

**URL:** <https://forum.cadet-web.de/t/dynamic-volume-flow-rate-from-data/415>\
**Category:** Chromatography Modeling\
**Created:** [November 15, 2021, 5:30pm UTC](https://forum.cadet-web.de/t/dynamic-volume-flow-rate-from-data/415 "2021-11-15T17:30:03Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![p.jans](https://forum.cadet-web.de/letter_avatar_proxy/v4/letter/p/35a633/32.png) [@p.jans](https://forum.cadet-web.de/u/p.jans)\
**Post date:** [November 15, 2021, 5:30pm UTC](https://forum.cadet-web.de/t/dynamic-volume-flow-rate-from-data/415/1 "2021-11-15T17:30:03Z")

</div>

Hello everyone,

Since Cadet version 4.3.0 allows modelling of dynamic flow rates i am trying to implement a dynamic volume flow rate via time step from a dataset.  
My profil data is stored in a “.csv” file. The first column are time points and the second column is the volume flow rate. Via the cubic function in the “CONNECTION GROUP” i want to evaluate the volume flow at a given time as well as linear interpolate values between timepoints by the “LINEAR FLOW RATE COEFFICIENT”.  
Here is the part of the sourcecode:

```auto
 ####### Sections and Switches #######

volume_flow_profile = np.loadtxt('D:path_to_/volume_flow_profile.csv', delimiter=',')

time = volume_flow_profile[:,0]
volume_flow = volume_flow_profile[:,1]
    
n_sections = len(time)-1
section_times = [time[0]]

for i in range(n_sections):

        switch_index = 'switch_{0:03d}'.format(i)

        flow = volume_flow[i]
        slope = (volume_flow[i+1] - volume_flow[i]) / (time[i+1] - time[i])

        model.root.input.model.connections[switch_index].section = i
        model.root.input.model.connections[switch_index].connections = [
            
            0, 1, -1, -1, flow, slope, 0, 0,
            1, 2, -1, -1, flow, slope, 0, 0
        ]
        
        section_times.append(time[i+1])   
    
model.root.input.model.connections.connections_include_dynamic_flow = 1
model.root.input.solver.sections.nsec = n_sections
model.root.input.solver.sections.section_times = section_times model.root.input.solver.sections.section_continuity = [0]        
model.root.input.model.connections.nswitches = n_sections-1                                                                                 

```

The simulation is running without error but the result is not correct and I want to ask if:

1. Maybe the ‚CONNECTIONS\_INCLUDE\_PORTS‘ should be active or
2. Probably there is something wrong with the ‚valve configuration‘ ?

Furthermore the Inlet concentration (c\_feed) should be conctant:

```auto
model.root.input.model.unit_000.sec_000.const_coeff = c_feed

```

Because of nsec = n\_sections (\>1), i tried to replace the inlet concentration by:

```auto
model.root.input.model.unit_000[switch_index].const_coeff = c_feed

```

and inserting it in the for loop. But the result seems to be the same.

I would really appreciate it if someone could help me.  
Thanks in advance.

---

<div class="post-metadata">

**Author:** ![j.schmoelder](https://forum.cadet-web.de/user_avatar/forum.cadet-web.de/j.schmoelder/32/93_2.png) [@j.schmoelder](https://forum.cadet-web.de/u/j.schmoelder)\
**Post date:** [November 16, 2021, 9:19am UTC](https://forum.cadet-web.de/t/dynamic-volume-flow-rate-from-data/415/2 "2021-11-16T09:19:00Z")

</div>

Hello Pit,

at first glance this looks alright. Could you please provide the csv file, as well as the rest of the model?

Also, it would be helpful to know what exactly you would expect to change. If the inlet concentration profile is constant, you will also “measure” a constant concentration, regardless of the flow rate. Only if there are dynamic changes (depending on initial conditions and boundary conditions) will the flow rate have an effect. For this, we need more information about your system.

Best

Johannes

---

<div class="post-metadata">

**Author:** ![p.jans](https://forum.cadet-web.de/letter_avatar_proxy/v4/letter/p/35a633/32.png) [@p.jans](https://forum.cadet-web.de/u/p.jans)\
**Post date:** [November 16, 2021, 2:45pm UTC](https://forum.cadet-web.de/t/dynamic-volume-flow-rate-from-data/415/3 "2021-11-16T14:45:11Z")

</div>

Hello Johannes,

You are absolutely right. Honestly, it was a mistake from my side and i “measured” the constant concentration which obviously is not influenced by the dynamic flow rate. I am sorry for the confusion.

Kind Regards  
Pit

---

<div class="post-metadata">

**Author:** ![j.schmoelder](https://forum.cadet-web.de/user_avatar/forum.cadet-web.de/j.schmoelder/32/93_2.png) [@j.schmoelder](https://forum.cadet-web.de/u/j.schmoelder)\
**Post date:** [November 16, 2021, 3:17pm UTC](https://forum.cadet-web.de/t/dynamic-volume-flow-rate-from-data/415/4 "2021-11-16T15:17:04Z")

</div>

Happy I could help! 🥳

---

<div class="post-metadata">

**Author:** ![nyousuf](https://forum.cadet-web.de/letter_avatar_proxy/v4/letter/n/4491bb/32.png) [@nyousuf](https://forum.cadet-web.de/u/nyousuf)\
**Post date:** [February 17, 2026, 9:40am UTC](https://forum.cadet-web.de/t/dynamic-volume-flow-rate-from-data/415/5 "2026-02-17T09:40:54Z")

</div>

Hi.

Could anyone let me know how to plot the Dynamic flow rate as a function of time. Is this something that CADET usually outputs, apart from Concentration profiles? Thanks

---

<div class="post-metadata">

**Author:** ![j.schmoelder](https://forum.cadet-web.de/user_avatar/forum.cadet-web.de/j.schmoelder/32/93_2.png) [@j.schmoelder](https://forum.cadet-web.de/u/j.schmoelder)\
**Post date:** [February 17, 2026, 9:42am UTC](https://forum.cadet-web.de/t/dynamic-volume-flow-rate-from-data/415/6 "2026-02-17T09:42:30Z")

</div>

Hi,

yes, this is possible. You can use `Events` in **CADET-Process** to modify the `flow_rate` of `Inlet` unit operations. You can also add a full profile from a time series (see [here](https://cadet-process.readthedocs.io/en/latest/user_guide/process_model/process.html#generating-inlet-profiles-from-existing-data)).

---

<div class="post-metadata">

**Author:** ![nyousuf](https://forum.cadet-web.de/letter_avatar_proxy/v4/letter/n/4491bb/32.png) [@nyousuf](https://forum.cadet-web.de/u/nyousuf)\
**Post date:** [February 18, 2026, 6:14am UTC](https://forum.cadet-web.de/t/dynamic-volume-flow-rate-from-data/415/7 "2026-02-18T06:14:34Z")

</div>

Thank you. How do you achieve the same via Cadet - Python?

---

<div class="post-metadata">

**Author:** ![h.lanzrath](https://forum.cadet-web.de/user_avatar/forum.cadet-web.de/h.lanzrath/32/1186_2.png) [@h.lanzrath](https://forum.cadet-web.de/u/h.lanzrath)\
**Post date:** [February 18, 2026, 9:22am UTC](https://forum.cadet-web.de/t/dynamic-volume-flow-rate-from-data/415/8 "2026-02-18T09:22:01Z")

</div>

Hi nyousuf,

In `CADET-Python`, you can access the flow rates via the `CONNECTIONS` parameter in the `input` group, under `model.connections.switch_XXX`. These entries define the connections between units and the corresponding volumetric flow rates for each switch state.

To plot the flow rates over time, you need to determine which switch is active at each time point based on the section times and then extract the flow rates from the corresponding `switch_XXX`. This is not handled automatically in `CADET-Python`, so you would need to write helper functions for it, which `CADET-Process` does under the hood as well.

For more details on the structure of `CONNECTIONS`, see the CADET documentation:  
[https://cadet.github.io/v5.1.X/interface/system.html#group-input-model-connections-switch-xxx](https://cadet.github.io/v5.1.X/interface/system.html#group-input-model-connections-switch-xxx)

Best,  
Hannah
