Answered step by step
Verified Expert Solution
Question
1 Approved Answer
b) An engineer develops a program in MATLAB to predict flood due to heavy rainfall in Malaysia. The program should correlate amount of rainfall and
b) An engineer develops a program in MATLAB to predict flood due to heavy rainfall in Malaysia. The program should correlate amount of rainfall and water level of the river. As trial, the engineer creates a short program for three river monitoring stations in Johor as given in Table 1.1. Table 1.1 River monitoring stations in Johor City Danger Level (m) Johor Bahru Kota Tinggi Segamat River monitoring stations Sg.Skudai Sg.Johor Sg.Lenik 3.00 9.80 6.00 The program should receive input of rainfall precipitation and expected to give warning when the water level exceeds the danger level which that can cause floods, alert message when water level rise from normal level or safe message if water at normal level. In order to create the program, the engineer gathers information as below: Q = 0.1767P + 0.8248 (1.1) Equation 1.1 obtained from regression of historical data of precipitation, P (mm) and water flowrate, Q (m/s). (BH)5/3/5 Qr n(B + 2H)2/3 (1.2) Equation 1.2 used to estimate the flowrate of a river, Q. (m/s), where S is slope (m/m), H is depth (m), B is river width (m) and n is Manning roughness coefficient. The parameter for each river is given in Table 1.2 below. Table 2.1 Parameters of river in Johor B 18 River Sg Skudai Sg Johor Sg Lenik S 0.0003 0.0001 0.0002 0.05 0.14 23 20 0.095 The engineer creates a program by comparing the maximum Q, calculated at danger level of height with Q. If Q is greater than Qr, thus the water level exceeds the river danger level, while if Q is around 70% of Or, it is at alert level otherwise it is at normal level. The expected results of the program are shown in Figure 1.1. Nevertheless, the engineer encountered problems where program in Figure 1.2 has 20 errors messages. As an expert, help the engineer to analyse the errors messages shown in Figure 1.3. Rewrite all the MATLAB commands with corrections in Figure 1.4. Remain the program structure and number of lines as original MATLAB program. In your answer, please highlight fixed errors using highlighter. (40 Marks) Command Window >> PloodPrediction2 Select city: Johor Bahru/Segamat/Kota Tinggi Johor Bahru Average Precipitation (mm) - 124 Error in input. Please try again >> Flood Prediction2 Select city: Johor Bahru/Segamat/Kota Tinggi= Johor Bahru Average Precipitation (mm) =124 !!! ALERT! Water level rise above normal level at sg Skudai river in Johor Bahru city >> Flood Prediction2 Select city: Johor Bahru/Segamat/Kota Tinggi= Segamat Average Precipitation (mm) -100 ***Water level at Sg Lenik, Segamat: Normal level*** >> Flood Prediction 2 Select city: Johor Bahru/Segamat/Kota Tinggi Kota Tinggi Average Precipitation (mm)=320 !!! WARNING! Evacution needed. Sg Johor river in Kota Tinggi city exceed the danger level. Please evacuate people to the nearest evacuation center. Figure 1.1 Expected results of program executed for different cases
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started