### Create a StudySoup account

#### Be part of our community, it's free to join!

Already have a StudySoup account? Login here

# COMP APPL ENGR & CONST CVEN 302

Texas A&M

GPA 3.77

### View Full Document

## 39

## 0

## Popular in Course

## Popular in Civil Engineering

This 26 page Class Notes was uploaded by Jaylan Rath on Wednesday October 21, 2015. The Class Notes belongs to CVEN 302 at Texas A&M University taught by Staff in Fall. Since its upload, it has received 39 views. For similar materials see /class/226122/cven-302-texas-a-m-university in Civil Engineering at Texas A&M University.

## Reviews for COMP APPL ENGR & CONST

### What is Karma?

#### Karma is the currency of StudySoup.

#### You can buy or earn more Karma at anytime and redeem it for class notes, study guides, flashcards, and more!

Date Created: 10/21/15

Parabolic Eim oue Trmsf39orb Ea I if 99 at at wax 93 COWS39IJer a simple imi ai MM FV oHth ac g XC tgt quotmere are Several 094550146 43w oUecvalciEhg We r39ng AMA 9141c 2 Siam En ex quotEiwxe imam 84315519 39 64 c9 J 39 J At xfzcintigt I we use ab ij ai 4 Artzen evev MW 35 kVIDWVZ irom Haa Frammgv Hv i ev Gav hmm oo 4391 Explic SDMKimxz is 063 oucL whekabla Me Ax 39rs 2mm i sml We wouJA UR a WW S lee ma a mp a cif39 59 W A 44 5 y M 339 C3 1 2 quot 1 II t Nair knowom aJr ne my Hume 2 v marea Wu x SQIWiiow 0 2314 AR Cf a meg UncomMHa malh WEE pud mt VE WA V accwm M Hme Mix WWOAW Ci 6 N 2 ltxltcr39 f gt L m 39 PRU Ci Hf LCrmk NQcMolsow Wx w ZM ovAer accurm in sz Gama W W d c5 C At 6x f igt P60 051 2quot I Jag B d i Exf xa z 3 a IWUd r 9 2 39 vmko N kb bczw fawniw 4a 1 Trm g w c 5 lwvfyhc stable Hm mwdamg bear Sinrsk mm neutral g Can ch A39 ram39 wkw bt d or 3921 gm 5 Newbie Tar magi AK Fommm D39 Ferame when used 3w aai zg harm is Mara AMER W3 W163 1amp9 avatar mwmira Waa waxad w jrlfsaA 39 Time 53 39 Cdi i 39 Si quot39 1 Q39FCXHQHJJ I 6gt xf l I Sawt Q g mg K r 9 2 Y Li 5 3 0 5 Ax AX 9 Wue X39s E gmm W35 90 KWHCJH quotKr 939 Wm vz 9i awn are Emma ME Niaa x wi LecrhM e 12 Limcor Mab mb Quad4031s NW is a ma nr39ix A box Kim 0f muwbcrs ngMRd in Y39oW aM alums Examples I I z 3 LI 39 RM MA hr39ices haw an row batla cam aka be 390 w waiftats have mg Columl lg mum ve ch rg39 o W mah me have more m we comaWt W row w m c MW We game Mumb r a 14wa and Columns iagoum waMceS M M values jug cm W AmSNAL gamed MANILef have values duskrwt er HM Aia m al Q a H 00 U 9004 Q0000 o DON39 obiSN 400 0 o q Oil 90me WM do we use malrricee39 Timex are a 5 ka 0 WVng Saws 0 equm m s x 2x 5 7 X 2 X3 3 8 zx 39 3x1 7 x3 lo Hm 10 we w k Hais as a Maia 391 XCo WCimE go 1M1 a WWW 2 Xv s go ivr rv a My vedw 3 3 WWI 5 imam15 go Mn 4 My Vecbv 2 3 N I 0 2 X2 8 2 7 X3 0 0quot Q 25 12 Now Haw we kvzow WW MAMMQ are V ook m some pwpev ees 05quot le ces 39 amt how we CM 59 worm WW WW MAMX Imam 30243 row 9 39 x 7 X2 8 T A a Co uml M60 We wrS le a wwdv39m s dimmaims as M x V where M is 145 MWWb Y a4 WW5 W m is Hm mumb v a CbiMWllIS csxsgt 2s 37 ib mo Maw 91 MW an Twno WAM 6 CM 308 Wml plifd g W r 3 War immr a nwzevzsims a ra xm gx vsmag intlav I Aimeus ws V mew A3m n5iw she W A nwwswus A We Riv How do we WWHP W wwi39 ce 397 o l i 3 1 a 70 3392 00393 u 2 a 71 30 001 2 3 l0 i 3972 lt93 007 53 27 0 ll OWW emm egz 391 A I z a 2 1 1444347 ll273l 1 o I 3 7 2o3l72 lo7IZ I 7 l 2391 8 n a 1 i 3 2 3 239 39 Inner d3m VaS Imqs Staff 0 Z 3 agree a wal ripbimkm W ale CIAM MMHPHMHW 35 m r cDWLWLM39aHV Ly WAev WHers a We Aw i E m us even Wwa We 31 f 2 Q 3 wws Aivnwa m LI 8 4 How do 1 vemwbev H We Aewzwiws are mm 3m Columns N commu by mos WXM W X l Vows X alumna 1 W myec D39VSi0n Divieim is mi exnaval Aa vxedlv19 ad wa use We Wm rix imV V i 391 3X b 3 1 72 da V m Aa itmed Degwa a MamWm Warm M g a where f it We Emmy vm w x 1 has ENDS OW W AJMOMJ Mai owes ever wmva Glee 39 jg t 1 I 0 6 M 309 0 3 51gt i m wmam n2 w Aquot 0 X1 7 0 x2 l39k l 42 quot390 l 0 60 x1 I 12 X3 39 Ye WWW adw mem How Ao we was Wa WM gwwsrz For am MMa Mc srix wa WW5 0 50in 2 n simmlmwous aqua Hb W APremwh39ves Wm be WW Wm Fmquot W6 2x12 Ease 1 an an 1 22 quotall 47 0 12 Ausz 1711 an 0m W5 MY 1449 a SpecM53 mwaea We SeamQM Dehvw mmw s arc 500A new Ali WMA S me WW bv ma 143ij W Clo 3b AeiermMe H3 v g km W Mveva If AeMQ o Wars is W7 MV VQ Debavvm Wm c Cw MM cm A a an Ear 2x2 W A 2 Man qua A ai h r Adc rmvmb am wmb ma m 0 W i We Dc kartm1 mowd s Ma cr39sx glelrcyvmimm xs ave formed b4 Addng we cambsmhws 0 2x1 41M nu o revm mm cs Gen ml Proweduret 4 Pick a row awn row Fve i er mbb3 me w3H4 Dts 01 res vvx 39 W M WW 2 Succe siveLa mass on aoluwms WVHe We caechm M we ovass39lWVQ i39imas 4m Aeiwev wva mamt 4 omei by We mwcmsed owr rm aw Column 3 Whm Magma ow am am whim mml cIpl39j 39 H M 39 wag Mimi by 4 4 Wham arosswt M M evw WW mmlH A HM whale mst 03 391 E M PM Mask aim by I Cohan A2 r 3 V1 3 m ltvgt 2A 1 LED Wu 2 Try a home ho dek mj W Mum WU oatquot X Trmeeosg Exchach WW9 39Pof Columns Devwke win Sufev w f t T39 1 ILI 123 25 a 456 a 3 ha Ma aub use a rm Z x1 X2 XBJQ Pm 6 D4quot 3 58466 MMlab 35 60 Quad pHh mazb39ices our and For Jams resth Hne semes cer will be 0 wri re eve eqm on P Qb e M Mime 01 m r ces Them w W DM M We coef kincs Md exewit H46 equamon x l 2 3 102 27 7 b to lt m l 5T gomdm39g Val ua Pmbiewgz 0 ar we lama Wij cws39dered groH WE when we lumen we cwdths a we pp m t M we m Mag e m m ro predict a o wr Fonts NM H W9 WW Valwag 4639 905 fa mi L 3 M6 E13 3115 u Hie mm 5 quot 13 xfi 39 quot439 quot l a X0 x x Emwdesi BeaM dailiech preblams Haw cmmmam Solvda ifm yaf k Wave anabvua ms QF HM 139 Waa 0130 AWE ma w s we Arm hue M kept we m w M Fi g 149 we m39i 9e WWW We Ram 44 Mm W lR a Cwa 2 39 Wi 4W3 QME AEQEvme Wmmh wa94ic liw39 g ANSMA ARiCerwces W Baha39i 3W by For if Q fdk r GEE wt aim j 43 u m at aid wmAai a 23 1M Ming 3 15 CXIH 5LMt ELJW39S WW I ji Bowatan vmwa prublEm m5 Laue a 2 Omar ODE wi rk wu bowWV adeH ftms A 3 W TxpTo WI H A value MTOM 7 34mg 9 900 39 Draw T Yom gw ei 6W 2 3M4 condi m Weak inc 52 5 Egg A lerme mam 2 SVJae cH Mjra A WWWEdda cleava ve W scha 430V Tm39 Thai 13133quot Cami m3 i erm 13mquot a 2quot Order dar wMRve 1339 FII h 39F Kidt 39 f g X44 X 6 05 A 1 l Kin 43Can quot3 V 254 UG Va Ve FAR 19 1 a a 615 of awvgam Fl39m39rhquot D3 farwm I order appmbMdEWS 2534 Foerat A39sWerW 39 2 4 quot 24 dxquot 1 Backward Ai cererwcc 4 quotquot Z FL 412 dxz39 hi WM A4 Ccrme 2 3 24 llI ab ht Kiev Ai fcvw ai 6 Wkng use 4 orwmA i VALILwMA d emuce air oowd mics use cowmd AJHCV WC 3w 39Mkrvw 14049 39 BUMAdar Value Prabiey i Emma Rea condchiSm km 39HL m real J Uquot L L 1 GovernWW3 539 39 k39 39 Ta Ti Ty Lw w al cle 7 tow Empemhk WWin r54 Jremgmx t Bevinwary CMAJHUMS T0 T m I some ws mg 5er FD Meerork 2323 MI X x x Val Ll Fiv wa3e3 1 2MJQ T T3 k quotTamL Wu kM VL 7 ma 22 12 1Ax e 172 Ag n xx 31 cherml Vm Tm 2 f xzr ka Tm ka TAsz Last ame males Tn z 21 33342 T quotI Wkbe W Mm j mm 1 RHS Tu2 zwx giw d kltx MTquot w39ng 03 a W H39SX 9Mer Adrwwk 39 i 2 Axhszf 1 C T 39 2szk l TL 397 0 I 2Axaje T3 45Ta2gtgt 1 1 5 N quot 50W WV 5x aw a mug W Iw 3V1 tour L39MTAAXZE GWGXMM 89 i 1 4 X RMWMqva 01quot air 1quot T4quot x 1mm ngxcer cuc lia em JEltXILTLgt xk T i1 To MoHuva3 Tux31 11 AltzTAx 2 r D z 1va Tw MTab T M v Evare Dinerenc TitI Foo rprivdz Draw Vich mt T T T quotI 1 bx 1 4 v 4 4 42 4 e9 4 q 42 x0 X1 X2 t1 x e Md 9 m revm Modes Ki quot39xhl Eomar vwclas a X gt X W g fW Le me We vanin 173 7 we 51 Nebula W61 W W xj wv Wix Sorting Algorithm and River Flow Data Analysis CVEN 302 2009 1 Introduction As you are probably aware from listening to the news oods are often judged in terms of a return period as in The ood in New Orleans resulting from Hurricane Katrina was between a 200 and 500year ood What this means is that statistically speaking one would expect a ood of that size to occur on average once every 200 or 500 years This is really a statement of probability indicating that the chance a ood of equal magnitude will occur in a given is 1 p500 6 0002 057 1 or 02 chance It is very possible that two such oods could occur in the same year However their joint probability would be p500p500 0000004 2 Hence oods of any magnitude can occur at any time we just express the likelihood of such an event using probability Hydrologists use knowledge of the return frequency of oods to design engineered structures that may fall in the path of certain oods For instance the region inundated by the 100 year ood is called the 100year ood plain and structures in this regions have speci c design requirements and can have very expensive insurance premiums Thus ood frequency analysis is important for designers and policy makes for making decisions The easiest way to estimate the return period of a given event is from knowledge of the prob ability distribution If you calculate the statistics of several random events return periods can be estimated from their frequency diagrams In the case of river ow data annual maximum ows are considered to be independent events and plot of these ranked data give the frequency diagram On the other hand if we use daily ow data each measurement is not independent if the river is high today it will likely still be high tomorrow but the data are still useful For daily data the ow duration curve is a plot of the ow versus the percent of the time the ow is equalled or exceeded In each case the river ow data must be sorted in order to create the frequency or duration curves In this exercise you will download data from the United States Geological Survey USGS database for rivers in Texas sort the data using the Shellsort algorithm and then use the plotted data to develop frequency and duration curves of the data and estimate the 50 year ood at that USGS gauge 2 Download USGS Flow Data Daily river ow data measured in cubic feet per second cfs are available online from the USGS For the practice data we will work with the USGS gauge 08108700 Brazos RV at SH 21 nr Bryan TX For the assignment application section you must download data from any other gauge in Texas that contains at least 50 years of data To obtain the data for the Brazos River use the following proceedure 1 2 10 Open the website httpwaterdatausgs govnwis in your web browser Click the link to Surface water For the daily ow data click the link to Daily Data Make sure the select boxes for State Territory and Site type are checked and click Submit Choose Texas from the State Territory drop down box and click Stream in the Site type box Scroll to the bottom of the page and click Submit Search the page for Site Number 08108700 and click on the link that that site Make sure the check box for Discharge is selected then click Tabseparated under the Output format list edit the Begin date and End date to include the whole Period of Record 1993 07015 to 2009 01 29 for this gauge on the day I m writing this and then click GO It may take a while for the page to load after you click GO so be patient Save the web page using File gt Save Page As and save the data using the le the name BrazosRiverDaily dat We still need the annual maximum ows Go back to the data homepage selected Surface water again and this time select Peakflow Data under the Statistics section instead of Daily Data as we did previously Follow similar steps to those outlined above to obtain the annual maximum ow data and save the data in the le BrazosRiverAnnualdat 3 InClass Work Now that we have the raw data we need to load it into Matlab sort it using the Quicksort algorithm and create the desired plots and calculations To begin we will work with the annual maximum ow data since the dataset is short enough that we can easily check by hand whether the sorting program and calculations are correct 31 Reading the Data into Matlab Open the BrazosRiverAnnual dat le in a text editor to see what the le contains The default LOAD command in Matlab can only work with data les that contain purely numbers in rows Even if we delete the header information the rst column contains the text USGS so we would have to delete that also This le is short enough to read into a spreadsheet program and create an appropriate le for the LOAD command but the daily data will be too long Hence we need to write our own program to read in this data Luckily this has been done for you and your instructor will give you the program readusgsm Move this program into the folder where you stored the ow data open Matlab and set the Current Directory in Matlab to point at the folder containing your data and the readusgsm le Do the following steps to read the annual data into Matlab 1 Look at the BrazosRiverAnnualdat le in your text editor and count the number of rows before the data table begins These are called header rows and will correspond to the variable nhead in the readusgs m le For the le I downloaded there were 67 header lines 2 On the secondto last row before the data begin there are a series of headers specifying what data are in each column Carefully count over to the column you want to read into Matlab This number will correspondto the variable datacol in the readusgs 111 Do not just count the columns that appear in the datasetwsome columns may be blank and your counting would be in error Always use the column labels to determine which column should be read For the the le I downloaded the Annual peak stream ow value in cfs is in column 5 3 Type gtgt help readusgs at the Matlab prompt to bring the help information for this pro gram up in the Command Window Read the help and follow along the example Once you understand how to use the program read the annual maximum ow data into Matlab Eventually these commands will be saved in a m le containing your program For now it is ne to just type commands at the Matlab prompt 32 Shellsort Algorithm To sort the ow data you will program a new Matlab function based on the Shell sort alrgorithm This numerical method is described in the Numerical Recipes texts which you will use Perform the following steps to get your sorting function working and test the function to sort the Annual Maximum Flow data in BrazosRiverAnnual dat 1 Open the website httpwwwnr com in a web browser and click on the icon for Obsolete Versions Then on the righthand side of the page select the link for Older Books Orr Line 2 Select Numerical Recipes in Fortran 77 from the list and scroll down to section 82 Straight Insertion and Shell s Method Download the PDF file and read the section on the Shellsort algorithm The shellsort algorithm which you need to code into Matlab is at the top of page 323 in the Numerical Recipes le you downloaded Open a new m le and save it as ssortm notice that SORT is already a built in Matlab function so we do not want to overwrite it The beginning of your program will read function a ssortCn a 397 7 SSORT Sort an array into ascending numerical order X For vectors SSDRT N X sorts the elements of Z the lengthN vector X in ascending order using the Shellsort algorithm see Numerical Recipes in X Fortran 77 Section 81 The input variables X are N the number of rows of X and X the array to be sorted The output variable is the sorted array 7 Z Example If X 3 5 4 7 5 2 6 X then ssort7X is 2 3 4 5 5 6 7 Z See also sort You should also include the data and your name in the comments block In order to translate the Fortran code into working Matlab code you need to understand a few important details First Fortran cannot store in a variable until it knows what kind of data to expect for the variable At the top of each Fortran code there is a declarations block that tells Fortran the data types for all the variables used in the code Matlab does not need this information So the rst line of the Fortran code has been translated for you and is given in the block above and the remaining lines 2 7 do not need to be entered into Matlab Second Fortran has the behavior that the number 3 is an integer and the number 3 or 30 is a real number On line 12 of the Fortran code the command incinc 3 in Fortran will always generate an integer never a fraction In order to get this behavior in Matlab you will need to code this line as inc floorCinc Type gtgt help floor at the Matlab prompt to learn more about the FLOOR function in Matlab Third Fortran uses slightly different syntax for the FOR and IF structures These are sum marized as follows with the Fortran code on the left and the equivalent Matlab code on the right doi11O fori110 j i j i enddo end if ige11 then if 1 gt 11 i 10 i 10 endif end The inequality symbols in Fortran are summarized as follows lt is lt le is lt eq is gt is gt ge is gt Finally the goto statement in Fortran is used to create a wide variety of WHILE structures You course textbook suggests the general form of the WHILEstructure to be while 1 statements if condition break end statements end The 1 in the WHILEstatement makes the loop execute until the BREAK condition is true This is programmed in Fortran in two di erent ways 1 continue statements if condition goto 2 statements goto 1 2 continue Or since the continue statement doesn t really do anything7 you can get away with 1 statements if condition goto 2 statements goto 1 2 statements Since it should be logical to read the goto and if statements it is best to gure out exactly what the program is doing and then try to formulate the appropriate WHILE statement rather than trying to blindly force the Fortran code into Matlab Consider for instance the following example i 10 i 10 1 i i 1 whileCl if i gt 5 goto 1 i i 1 if i lt5 break end end Using these hint code the Shell sort algorithm in Matlab To help you out your solution should have the structure statements while 1 statementCs if condition break end end while 1 statementCs x 104 Annual Maximum Flow 10 i I I I I I I Ii 8 E 6 3 3 E 4 39 2 0 l l I l 0 2 4 6 6 1O 12 14 16 16 Year 0 Flood Frequency Diagram 10 I I I 5 C l m 3 U 9 LL E l E 1 5 10 l l l l l 1 2 3 4 5 6 7 8 9 Flow 013 x 104 Figure 1 Flood frequency diagram for the Brazos River at SH 21 near Bryan TX for statements while condition statements if condition break end end statements end if condition break end end Once you have completed your Matlab coding print it out and compare it very carefully to the structure above and to the Fortan code in the Numerical Recipes book Then run the code at the Matlab prompt to check and debug it Once the code is working you can quit for the day or work on the nal plotting exercise for the inclass work 33 Return Period Use the tools developed above to write a Matlab program to create the plot shown in Figure You can create multiple plots in one gure using the SUBPLDT command The x axis in the upper plot is just the year number in the data The graph starts at year 3 since the rst two years had missing data and were read into Matlab as inf For the lower plot you will need to use the SEMILOGY function in Matlab The y axis is the year number divided by the number of measured datapoints NDATA minus to the two inf datapoints Thus you will have to search through your sorted ow vector and count the number of inf that occur For that step7 you will nd the Matlab function ISINF very useful To get you started here is the beginning of the solution program Z FLOODFREQm This program reads in annual maximum flow data downloaded from the USGS website and creates the floodfrequency diagram for the data Edit the top of the file to use with different data files The resulting graphs can be printed or interrogated from within Matlab to evaluate return Z periods It is a good idea to clear the workspace whenever you run a program clear clc Enter the data file and headercolumn information fname BrazosRiverAnnualdat nheader 67 ncol 5 Reading from the graph the 10year ood based on this data is 72800 cfs 34 FlowDuration Curve The daily data should be used to develop the owduration curve This curve provides the ow magnitude versus the percent of the time the magnitude is equaled or exceeded Figure 2 provides the results for the Brazos River example data Reading from the graph a ow of 50211 cfs is equalled or exceeded 061 of the time 4 Assignment For your graded assignment you will analyze a USGS gauge having at least 50 years of measured data You will turn in your assignment in the form of a typed Memorandum giving a few details of your data methods and analysis7 and reporting the 10 20 and 50 year floods and the draught flow rate that is exceeded 95 of the time Your report should also include a plot of the duration frequency diagram at your selected gauge The Appendix to the report should contain your Matlab les and the graphs presented here in Figures 1 and 2 to verify that your codes are calculating correctly

### BOOM! Enjoy Your Free Notes!

We've added these Notes to your profile, click here to view them now.

### You're already Subscribed!

Looks like you've already subscribed to StudySoup, you won't need to purchase another subscription to get this material. To access this material simply click 'View Full Document'

## Why people love StudySoup

#### "I was shooting for a perfect 4.0 GPA this semester. Having StudySoup as a study aid was critical to helping me achieve my goal...and I nailed it!"

#### "I used the money I made selling my notes & study guides to pay for spring break in Olympia, Washington...which was Sweet!"

#### "Knowing I can count on the Elite Notetaker in my class allows me to focus on what the professor is saying instead of just scribbling notes the whole time and falling behind."

#### "It's a great way for students to improve their educational experience and it seemed like a product that everybody wants, so all the people participating are winning."

### Refund Policy

#### STUDYSOUP CANCELLATION POLICY

All subscriptions to StudySoup are paid in full at the time of subscribing. To change your credit card information or to cancel your subscription, go to "Edit Settings". All credit card information will be available there. If you should decide to cancel your subscription, it will continue to be valid until the next payment period, as all payments for the current period were made in advance. For special circumstances, please email support@studysoup.com

#### STUDYSOUP REFUND POLICY

StudySoup has more than 1 million course-specific study resources to help students study smarter. If you’re having trouble finding what you’re looking for, our customer support team can help you find what you need! Feel free to contact them here: support@studysoup.com

Recurring Subscriptions: If you have canceled your recurring subscription on the day of renewal and have not downloaded any documents, you may request a refund by submitting an email to support@studysoup.com

Satisfaction Guarantee: If you’re not satisfied with your subscription, you can contact us for further help. Contact must be made within 3 business days of your subscription purchase and your refund request will be subject for review.

Please Note: Refunds can never be provided more than 30 days after the initial purchase date regardless of your activity on the site.