Uploaded by Faisal Al-wazir

Assignment Questions EEN 170 fall 2022-١

advertisement
Assignment Questions
EEN 170
Fall 2022
Q1.A NONLINEAR EQUATION USING THE BISECTION METHOD
Write a MATLAB program, in a script file, that determines the
solution of the equation 8-4.5(x-sinx)=0 by using the bisection method.
The solution should have a tolerance of less than 0.001 rad. Create a table
that displays the values of a, b, xNs, f(xNs), and the tolerance for each
iteration of the bisection process.
Q2. A NONLINEAR EQUATION USING THE NEWTON'S METHOD
Create a User-defined function for Newton's method, Find the solution of the
equation 8-4.5(x- sinx)=0 by using Newton's method, Use 0.0001 for the
maximum relative error and 10 for the maximum number of iterations. In both
parts, use x = 2 as the initial guess of the solution.
Q3. A NONLINEAR EQUATION USING THE SECANT METHOD
Create a User-defined function for Secant method, Find the solution of the
equation 8-4.5(x- sinx)=0 by using Secant method, Use 0.0001 for the maximum
relative error and 10 for the maximum number of iterations. The two starting
points are taken as a = 2 and b = 3.
Q4. A SYSTEM OF EQUATIONS USING GAUSS ELIMINATION
Gauss elimination.
Write a user-defined MATLAB function for solving a system of linear
equations, [a][x] = [b], using the Gauss elimination method. For function name and
arguments, use x =Gauss (a, b), where a is the matrix of coefficients, b is the righthand-side column vector of constants, and x is a column vector of the solution.
Solve the following system of four equations using the Gauss elimination method.
4 x1 - 2x2 - 3x3 + 6x4 = 12
-6x1 + 7x2 + 6 .5x3 - 6x4 = -6.5
x1 + 7.5x2 + 6.25x3 + 5.5x4 = 1 6
-12x1 + 2.2 x2+ 15.5x3 - x4 = 17
Download