MCD 4140 Computing for Engineers Self Study Exercise 6
Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit
MCD 4140 Computing for Engineers
Self Study Exercise 6
Note: Tasks below can use for both hand calculation practice and programming practice.
Note: You might want to use extra sheet for hand calculation practice.
Task 1
Bisection Method
f(x) = sin(5x)+cos(3x), xl = 1.5, xu = 2.5, precision = 0.01
Iteration |
x |
x |
x |
f (xl ) |
f (xr ) |
1 |
|
|
|
|
|
2 |
|
|
|
|
|
3 |
|
|
|
|
|
4 |
|
|
|
|
|
5 |
|
|
|
|
|
False Position Method
f(x) = sin(5x)+cos(3x), xl = 1.5, xu = 2.5, precision = 0.01
Iteration |
x |
x |
x |
f (xl ) |
f (xr ) |
f (xu ) |
1 |
|
|
|
|
|
|
2 |
|
|
|
|
|
|
3 |
|
|
|
|
|
|
Task 2
Newton-Raphson Method
f(x) = -0.9x2 + 1.7x + 2.5, f’(x) = -0.9x + 1.7, xi = 4, precision = 0.0005
Iteration |
x |
i +1 |
f (xi ) |
f '(xi ) |
f (xi +1) |
1 |
|
|
|
|
|
2 |
|
|
|
|
|
3 |
|
|
|
|
|
Secant Method
f(x) = -0.9x2 + 1.7x + 2.5, xi = 4, xi-1 = 5, precision = 0.0005
Iteration |
i −1 |
x |
i +1 |
f (xi −1) |
f (xi ) |
f (xi +1) |
1 |
|
|
|
|
|
|
2 |
|
|
|
|
|
|
3 |
|
|
|
|
|
|
4 |
|
|
|
|
|
|
Modified Secant Method
f(x) = -0.9x2 + 1.7x + 2.5, xi = 4, δ = 0.02, precision = 0.0005
Iteration |
xi + δxi |
x |
i +1 |
f (xi + δxi ) |
f (xi ) |
f (xi +1) |
1 |
|
|
|
|
|
|
2 |
|
|
|
|
|
|
3 |
|
|
|
|
|
|
Task 3
When a ‘bad’ initial guess is used, the open methods can be diverging. Develop your own MATLAB function for bisection in a similar fashion to the bisection program presented in the lecture slide. In addition, include an alternative stopping criterion, maximum iteration.
Task 4
The polynomial f (x) = 0.0074x4 - 0.284x3 + 3.355x2- 12. 183x + 5 has a real root between 15 and 20. Apply the Newton-Raphson method to this function using an initial guess of x0 = 16.15. Explain your results.
Task 5
Use (a) the Newton-Raphson method, (b) the secant method and (c) the modified secant method (δ = 0.05) to determine a zero of
f (x) = x5 −16.05x4 + 88.75x3 −192.0375x2 +116.35x + 31.6875 using an initial guess of and stopping criterion of 0.0001. Explain your results.
Task 6
Consider the following function:
f (x) = 3 + 6x + 5x2 + 3x3 + 4x4
Locate the minimum by finding the root of the derivative of this function. Use bisection with initial guesses of xl = 2 and xu = 1.
Task 7
A total charge Q is uniformly distributed around a ring-shaped conductor with radius a. A charge q is located at a distance x from the center of the ring. The force exerted on the charge by the ring is given by
1 qQx
F =
4πe0 (x2 + a2 )3/ 2
where e0 = 8.85 × 10- 12 C2/Nm2 , q = Q = 2 × 10-5 C, and a = 0.9m. Determine the distance x where the force is a maximum.
Task 8
A compound A will be converted to into B in a stirred tank reactor. The product B and unreacted A is recycled to the reactor. A process engineer has found that the initial cost of the system is a function of the conversion xA . Find the conversion that will result in the lowest cost system. C is proportionality constant.
Cost = C |(|())||0.6 + 6(|())|0.6
2022-12-01