# Bi-Langmuir q-profiles

**URL:** <https://forum.cadet-web.de/t/bi-langmuir-q-profiles/1406>\
**Category:** Chromatography Modeling\
**Created:** [March 6, 2026, 4:25pm UTC](https://forum.cadet-web.de/t/bi-langmuir-q-profiles/1406 "2026-03-06T16:25:23Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ollie\_p](https://forum.cadet-web.de/letter_avatar_proxy/v4/letter/o/858c86/32.png) [@ollie\_p](https://forum.cadet-web.de/u/ollie_p)\
**Post date:** [March 6, 2026, 4:25pm UTC](https://forum.cadet-web.de/t/bi-langmuir-q-profiles/1406/1 "2026-03-06T16:25:23Z")

</div>

Hello,

I am trying to capture the data on the solid phase concentrations for a case with A and B under various inlet conditions. I can produce plots for outlet concentration but I cannot work out how to get the data of q. My working code is:

```auto
#%% (A)

import numpy as np
import matplotlib.pyplot as plt

from CADETProcess.processModel import ComponentSystem
from CADETProcess.processModel import BiLangmuir
from CADETProcess.processModel import (
    Inlet, LumpedRateModelWithoutPores, Outlet
)
from CADETProcess.processModel import FlowSheet, Process

C_in = [[7.5, 7.5], [10, 10], [15, 15]]

c_store = []
q_store = []

for i in range(len(C_in)):

    component_system = ComponentSystem()
    component_system.add_component('A')
    component_system.add_component('B')

    # --------------------------------------------------------
    # Bi-Langmuir binding model
    # --------------------------------------------------------

    binding_model = BiLangmuir(component_system, n_binding_sites=2, name='langmuir')
    binding_model.is_kinetic = True
        
    binding_model.adsorption_rate = [0.015, 0.03, 0.02, 0.035]
    binding_model.desorption_rate = [1, 1, 1, 1]
    binding_model.capacity = [100, 100, 100, 100]

    print('hi 1')
    # --------------------------------------------------------
    # Column system
    # --------------------------------------------------------

    feed = Inlet(component_system, name='feed')
    feed.c = C_in[i]

    eluent = Inlet(component_system, name='eluent')
    eluent.c = [0, 0]

    column = LumpedRateModelWithoutPores(component_system, name='column')
    column.binding_model = binding_model
    column.length = 0.6
    column.diameter = 0.024
    column.axial_dispersion = 4.7e-6
    column.total_porosity = 0.65

    column.solution_recorder.write_solution_bulk = True

    outlet = Outlet(component_system, name='outlet')

    flow_sheet = FlowSheet(component_system)

    flow_sheet.add_unit(feed, feed_inlet=True)
    flow_sheet.add_unit(eluent, eluent_inlet=True)
    flow_sheet.add_unit(column)
    flow_sheet.add_unit(outlet, product_outlet=True)

    flow_sheet.add_connection(feed, column)
    flow_sheet.add_connection(eluent, column)
    flow_sheet.add_connection(column, outlet)

    process = Process(flow_sheet, 'batch elution')
    print('hi 2')
    # --------------------------------------------------------
    # Events
    # --------------------------------------------------------

    Q = 60 / (60 * 1e6)

    process.add_event('feed_on', 'flow_sheet.feed.flow_rate', Q)
    process.add_event('feed_off', 'flow_sheet.feed.flow_rate', 0.0)

    process.add_event('eluent_on', 'flow_sheet.eluent.flow_rate', Q)
    process.add_event('eluent_off', 'flow_sheet.eluent.flow_rate', 0.0)

    process.add_duration('feed_duration')

    process.add_event_dependency('eluent_on', ['feed_off'])
    process.add_event_dependency('eluent_off', ['feed_on'])
    process.add_event_dependency('feed_off', ['feed_on','feed_duration'], [1,1])

    process.cycle_time = 750
    process.feed_duration.time = 60
    print('hi 3')
    # --------------------------------------------------------
    # Run CADET
    # --------------------------------------------------------
    print(binding_model.n_binding_sites)
    print(binding_model.n_bound_states)
    if __name__ == " __main__":
        from CADETProcess.simulator import Cadet
        print('hi 4')
        process_simulator = Cadet()
        print('hi 5')
        simulation_results = process_simulator.simulate(process)
        print('hi 6')
    # --------------------------------------------------------
    # Extract outlet solution
    # --------------------------------------------------------

    outlet_solution = simulation_results.solution.column.outlet
    solid_solution = simulation_results.solution.column.solid

    t_full = outlet_solution.time
    c = outlet_solution.solution

    c_store.append(c)

    solid_solution = simulation_results.solution.column.solid
    q_store.append(solid_solution.solution)

c_store = np.array(c_store)
#q_store = np.array(q_store)

print("DATA GENERATED\n")

plt.figure(figsize=(8,6))

for i in range(len(C_in)):

    c = c_store[i]

    cA = c[:,0]
    cB = c[:,1]

    plt.plot(t_full, cA, label=f"A dataset {i}")
    plt.plot(t_full, cB, '--', label=f"B dataset {i}")

plt.xlabel("Time (s)")
plt.ylabel("Outlet concentration")
plt.title("Outlet Chromatograms (Bi-Langmuir)")
plt.legend()
plt.grid()

plt.show()

```

When I add the line:

```auto
column.solution_recorder.write_solution_solid = True

```

I get the error:

```auto
ValueError: Expected size (751, 100, 2)

```

Which comes after (during the first iteration of the loop):

```auto
hi 1
hi 2
hi 3
2
4
hi 4
hi 5

```

I have also tried using (to the same result):

```auto
column.solution_recorder.write_solution_bound

```

I put all the print(‘hi n’) in to indicate where the code reaches. Note: hi 6 is never printed when i get the error.

Any ideas?

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:** [March 8, 2026, 5:22pm UTC](https://forum.cadet-web.de/t/bi-langmuir-q-profiles/1406/2 "2026-03-08T17:22:58Z")

</div>

Hi Ollie,

thanks for reaching out. Your issue seems to have been fixed in [this PR](https://github.com/fau-advanced-separations/CADET-Process/pull/289), so if you use our `dev` branch, your script should run.

To install it, run the following:

```auto
pip install git+https://github.com/fau-advanced-separations/CADET-Process.git@dev

```

Note, I hope that we can soon make a new release which includes this fix.

Cheers,

Jo

---

<div class="post-metadata">

**Author:** ![ollie\_p](https://forum.cadet-web.de/letter_avatar_proxy/v4/letter/o/858c86/32.png) [@ollie\_p](https://forum.cadet-web.de/u/ollie_p)\
**Post date:** [March 9, 2026, 12:05pm UTC](https://forum.cadet-web.de/t/bi-langmuir-q-profiles/1406/3 "2026-03-09T12:05:46Z")

</div>

Hi Jo,

Ok thank you for the response! I have installed this but the code still does not record any solids. What lines in my code do I actually need to change?

Kind regards,

Ollie

---

<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:** [March 9, 2026, 12:07pm UTC](https://forum.cadet-web.de/t/bi-langmuir-q-profiles/1406/4 "2026-03-09T12:07:47Z")

</div>

Hi,

if you add

```auto
column.solution_recorder.write_solution_solid = True

```

then

```auto
simulation_results.solution.column.solid

```

will contain the solid solution.

---

<div class="post-metadata">

**Author:** ![ollie\_p](https://forum.cadet-web.de/letter_avatar_proxy/v4/letter/o/858c86/32.png) [@ollie\_p](https://forum.cadet-web.de/u/ollie_p)\
**Post date:** [March 23, 2026, 12:47pm UTC](https://forum.cadet-web.de/t/bi-langmuir-q-profiles/1406/5 "2026-03-23T12:47:19Z")

</div>

Sorry this still does not work but it is not of high importance for me to fix right now it was more curiosity, I will try again when the bug is patched 🙂
