Steps:
To calculate the root, observe where the function crosses the x-axis.
Sample Calculation
Pseudocode Modified Secant Method
%% Set up and variable declaration%% Modified Secant ApproachPseudocode Fixed-Point Method
%% Set up and variable declaration%% Modified Secant ApproachFigure 2: Depicts Convergence and Velocity Equation Together
Looking at figure 2, we observe the root of the f(x) function coincides with the x-value of intersetion between the velocity equation and y=x. The original velocity equation (blue line) has a slope smaller than 1 near its intersection with y=x, which means the fixed-point method we used will converge towards the correct answer for any positive starting value.
The secant method required only four iterations to drop below the error requirement of 0.05%, whereas the fixed-point method took nine iterations.
We see that the Re value is above the 0.1 requirement to be considered laminar flow, meaning we must use the turbulant flow equations.
Our error threshold "es" is below 0.05%. Looking at figure 3, we see that the secant method pulls ahead and completes the estimation of the root within four iterations. The fixed point method performs well in the initial iterations, but appears to approach 0 more slowly after four iterations. This error percentage is calculated by taking the difference between the true value observed in the analytical solution and the estimated value for the current iteration. It then divides this difference by the true value.
Our error threshold "es" is below 0.05%. Looking at figure 4, we see that the secant method pulls ahead and completes the estimation of the root within four iterations. Interestingly, the fixed point method seems to outperform for the first iteration but subsequently takes more iterations to approach our error target.