Effacer les filtres
Effacer les filtres

how to find value of variables in more than one function that equal to zero in matlab

2 vues (au cours des 30 derniers jours)
I have 3 functions that equal to zero, there are two variables for each function. the total variable is 3.
for example the variables are a, b, and c
the functions are:
y1=a+b=0
y2=b+c=0
y3=c+a=0
I just simplify the functions, but actually it is so long.
a in y1 must be the same value with a in y3, and so on with the other variables.
How can I find a, b, c?
  1 commentaire
Jorg Woehl
Jorg Woehl le 7 Mar 2021
I would first try to do this on paper before putting it into code.
Are the functions linear with respect to the variables? Solve for one variable in one equation, then substitute it in the other two equations, and repeat the process with the remaining variables, or use Gaussian elimination, or write your system of equations as a matrix eigenvalue problem and use the determinant method to find solutions. MATLAB has functions to help with that, such as eig, and the Symbolic Math toolbox is handy for this kind of work.
For nonlinear equations, you can still use the first method, or - if this becomes too tricky - you may have to do it numerically using root-finding algorithms (check out roots for polynomials, or fzero and fsolve for other nonlinear functions).

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Systems of Nonlinear Equations 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!

Translated by