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

1 view (last 30 days)
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 Comment
Jorg Woehl
Jorg Woehl on 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).

Sign in to comment.

Answers (0)

Categories

Find more on Systems of Nonlinear Equations 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!