Using Fsolve for 3 nonlinear equations with 3 variables.
1 回表示 (過去 30 日間)
古いコメントを表示
1.) 2x^2 - 4x + y^2 + 3z^2 +6z+2 = 0;
2.) x^2 + y^2 - 2y + 2z^2 - 5 = 0;
3.) 3x^2 - 12x +y^2 + 3z^2 + 8 = 0;
also when i am using fsolve , it prompts 'fsolve requires optimisation toolbox'
how do i solve that?
0 件のコメント
回答 (1 件)
Walter Roberson
2020 年 4 月 22 日
編集済み: Walter Roberson
2020 年 4 月 22 日
The message is correct: fsolve() is part of the Optimization Toolbox.
The closest equivalent that is part of basic MATLAB is fzero(), which can only handle a single equation in a single variable.
If you have the Symbolic Toolbox, you can use that.
Otherwise, I suggest you use the old trick: to find the zeros of multiple equations, you can search for the zeros of a sum of squares of the left hand side of the equations. f1(x)^2 + f2(x)^2 + f3(x)^2 . If each of the individual components of the sum goes to 0 then the sum itself would go to zero, and the individual components would each go to zero if the trial value solves the equation.
To search for zeros of the residue, minimize it: you would be minimizing an unconstrained function in 3 variables, and there are several minimization routines included in basic MATLAB.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Symbolic Math Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!