roots

Modified: 2011/07/17 01:39 by omorr - Categorized as: English
roots function is used to numerically find roots for system of nonlinear equations. It might have two or three arguments.

roots('1:vector','2:vector')

roots('1:vector','2:vector','3:vector')

The system of functions is given in 1:vector. Returns the value of "2:vector" to make the set of functions "1:vector" equal to zeros. The third argument "3:vector" is the vector of guess values. It could be used to find a root of a single equation as well.

Here is an example explaining how to use roots() for a single equation and for a system of equations as well.

roots()

Note: Pay attention that 1:vector is a user defined function returning vector in the given variables, and 2:vector is a vector of symbolic variables (must not be given numerical values). When using roots() check that variables for which the roots is searching were not defined before with numerical values.

Here is another example of solving system of linear algebraic equations. The system was solved using matrices and using roots() as well:

linear

Note: If the determinant of a system matrix is close to zero (ill conditioned system), there is quite a chance that roots() will have problems with it.

ScrewTurn Wiki version 2.0.37. Some of the icons created by FamFamFam.