IDA convergence failure at simulation start

Hi all,

I have been seeing an error when running simulations for a system containing two components (pH and salt) which are both treated as non-binding (isotherm is NoneBinding) where the inlet profile is given. The simulation is running these components through a PFR (lumped rate without pores) and column (GRM). The error I receive (see below) is not consistently reproducible - for example, ~2/10 simulations (with identical inputs) crash. It happens at the very start of the simulation when assembling the initial conditions. I am pretty confident all the code (using MATLAB for this) is correct because my simulations perform as expected when it doesn’t crash. Worth noting that after the simulation crashes, additional simulations will not run in that MATLAB window - maybe because the instance of CADET it is tied to gets stuck? So then I open a new window and try again, hoping for the best that it runs, which is inconvenient. I have tried changing the tolerances and other time integrator settings, but this didn’t help address the problem.

Error
Error in simulation: Error in IDASolve: IDA_CONV_FAIL at t = 0.000000

Any tips on how to address this would be greatly appreciated.

Thanks,
Scott

Hey Scott,

does that also happen if you save your simulation as .h5 file and run it with cadet-cli?

Best,
Sam

Hey Sam,

I am actually doing these simulations in MATLAB since I am obtaining the input pH/salt profiles from a separate MATLAB-based routine. Is there a way I can run the MATLAB script using cadet-cli?

Before you run() the simulation in Matlab, you can also save an equivalent .h5 file using saveAsHDF5().

Got it. Didn’t know you could save it as h5, that’s pretty neat. How do you run the h5 file with cadet-cli?

Replacing your_simulation_file with the actual name, in the terminal run:

cadet-cli your_simulation_file.h5

Thanks Johannes and Sam, I will try this to see if it fixes the problem.

All the best,
Scott