I think you posted this in the wrong thread, I gave you the answer at The value of the variable in the optimization process is inconsistent with the calculation result of the optimization result . Although I think you needed to also declare rate
as an expression (holder).