hw5p1.c - \/Kyle Yamamoto\/Finding flow of water(cu ft sec\/using Mannings equation#define_CRT_SECURE_NO_WARNINGS#include <stdio.h>#include

hw5p1.c - /Kyle Yamamoto/Finding flow of water(cu ft...

This preview shows page 1 - 2 out of 2 pages.

//Kyle Yamamoto //10-9-14 //Finding flow of water (cu. ft. / sec) //using Mannings equation #define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <math.h> #define WIDTH_CH 15 //feet #define DEPTH_CH 10 //feet #define SLOPE 0.0015 //feet/foot #define N_roughness 0.014 //Roughness coeff. #define TARGET_FLOW 1000.00 //Target Flow (cfs) void flow_water(double depth, double *Q, double *error){ //Function to find the flow double A, R; A = depth*WIDTH_CH; R = A / (2.0 * depth + WIDTH_CH); /* Complete the function which returns 2 values below - Q = flow of water (in cfs) - see its equation in the hw handout - error (in %) = (1000 - flow of water)*100.0/1000 */ *Q = (1.486 / N_roughness) * sqrt(SLOPE) * (A) * pow(R, .6666666666); //Flow of water equation *error = ((1000 - *Q) * 100.0) / 1000;
Image of page 1
Image of page 2

You've reached the end of your free preview.

Want to read both pages?

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask You can ask (will expire )
Answers in as fast as 15 minutes