% Solve the system of equations starting at the point [0,0,0].
% PL = x(1); c = x(2); k = x(3);
% Initial guess is [0,0,0], you can change it accordingily
fun = @root2d;
x0 = [0,0,0];
x = fsolve(fun,x0)
Warning: Trust-region-dogleg algorithm of FSOLVE cannot handle non-square systems; using Levenberg-Marquardt algorithm instead.
No solution found.
fsolve stopped because the relative size of the current step is less than the
value of the step size tolerance, but the vector of function values
is not near zero as measured by the value of the function tolerance.
x = 1×3
1.0e+05 *
2.0192 -0.0000 0
function F = root2d(x)
F(1) = x(1) * exp(-x(2)*exp(-x(3)*0)) - 179323;
F(2) = x(1) * exp(-x(2)*exp(-x(3)*10)) - 203302;
F(2) = x(1) * exp(-x(2)*exp(-x(3)*20)) - 226542;
end

댓글 수: 1

Alex Sha
Alex Sha 2022년 10월 24일
Here are solution:
x1: 446505.431672108
x2: 0.912262916225994
x3: 0.0148006249649759

댓글을 달려면 로그인하십시오.

답변 (1개)

Walter Roberson
Walter Roberson 2022년 10월 23일

0 개 추천

You write to F(2) twice.
The warning is because the default algorithm requires square outputs from your function, such as 1x1 or 2x2. You want three outputs so you need to use a different algorithm. It is automatically switching algorithms for you but warns you that your choosen algorithm was not used.

카테고리

도움말 센터File Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

태그

질문:

2022년 10월 23일

댓글:

2022년 10월 24일

Community Treasure Hunt

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

Start Hunting!

Translated by