Professional Documents
Culture Documents
Roots of Nonlinear Equations
Roots of Nonlinear Equations
Roots of Nonlinear Equations
PROBLEM NO. 1 – Roots of Nonlinear Equations Date Submitted: October 23, 2018
__________ I. (20 pts). The problem, theory and equations in Part (a) are described
completely. The presentation is very orderly and systematic.
__________ II. (20 pts) Part (b). The solution and plots/tables are presented.
__________ II. (40 pts) Part (c). The solution and plots/tables are presented clearly.
There is a discussion of results and a conclusion.
__________ III. (20 pts) Part (d). The scripts are presented completely with comments.
The scripts are easy to understand.
__________ Total
Remarks:
NAME:
Balcos, Marla Felicity M.
11532149
I. Problem Description
The given parameters are as follows,
𝑏 = 15 𝑚
𝑚3
𝑄 = 22
𝑠
𝑆 = 0.00025
𝑛 = 0.013
𝐴 = 𝑏𝑑
The hydraulic radius, R is
𝐴
𝑅=
𝑃
And the wetted perimeter, P is
𝑃 = 𝑏 + 2𝑑
Substituting into Equation (1) and transposing Q, the nonlinear equation to solve for the normal depth can
be derived and is as follows,
𝑏𝑑 𝑏𝑑 2/3 1/2
𝐹(𝑑) = ( ) 𝑆 −𝑄 (2)
𝑛 𝑏 + 2𝑑
To solve for the root of the nonlinear equation, which is also the normal depth of the section, the Incremental
Search Method and the Secant Method would be utilized. The steps for both methods are as follows:
1. Incremental Search Method
a. Start with the first root, 𝑥𝑖 = 0, and set the increment as ∆𝑥 = 0.1
b. Compute 𝑥𝑖+1 = 𝑥𝑖 + ∆𝑥
c. Substitute the values into the nonlinear equation.
d. Calculate the product of 𝐹(𝑥0 ) and 𝐹(𝑥1 )
- If the product is positive, replace 𝑥𝑖 by 𝑥𝑖+1
e. Repeat steps a-d until the product is negative. Then, proceed to the Secant Method
- If the product is 0, the root is 𝑥𝑖+1
2. Secant Method
Given that 𝑥𝑖 = 𝑥1 , and 𝑥𝑖+1 = 𝑥2 ,
a. The root lies between 𝑥1 and 𝑥2 .
b. Calculate a third value between 𝑥1 and 𝑥2 , taken as
𝑥1 𝐹(𝑥2 ) − 𝑥2 𝐹(𝑥1 )
𝑥3 =
𝐹(𝑥2 ) − 𝐹(𝑥1 )
c. Replace 𝑥1 by 𝑥2 , and 𝑥2 by 𝑥3 .
d. Repeat steps a-c until 𝐹(𝑥3 ) = 0.00001
e. Therefore, 𝑥3 is the root of the nonlinear equation.
Table 1 shows the values solve, utilizing the steps for the Incremental Search Method. The root lies
between 1.1 and 1.2 as the product of 𝐹(1.1) and 𝐹(1.2) is negative. The Secant Method, then is used to
obtain the root.
Table 2. Values solved for the Secant Method
Table 2 shows the values obtained with the Secant Method. The root of the nonlinear equation is
found to be 1.185682 as the value of 𝐹(𝑥3 ) is less than the margin of error of 0.00001.
Therefore, the normal depth of the section is
𝑑 = 1.186582 𝑚
From the MATLAB script, the normal depth of the section is also
𝑑 = 1.186582 𝑚
Table 3 shows the corresponding normal depths of the bases varying from 10 to 40 m. The depths
are seen to decrease as the base increases.
%Manning's Equation
fprintf('Q = (A/n)*((R)^(2/3))*((S)^(1/2))\n')
%Hydraulic Radius
fprintf('and R = A/P\n')
%Substitute the value of x and y to the nonlinear equation into f and g, respectively
f = (b*x/n)*((b*x/(b+2*x))^(2/3))*(S)^(1/2)-Q;
g = (b*y/n)*((b*y/(b+2*y))^(2/3))*(S)^(1/2)-Q;
%The process will repeat until the absolute value of h is greater than the margin of error of 0.00001
while abs(h) > 0.00001
Balcos_Problem1c.m
%Loop for when b varies from 10 to 40 with increments of 5
for b = 10:5:40
%Substitute the value of x and y to the nonlinear equation into f and g, respectively
f = (b*x/n)*((b*x/(b+2*x))^(2/3))*(S)^(1/2)-Q;
g = (b*y/n)*((b*y/(b+2*y))^(2/3))*(S)^(1/2)-Q;
%The process will repeat until the absolute value of h is greater than the margin of error of 0.00001
while abs(h) > 0.00001
end
hold off
Balcos_Problem1c2.m
%Initialize the value of i
i=1;
%Substitute the value of x and y to the nonlinear equation into f and g, respectively
f = (b*x/n)*((b*x/(b+2*x))^(2/3))*(S)^(1/2)-Q;
g = (b*y/n)*((b*y/(b+2*y))^(2/3))*(S)^(1/2)-Q;
%The process will repeat until the absolute value of h is greater than the margin of error of 0.00001
while abs(h) > 0.00001
%Calculate a third value, z between x and y
z = ((x.*g)-(y*f))/(g-f);
%Substitute z into the nonlinear equation
h = (b*z/n)*((b*z/(b+2*z))^(2/3))*(S)^(1/2)-Q;
%Transfer the value of y to x
x=y;
%Transfer the value of z to y
y=z;
%Transfer the value of g to f
f=g;
%Transfer the value of h to g
g=h;
end
%Plot of b vs d
base = 1:1:100;
plot (base, depth)
xlabel('d (m)')
ylabel('b (m)')