Using Fsolve for 3 nonlinear equations with 3 variables.
1 view (last 30 days)
Show older comments
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 Comments
Answers (1)
Walter Roberson
on 22 Apr 2020
Edited: Walter Roberson
on 22 Apr 2020
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 Comments
See Also
Categories
Find more on Symbolic Math Toolbox 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!