Computers and Technology

1) Write a function defined as: def Secant(fcn, x0, x1, maxnew = 14, xtol = 1e-4): Purpose: use the Secant Method to find the root of fcn(x), in the neighborhood of x0 and x1.
fcn: the function for which we want to find the root x0 and x1: two x values in the neighborhood of the root xtol: exit if the |xnewest - xprevious| < xtol maxnew: exit if the number of iterations (new x values) equals this number return value: the final estimate of the root (most recent new x value)
Write and call a main() function that uses your Secant function to estimate and print the solution of:
X-3 * cos(x) = 0 with x0 = 1, x1 = 2, maxnew = 4 and xtol = 10-4
cos(2x).x3 with x0 = 1, xl = 2, maxnew = 15 and xtol = 10-8
cos(2x).x3 = 0 with x0 = 1, x1 = 2, maxnew =23 and xtol = le-8 = 0
2) Write a function defined as: def Gauss Jacobi(Aaug, x, niter = 15):
Purpose: use the Gauss-Jacobi method to estimate the solution to a set of N linear equations expressed in matrix form as A x=b. Both A and b are contained in the function argument - Aaug - an augmented A-matrix Do NOT use pivoting to try to improve the solution. Simply use the values as given
Aaug: an augmented matrix containing [A | b ] having N rows and N+1 columns, where N is the number of equations in the set.
x: a vector (array) contain the values of the initial guess
niter: the number of iterations (new x solutions) to compute
return value: the final new x vector.
Write and call a main() function that uses your Gauss Jacobi function to estimate and print the solution to the sets of linear equations contained in the following Augmented A-matrices:
MyA =
[[4, -1, -1, 3], [-2, -3, 1, 9], (-1, 1, 7, -6]],
using initial guesses of all ZEROS. Perform 22 iterations.
another A = [[ 4, 3, 1, -1, 2], [ 2, -5, 0, -2, -3), [ -3, 3, -6, 1, 5), [ 0, 1, 4, 8, -2]]
using initial guesses of all ONES. iterations.

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 15:20, codie1103
This os integrated the processing power of windows nt with the easy-to-use gui of windows 98. windows 2000 windows 3.11 windows for workgroups windowa millennium edition
Answers: 1
image
Computers and Technology, 23.06.2019 06:30, eddsworldfrantic
You have a small company and want to keep your costs low, but it is important your employees share data. which network would provide you with the most economical solution?
Answers: 1
image
Computers and Technology, 23.06.2019 20:30, summerhumphries3
What are some settings you can control when formatting columns?
Answers: 1
image
Computers and Technology, 23.06.2019 21:30, maddietomlinson113
Examine the list below. which factors positively affect lifetime income? check all that apply.
Answers: 1
Do you know the correct answer?
1) Write a function defined as: def Secant(fcn, x0, x1, maxnew = 14, xtol = 1e-4): Purpose: use the...

Questions in other subjects:

Konu
English, 25.06.2021 14:00
Konu
English, 25.06.2021 14:00
Konu
Mathematics, 25.06.2021 14:00
Konu
English, 25.06.2021 14:00