fsolve problem appears regular
显示 更早的评论
Hello, I have a system of 2 equations defined in a function file: It takes a vector x =[x1 x2] and gives back F a vector.
function F = stepoli(x)
num = xlsread('constants.xlsx');
lam = num(2,:)*1d-9;
Ai = num(1,:)*1d6;
rg = num(5,:);
m = 39.948*6.02214086d-26;
T = 600;
k = 1.38064852*1d-23;
for i = 1:8
l(i) = (lam(i)^3)/(8*pi)*Ai(i)*rg(i)*sqrt(m/(2*pi*k*T)); %l around 1d-15
end
R = [ 1.4 1.2];
F(1) = 1-l(1)*1d-3*x(1)+l(2)*x(2) - R(1)*(1-l(2)*x(2)*1d-3 +l(1)*x(1) - l(1)*x(1)*l(2)*x(2)*1d-3);
F(2) = 1-l(4)*1d-3*x(2)+l(5)*x(2) - R(2)*(1-l(5)*x(2)*1d-3 +l(4)*x(1) - l(4)*x(1)*l(5)*x(2)*1d-3);
end
Then in a script i have
g = @stepoli;
x0 = [10d15 10d15];
x = fsolve(g,x0)
If as x0 I input a solution, it does say it is one. However, as soon as I start from a very close point, it returns:
No solution found.
fsolve stopped because the problem appears regular as measured by the gradient, but the vector of function values is not near zero as measured by the default value of the function tolerance.
And doesn't do any step. Do you know if the problem comes from this gradient or from elsewhere? Maybe you do have some optimization advices. Thanks for reading.
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Systems of Nonlinear Equations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!