Unable to solve nonlinear equation using fsolve as the message shows No solution found
Show older comments
function F = FeMnC660newuipffc(x)
F(1) =-9.135789053E+00-log(x(1))+166.2509975*x(1)+5.84074229*x(2)+(-166.2509975*x(1)^2)/2-5.84074229*x(1)*x(2)+(-19.52527074*x(2)^2)/2;
F(2) =-3.51500942E+00-log(x(2)) +5.84074229*x(1)+19.52527074*x(2)+(-166.2509975*x(1)^2)/2-5.84074229*x(1)*x(2)+(-19.52527074*x(2)^2)/2;
end
unable to solve this equation using fsolve as the message shows
No solution found.
fsolve stopped because the last step was ineffective. However, the vector of function
values is not near zero, as measured by the value of the function tolerance.
Kindly help me out
Accepted Answer
More Answers (2)
Alan Stevens
on 6 Feb 2023
Edited: Alan Stevens
on 6 Feb 2023
fminsearch makes a reasonable attempt:
F1 = @(a,b) -9.135789053E+00-log(a)+166.2509975*a+5.84074229*b+...
-166.2509975*a^2/2-5.84074229*a*b-19.52527074*b^2/2;
F2 = @(a,b) -3.51500942E+00-log(b)+5.84074229*a+19.52527074*b+...
-166.2509975*a^2/2-5.84074229*a*b-19.52527074*b^2/2;
F = @(x) norm(F1(x(1),x(2))) + norm(F2(x(1),x(2)));
opt = optimset('TolFun', 1E-15);
x0 = [1, 1];
[x, fval] = fminsearch(F, x0, opt);
disp(x)
disp(fval)
1 Comment
Vikash Sahu
on 7 Feb 2023
You haven't shown how the optimization was executed. fsolve appears to work fine below:
opt = optimoptions('fsolve', 'FunctionTol',1E-15,'OptimalityTol',1e-15,'StepTol',1e-15);
x0 = 100*rand(1,2);
[x, fval] = fsolve(@FeMnC660newuipffc, x0, opt)
function F = FeMnC660newuipffc(x)
F(1) =-9.135789053E+00-log(x(1))+166.2509975*x(1)+5.84074229*x(2)+(-166.2509975*x(1)^2)/2-5.84074229*x(1)*x(2)+(-19.52527074*x(2)^2)/2;
F(2) =-3.51500942E+00-log(x(2)) +5.84074229*x(1)+19.52527074*x(2)+(-166.2509975*x(1)^2)/2-5.84074229*x(1)*x(2)+(-19.52527074*x(2)^2)/2;
end
1 Comment
Vikash Sahu
on 7 Feb 2023
Categories
Find more on Solver Outputs and Iterative Display in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!