How can I solve a nonlinear model using Newton Raphson ?

2 ビュー (過去 30 日間)
Mallouli Marwa
Mallouli Marwa 2019 年 7 月 15 日
コメント済み: Mallouli Marwa 2020 年 1 月 25 日
Hi
How can I solve this nonlinear model using Newton Raphson ?
x1 +x2^2 +cos (x3) = 2
x1 +sin (x2) + x3^3 = 1
x3 +x2^3+x3^3 = 4

採用された回答

Stephan
Stephan 2020 年 1 月 25 日
One way:
result = fsolve(@fun,[1 1 1])
function F = fun(x)
F(1) = x(1) + x(2).^2 + cos(x(3)) - 2;
F(2) = x(1) + sin(x(2)) + x(3).^3 - 1;
F(3) = x(3) +x(2).^3 + x(3).^3 - 4;
end
gives:
Equation solved.
fsolve completed because the vector of function values is near zero
as measured by the value of the function tolerance, and
the problem appears regular as measured by the gradient.
<stopping criteria details>
result =
-0.5583 1.3732 0.8329
  2 件のコメント
John D'Errico
John D'Errico 2020 年 1 月 25 日
The best way to solve it. Don't use Newton-Raphson at all. :)
Mallouli Marwa
Mallouli Marwa 2020 年 1 月 25 日
If I want to use Newton Raphson.
How can we change it ?

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeNewton-Raphson Method についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by