Description
1. Write a Python program that uses the relaxation method to find a root of the function f(x) = x3 − 2x − 2 to an accuracy of 10−12 starting from the initial value x0 = 1. Your program should output each successive estimate of x with the magnitude of its error obtained by this method.
2. Write a Python program that uses the relaxation method to find a solution of the equation x = f(x) = exp(exp(−x)cosx) to an accuracy of 10−12 starting from the initial value x0 = 1 without using the formula of f0(x). Your program should output each successive estimate of x with the magnitude of its error obtained by this method.
3. Write a Python program that uses the bisection method to find a root of the function√
f(x) = xtanx − 100 − x2 on the interval 6.5 ≤ x ≤ .5 to an accuracy of 10−12. Your program should output each successive estimate of x with its absolute difference from the previous estimate obtained by this method.
4. Write a Python program that uses the Newton’s method to find a root of the function f(x) = 2sin(3x) − ex to an accuracy of 10−12 starting from the initial value x0 = 0. Your program should output each successive estimate of x with the magnitude of its error obtained by this method.
The Kirchhoff current law states that the total net current flowing into or out of each point in a circuit must be zero. Applying this law to the points with voltage V1 and V2 in the above circuit, we obtain
Write a Python program that uses the Newton’s method to solve the above simultaneous equations with the conditions R1 = 1kΩ, R2 = 4kΩ, R3 = 3kΩ, R4 = 2kΩ, V+ = 5V, VT = 0.05V, I0 = 3nA to an accuracy of 10−8 V starting from the initial values V1,0 = 2V and V2,0 = 1V. Note that the error of the estimates of V1 and V2 in the ith iteration of this method is approximately given by the norm δ(xi) = k(∇f)−1f(xi)k. Your program should output each successive estimate of V1 and V2 with the error δ(xi) obtained by this method.
2




Reviews
There are no reviews yet.