我对朱莉娅很陌生。我正在尝试求解一个非线性方程组,以找到一个向量(p_new
)。下面是我的问题的简化版。问题是我收到以下消息:"ERROR: MethodError: no method matching zero(::, Type{Any})"
。我不确定是否是因为初始条件定义不明确。预先感谢!
p_1 = [ 1, 2, 2.3]
p_1b = [ 1, 2.2, 2.5]
mgc = [1, 1, 0.5]
theta = 0.8
OW1 = [0 1 0; 1 1 1; 0 0 1]
g = ones(3,1)
function pupdate!(p_1,mgc,theta,OW1)
delt = p_1.*theta
delt = 2.718281828459.^delt
Sp1 = sum(delt)
sp1 = delt./Sp1
markup = p_1 .- mgc
sp1 .= markup
end
g0 = [p_1b, mgc, theta, OW1]
p_new = nlsolve(pupdate!, g0)