Use acados to form optimized problem with dual variables and external cost function

Hi~ First of all , thanks for providing examples to get started with acados. i have gone through all the cases carefully, but still failed to form my optimized problem. i am trying to solve the following problem:
My cost function has some difference with the above formula. i tried using control varibles to store lambdas and mius which is dual variables. and using algebraic variables to store the d_min.
It output log like “error: ocp_nlp_cost_external_dims_get: attempt to get dimensions of non-existing field ny” when run with python, i don‘’t know what goes wrong. maybe i have some misconceptions about the acados cost function.

The complete codes is in the attachment below

Thanks in advance!

Hello, I also encountered a similar problem. Has this issue been resolved?