What are solver best settings for my non linear equations?

3 次查看(过去 30 天)
Hello,
I have a set of non-linear equations that I would like to solve using fsolve, shown below in WandG function. Solver solutions are far away from the ones I would expect, I am expecting something alike x(1) = 10 and x(2)=0.11. Therefore, I would be glad if someone could give me some better directions of how to set up the options, especially tolerances, of the solver.
So far, I am reading this matlab documentation and I think that I may have to rewrite my equations with a better scaling but I am not sure whether or not this will be sufficient.
Thanks in advance
% configuration of fsolve
options = optimoptions('fsolve','Display','iter-detailed','PlotFcn',@optimplotfirstorderopt);
options.StepTolerance = 1e-14;
%options.OptimalityTolerance = 1e-14
options.FunctionTolerance = 1e-14;
options.MaxIterations = 100000;
options.MaxFunctionEvaluations = 400;
options.Algorithm = 'levenberg-marquardt';%'levenberg-marquardt';%'trust-region'%
fun= @WandG;
x0 = [5.0000e+00;5.5366e-03];
% Solve the function fun
gw =fsolve(fun,x0,options);
% Function to be solved by fsolve
function F = WandG(x)
F(:,1) = ((((x(:,2)./10).*0.1).*(x(:,1)./100)).^2).*(8.9856e+01) +(( 7e-11 .* ( x(:,1)./100 ) ).^2).*( 1.7040e+08.^2.*(8.9856e+01) ) - (((x(:,2)./10).*0.1).*(x(:,1)./100));
F(:,2) = ((((x(:,2)./10).*0.1).*(x(:,1)./100)).^2).*( 8.0640e+00 - 1.7040e+08.*1.1e-7 * (1-x(:,1)./200) ) + (((x(:,1)./100).*7e-11).^2).*( 1.7040e+08.^2*(8.0640e+00 - 1.7040e+08*1.1e-7 .* (1-x(:,1)./200)) ) + 1.7040e+08.*(7e-11.*(x(:,1)./100) );
end

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Solver Outputs and Iterative Display 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by