diff --git a/liionpack/solver_utils.py b/liionpack/solver_utils.py index d9474965..693c1fc8 100644 --- a/liionpack/solver_utils.py +++ b/liionpack/solver_utils.py @@ -319,7 +319,9 @@ def _create_casadi_objects(inputs, sim, dt, Nspm, nproc, variable_names, mapped) integrator = integrator.map(Nspm, "thread", nproc) # Variables function for parallel evaluation - casadi_objs = sim.built_model.export_casadi_objects(variable_names=variable_names) + casadi_objs = sim.built_model.export_casadi_objects( + variable_names=variable_names, input_parameter_order=inputs[0].keys() + ) variables = casadi_objs["variables"] t, x, z, p = ( casadi_objs["t"], @@ -337,7 +339,9 @@ def _create_casadi_objects(inputs, sim, dt, Nspm, nproc, variable_names, mapped) event_vars = [v for v in all_vars if "Event" in v] if len(event_vars) > 0: # Variables function for parallel evaluation - casadi_objs = sim.built_model.export_casadi_objects(variable_names=event_vars) + casadi_objs = sim.built_model.export_casadi_objects( + variable_names=variable_names, input_parameter_order=inputs[0].keys() + ) events = casadi_objs["variables"] t, x, z, p = ( casadi_objs["t"],