The Student Room Group

Matlab coding

Problem 1
Seawalls are classic coastal protection infrastructure. The most critical parameters to be considered in the seawall design are the maximum wave loading and water surface on the seawall. Figure 1 shows a sketch of a wave interacting with a vertical seawall. In this case, the mean water depth (the water depth when the water is still) is 4 m. Various pressure sensors are installed on the seawall surface to measure the pressure distribution.
At one specific time, the water surface on the seawall is found to be 0.4 m above the mean water surface. The dynamic pressure recorded by different pressure sensors is stored in the array dataset whose first and second columns are the location (vertical coordinate z) and the dynamic pressure p, respectively. For convenience, the vertical axis (z-axis) origins is set at the mean water surface. This means that the seabed is at z = - 4 while z = 0.4 is the coordinate of the instantaneous location of the water surface. To secure satisfactory accuracy additional measurements have also been carried out. Some results are included in the array newdata, which has the same data structure as the array dataset. For clarity, the data in the array dataset is referred to as the low-resolution data, and the combined data in both dataset and newdata is referred to as the high-resolution data. These data are archived in the data file named ‘courseworkdata.mat’.
1) Processing the low-resolution data and high-resolution data. You need to delete the repeated data points from both sets and sort the data in ascending order of z.
(10 marks)
2) Using the low-resolution data, estimate the pressure gradient (i.e. 𝑑𝑝/𝑑𝑧 ) at different locations using appropriate finite difference schemes with a consistent order of O(h2), where h is the spacing. Due to the fact that the theoretical or the measured pressure gradient is not available, direct evaluation of the error is not possible. Instead, the error can be estimated by comparing the present estimation with the corresponding results with higher-order accuracy. To do so, you need to estimate 𝑑𝑝/𝑑𝑧 using the high- resolution data, which can be considered as the reference value for the error estimation. Using the L2-norm, estimate the error on the pressure gradient ranging from 4 to 0.4 with a spatial resolution of 0.2.
(20 marks) 3) Calculate the pressure force per unit spanwise length acting on the seawall by
integrating the pressure, ∫0.4 𝑝(𝑧)𝑑𝑧, using repeated Simpson’s rule. Similar to 2), you −4
need to use both low-resolution and high-resolution data to order to evaluate the error. (20 marks)
The pressure variations at different times were also recorded by the pressure sensors. The data file ‘pressureSignal.mat’ contains the pressure time history recorded by one pressure sensor with a sampling frequency of 100 Hz.
4) Using the Fourier Transform, one can reconstruct the signal by 𝑝(𝑡)= ∑𝑛 𝑎 sin(𝑓 𝑡 + 𝑔 ) in which the coefficients 𝑎 , 𝑓 and 𝑔 can be obtained using the
𝑖=0𝑖 𝑖 𝑖 𝑖𝑖 𝑖
attached user-defined function FourierTransform(t, p(t)). Plot the coefficients 𝑎𝑖 and
𝑔 vs 𝑓 . Reconstruct the signal by filtering any components with a frequency higher 𝑖𝑖
than 15 rad/s. Plot the filtered signal and the original signal at different time.



I’m pretty stuck on all

Quick Reply

Latest