lmfit拟合多参数的分段函数提示NumPy boolean array错误

请问用lmfit拟合多参数的分段函数时,出现NumPy boolean array indexing assignment cannot assign 39 input values to the 25 output values where the mask is true提示是什么原因?

img

我发现了是因为以下原因,即赋值的数组大于待赋值的数组长度,但vals长度是正确的,为什么经过func计算之后就变长了?

img

输入和输出数据的维度不匹配,调一下看看