Fitting of parameter with co-dependency for another parameter

Hi everyone,

I am currently running fits in CADET-Process (optimizer = U_NSGA3()) of a parameter (length_1) which is used in the model script to calculate a further parameter (length_2 = length_total - length_1). Since length_2 is defined in the kernel running the simulation, it will not be redefined for the fitting but will keep its default value, correct?
But for a correct fitting, I would need length_2 to be updated depending on length_1 for every generation of the fit. Is there a way to do this in CADET-Process? I already copied the line of subtraction (length_2 = length_total - length_1) into the optimizer kernel and it is running but I am not sure how to interpret the results or whether length_2 really gets updated in each generation …

Thanks in advance
Nils

Is this doable using the linear constraint function?

https://cadet-process.readthedocs.io/en/v0.9.1/reference/generated/CADETProcess.optimization.OptimizationProblem.add_linear_constraint.html#CADETProcess.optimization.OptimizationProblem.add_linear_constraint

Hello Nils,

our CADET-Process developers are on vacation right now, but one of them will be back later next week.

Best regards,
Jan

Hi Nils,

if I understood your problem statement correctly, you could solve it by adding a parameter dependency.

So first, you add both variables:

total_length = 3.14
optimization_problem.add_variable('length_1', lb=0, ub=total_length)
optimization_problem.add_variable('length_2', lb=0, ub=total_length)

Then, you add the dependency:

def transform_fun(length_1):
    return total_length - length_1

optimization_problem.add_variable_dependency('length_2', ['length_1'], transform=transform_fun)

In any case it would be very helpful if you could give us access to your code.

Cheers,

Jo

1 Like