Using Fsolve for 3 nonlinear equations with 3 variables.
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponses (1)
Walter Roberson
le 22 Avr 2020
Modifié(e) : Walter Roberson
le 22 Avr 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 commentaires
Voir également
Catégories
En savoir plus sur Symbolic Math Toolbox dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!