


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!



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)
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
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.