Docsity

MIT Tide Calculation and Stormwater Drain Discharge using MATLAB - Prof. Mr Burchell, Lab Reports of Agricultural engineering

Toggle sidebar
bg1
1
BAE 200
Lab #3
DUE MONDAY SEPTEMBER 15 at 12 NOON
SUBMIT the files via WolfWare (http://courses.ncsu.edu/bae200/)
by MONDAY September 15th at 12 NOON.
IMPORTANT!
A total of 5 files must be submitted for this homework set (1 word document, 4 script M-files)
Failure to follow directions on the naming conventions for each file will result in a 5 point
deduction per file.
All problems must include (points will be deducted without these components)
1. Each problem listed below must follow the format of the examples given in the MATLAB portion
of the text.
a. State the problem concisely
b. Describe the input and output (including units)
c. Write the algorithm and produce a hand example
d. Develop a MATLAB solution
e. Test the solution – does it agree with your hand example?
f. Discussion if required
2. You must submit a single Word file with all of the above components except d for each problem.
This file should be submitted as unityID_Hwk3.doc. This will be worth 25% of the point total
for each problem.
3. For the MATLAB programs (component d listed above – 75% of the total point total) you must
include comments preceding your code to state your name as the programmer, the date
programmed, the number of the problem, the problem statement, governing equations, inputs
and outputs with units
4. Your MATLAB code should be well commented to describe the function of the major components
of the program lines of code.
5. Your code will be graded based on whether you followed good programming techniques, your
understanding of what each line of code is responsible for, and whether it can be run error-free
and generate the correct solution to the problem statement
Problem 1. MIT tide calculation using MATLAB (30 points)
This problem will require that you create a user defined function h and a script M file to call and
execute the function.
Write a MATLAB script that computes tidal elevation h (in m) from the following three term
series:
h(t) = 0.2 sin(0.5 ωt) + 3.0 sin(ωt) + 1.0 sin(2ωt)
where ω = 2π/24 hr -1. Define a vector time with values from 0-1000 hours with a 0.1 time step.
Plot the tidal fluctuations versus time. Title your plot and label your axes with a name and units
by using code in your M-File. Be sure to include your problem solving methods in a WORD
document. Discuss what you observe about the magnitudes of the high tides observed in your
plot. Do they vary? Is any variation observed a real natural occurrence?
Submit
1. Your function file as h.m (since you must keep this function name in order for your
program to be able to call it)
2. Your program file as unityID_Problem1.m.
Be sure to check your solution by hand.
pf3
pf4

Partial preview of the text

Download MIT Tide Calculation and Stormwater Drain Discharge using MATLAB - Prof. Mr Burchell and more Lab Reports Agricultural engineering in PDF only on Docsity!

BAE 200

Lab # DUE MONDAY SEPTEMBER 15 at 12 NOON SUBMIT the files via WolfWare (http://courses.ncsu.edu/bae200/) by MONDAY September 15th^ at 12 NOON.

IMPORTANT! A total of 5 files must be submitted for this homework set (1 word document, 4 script M-files) Failure to follow directions on the naming conventions for each file will result in a 5 point deduction per file.

All problems must include (points will be deducted without these components)

  1. Each problem listed below must follow the format of the examples given in the MATLAB portion of the text. a. State the problem concisely b. Describe the input and output (including units) c. Write the algorithm and produce a hand example d. Develop a MATLAB solution e. Test the solution – does it agree with your hand example? f. Discussion if required
  2. You must submit a single Word file with all of the above components except d for each problem. This file should be submitted as unityID_Hwk3.doc. This will be worth 25% of the point total for each problem.
  3. For the MATLAB programs (component d listed above – 75% of the total point total) you must include comments preceding your code to state your name as the programmer, the date programmed, the number of the problem, the problem statement, governing equations, inputs and outputs with units
  4. Your MATLAB code should be well commented to describe the function of the major components of the program lines of code.
  5. Your code will be graded based on whether you followed good programming techniques, your understanding of what each line of code is responsible for, and whether it can be run error-free and generate the correct solution to the problem statement

Problem 1. MIT tide calculation using MATLAB (30 points)

This problem will require that you create a user defined function h and a script M file to call and execute the function.

Write a MATLAB script that computes tidal elevation h (in m) from the following three term series: h(t) = 0.2 sin(0.5 ωt) + 3.0 sin(ωt) + 1.0 sin(2ωt) where ω = 2π/24 hr -1^. Define a vector time with values from 0-1000 hours with a 0.1 time step. Plot the tidal fluctuations versus time. Title your plot and label your axes with a name and units by using code in your M-File. Be sure to include your problem solving methods in a WORD document. Discuss what you observe about the magnitudes of the high tides observed in your plot. Do they vary? Is any variation observed a real natural occurrence?

Submit

  1. Your function file as h.m (since you must keep this function name in order for your program to be able to call it)
  2. Your program file as unityID_Problem1.m.

Be sure to check your solution by hand.

Problem 2. Calculating outflow from a stormwater pipe using MATLAB (50 points)

This problem will require you to use an if else statement

The objective of this problem is to develop a Matlab program to summarize storm runoff volumes from a storm drain. A float-potentiometer system is connected to an automatic data- logger to provide a continuous record of flow from the storm drain. The datalogger records the voltage levels corresponding to float positions or water levels. As the water level in the drain changes, so does the voltage reading from the float-potentiometer. The changes in these voltage readings are related to changes in water levels in the storm drain via the circumference of the float pulley-wheel assembly. For our particular float-pulley-wheel assembly, the range of voltages is 0 to 5.0 volts which corresponds to water levels of 0 - 10 ft in the storm drain, so our conversion factor is 0.5 volt per foot. For example, if we measure 3 volts, then the water level is 3 volts/0.5 volt per foot = 6 feet. The outlet at the bottom of the storm drain carries the runoff to a detention pond or stream. The rate the water flows from the storm drain (discharge) is directly related to the water level in the storm drain. The schematic and field picture below shows the discharge from a cross-section of the drain.

As the water level drops the potentiometer turns and the voltage decreases and there is less flow or a lower discharge. If the water level increases then the potentiometer turns and the voltage increases, indicating an increase in flow (discharge).

Water level

Float

Float pulley wheel-potentiometer (voltage is measured here)

Flow or discharge in ft 3 /s from the drain

Stilling well

Datalogger Battery

Water level

Float

Float pulley wheel-potentiometer (voltage is measured here)

Flow or discharge in ft 3 /s from the drain

Stilling well

Datalogger Battery

Problem 3. This problem will require you to prompt the user for input and produce scalar output in “sentence form” (20 points)

Modify problem 2 to allow for user input to give a single output for stage and flow based on mV reading. Replace the mV input matrix in problem 2 with lines of code that will prompt the user for mV input. At the end of the program, display the corresponding stage and flow generated from your program created in problem 2.

You should be able to simply modify your program code created in problem 2, as well as your problem solving steps you generated in Problem 2. No plots required for this problem.

Some useful MATLAB functions if, else, end, input, fprintf (these are just a few)

Submit as MATLAB M-File (‘unityID_Problem3.m’). No discussion required.