Newton's method of root-finding requires solving a system of linear equations (to avoid using nonlinear optimization routines) at each iteration to ensure maximum computational efficiency.
This process involves inverting the Jacobian (see lecture notes and King & Mody pg338), which may not always have an inverse.
a. If you are supplied with an arbitrary square matrix, J, write a MATLAB script (or function) that will do the following:
i. If the condition number of J is less than or equal to 20: store the absolute value of the determinant J in the variable det Mag, and ant Is posit det Sign equal to 1 if the determinants positive set the variable and equal to -1 if the determinant is negative
ii. If the condition number of J is greater than 20: set det Mag equal to zero and set det Sign equal to the empty matrix
b. Verify that your script is accurate by running your code of matrices on three different
i. J has a positive determinant and a condition number less than 20
ii. J has a negative determinant and a condition number less than 20 iii.
iii. J has a condition number greater than 20