An open channel is a stream in hydraulics that is often partially exposed to the atmosphere and not entirely confined by solid limits. Manning's equation, which has the following formula, may be used to calculate the flow rate of a cross- section of a channel under uniform flow circumstances for open channel flows. 1 AR²/351/2 Flow rate = cross- Roughness coefficient of sectional Manning area Cross section's radius in hydraulic slope Channel Your team's task is to determine the optimal open channel dimensions for a given flow rate, roughness coefficient, and slope. To calculate the height of a rectangular section given its base, you should develop a program. For rectangular cross-sectioned open channels with dimensions band h: P₁ = b + 2h A = bh R = = 6+2h Where A is the cross-sectional area, Pw is the wetted perimeter, R is the hydraulic radius, b is the base and his the height Create a C program that incorporates the remarks and guidelines below: 1. Request input from the user for the following values: Q, n, 5, and b. The roughness coefficient should range from 0.010 to 0.025 (inclusive), the slope should be less than or equal to 0.01 and all values should be positive. Request for input again and again until an appropriate value is provided. 2. Apply the Secant and Regula-Falsi techniques to get the height of the rectangular cross-section. The maximum number of repetitions for both methods should be 50, and the tolerance for either method should be set at 0.000001 (10e-6). 2.1. Print to screen a table with a summary of your iterations for the secant method. There should be six columns in your output: iteration number, x_n-1, fix_n-1), x_n, and absolute error. 2.2. While print to screen a table with the summary of your iterations for the Regula-Falsi method. Iteration number, a, b, f(a), f(b), c, fic), and absolute error, should be the 8 columns in your output. 3. Additionally, the program will notify users each time one of the following situations arises: A. If one or more of the input section parameters (Q, n, 5, or b) are negative, the program should stop solving. B. If the starting interval used for the Regula-Falsi Method is invalid for one of the following reasons, the program should not attempt to solve for the height: 81. Neither the root nor the solution is included in the interval. 82. The initial interval has at least one negative endpoint. C. The maximum number of iterations is attained but the tolerance requirement is not achieved.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Code a c program for the ff:

An open channel is a stream in hydraulics that is often partially exposed to the atmosphere and not entirely confined by
solid limits. Manning's equation, which has the following formula, may be used to calculate the flow rate of a cross-
section of a channel under uniform flow circumstances for open channel flows.
Flow rate
_Q=
=
1
- AR2/35¹/2
n
Roughness
coefficient of
Manning
Cross-
sectional
area
R:
Cross
section's
radius in
hydraulic
Your team's task is to determine the optimal open channel dimensions for a given flow rate, roughness coefficient, and
slope. To calculate the height of a rectangular section given its base, you should develop a program.
For rectangular cross-sectioned open channels with dimensions b and h:
P₁ = b + 2h
A = bh
A
bh
slope
Channel
Where A is the cross-sectional area, Pw is the wetted perimeter, R is the hydraulic radius, b is the base and his the
height.
Create a C program that incorporates the remarks and guidelines below:
1. Request input from the user for the following values: Q, n, S, and b. The roughness coefficient should range
from 0.010 to 0.025 (inclusive), the slope should be less than or equal to 0.01 and all values should be positive.
Request for input again and again until an appropriate value is provided.
2. Apply the Secant and Regula-Falsi techniques to get the height of the rectangular cross-section. The maximum
number of repetitions for both methods should be 50, and the tolerance for either method should be set at
0.000001 (10e-6).
2.1. Print to screen a table with a summary of your iterations for the secant method. There should be six
columns in your output: iteration number, x_n-1, f(x_n-1), x_n, and absolute error.
2.2. While print to screen a table with the summary of your iterations for the Regula-Falsi method. Iteration
number, a, b, f(a), f(b), c, f(c), and absolute error, should be the 8 columns in your output.
3. Additionally, the program will notify users each time one of the following situations arises:
A. If one or more of the input section parameters (Q, n, S, or b) are negative, the program should stop solving.
B. If the starting interval used for the Regula-Falsi Method is invalid for one of the following reasons, the
program should not attempt to solve for the height:
B1. Neither the root nor the solution is included in the interval.
B2. The initial interval has at least one negative endpoint.
C. The maximum number of iterations is attained but the tolerance requirement is not achieved.
Transcribed Image Text:An open channel is a stream in hydraulics that is often partially exposed to the atmosphere and not entirely confined by solid limits. Manning's equation, which has the following formula, may be used to calculate the flow rate of a cross- section of a channel under uniform flow circumstances for open channel flows. Flow rate _Q= = 1 - AR2/35¹/2 n Roughness coefficient of Manning Cross- sectional area R: Cross section's radius in hydraulic Your team's task is to determine the optimal open channel dimensions for a given flow rate, roughness coefficient, and slope. To calculate the height of a rectangular section given its base, you should develop a program. For rectangular cross-sectioned open channels with dimensions b and h: P₁ = b + 2h A = bh A bh slope Channel Where A is the cross-sectional area, Pw is the wetted perimeter, R is the hydraulic radius, b is the base and his the height. Create a C program that incorporates the remarks and guidelines below: 1. Request input from the user for the following values: Q, n, S, and b. The roughness coefficient should range from 0.010 to 0.025 (inclusive), the slope should be less than or equal to 0.01 and all values should be positive. Request for input again and again until an appropriate value is provided. 2. Apply the Secant and Regula-Falsi techniques to get the height of the rectangular cross-section. The maximum number of repetitions for both methods should be 50, and the tolerance for either method should be set at 0.000001 (10e-6). 2.1. Print to screen a table with a summary of your iterations for the secant method. There should be six columns in your output: iteration number, x_n-1, f(x_n-1), x_n, and absolute error. 2.2. While print to screen a table with the summary of your iterations for the Regula-Falsi method. Iteration number, a, b, f(a), f(b), c, f(c), and absolute error, should be the 8 columns in your output. 3. Additionally, the program will notify users each time one of the following situations arises: A. If one or more of the input section parameters (Q, n, S, or b) are negative, the program should stop solving. B. If the starting interval used for the Regula-Falsi Method is invalid for one of the following reasons, the program should not attempt to solve for the height: B1. Neither the root nor the solution is included in the interval. B2. The initial interval has at least one negative endpoint. C. The maximum number of iterations is attained but the tolerance requirement is not achieved.
Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY