Reference no: EM132877933
KAA109 Engineering Problem Solving And Data Analysis - University of Tasmania
Experimental Data Processing Wave Forces on a Truncated Cylinder
Objectives
The primary emphasis of the assessment is to develop a MATLAB program to read, treat, process and present results of experimental data.
TASKS
Introduction
When conducting experimental research, it is important that the experiment be repeated several times in order to check the repeatability and increase the accuracy of the results through averaging.
However, when experimenting in a control environment using monochromatic (one frequency) waves, the periodic recurrence of the waves can be considered as repeats. Each period can be separated and averaged together. This process is called "Phase Averaging" (See paper provided with the assignment for some example of application (Howe and Nader, 2017)).
Phase Averaging is a post processing method for wave experimental data and the aim of this assessment is to develop such program in order to process the truncated cylinder wave basin experimental data. Once the data have been processed, the forces and moment on the truncated cylinder can be derived which will allow you to investigate their changes depending on the incident wave frequency and wave heights.
There are six channels recorded in this experiment: "Ch0_Incident_WP", "Ch1_Phase_WP", "Ch2_Sway_Force" "Ch3_Surge_Force", "Ch4_Heave_Force", "Ch5_Pitch_Moment". Within the program and results, the forces and moment can also be referred as Fy, Fx, Fz and My respectively. For more information on these data check the videos related to the experiment.
Part one: Developing the Phase Averaging Method
In order to develop the method, we start with a simple wave sample. The Excel document ‘wave1.xlsx' contains the Time (s), and the incident wave probe measurement (mm), Ch0_Incident_WP. The frequency of this wave sample is f = 1Hz.
1. Make a program, ‘Part_1.m' which loads the data (Time, Ch0_Incident_WP) saved in the excel document ‘wave1.xlsx' and plots the elevation as a function of time in figure 1.
2. Calculate the remainder time, t_r, after division between the time array Time and the period T (check the function rem in MATLAB) and plot Ch0_Incident_WP against t_r in figure 2. You should now see all the periods superposed on the same graph.
3. Create the vector Tvec going from 0 to T with 51 points spaced regularly with a time- step dt. Calculate dt. You can then calculate the vectors Ch0_Incident_WP_PhAv which are the phase-averaged of Ch0_Incident_WP. Ch0_Incident_WP_PhAv should contain 51 points:
- the first and last point are the same and are the average of all the points of
Ch0_Incident_WP with a remainder time t_r < dt/2 or t_r ≥T - dt/2.
- The rest of the points n (2,3, ... ,50) should be the average of all the points of Ch0_Incident_WP with a remainder time between
Tvec(n) -dt/2 ≤ t_r < Tvec(n) + dt/2
n going from 2 to 50.
In Figure 2, add the plot Ch0_Incident_WP versus t_r with Ch0_Incident_WP_PhAv versus Tvec.
Part Two: Writing the UDFs
The Excel document ‘wave2.xlsx' contains a sample measurement with Time (s), Ch1_Phase_WP (mm), Ch3_Surge_Force (g) and Ch5_Pitch_Moment (Nm). The frequency is f = 1Hz.
1. Create the user-defined function [Tvec, Data_PhAv] = PhaseAveraging(t, Data, f) which returns the 51 points time vector, Tvec, and phase-averaged vector, Data_PhAv, for argument inputs of a given time vector t, data vector Data and frequency f.
2. Create the function Amp = Ampl (Data_phAv) which returns the averaged amplitude of the vector Data using the maximum and minimum of Data_PhAv.
3. Create the function Data_ph = Phase(Tvec, Data_PhAv, Phase_PhAv, f) which calculates the phase difference (in degrees) between the phase-averaged data Data_PhAv and the phased average phase wave-probe, Ch1_Phase_WP_ PhAv, by using the time difference between their respective maximums and minimums. (See KAA109_Calculating_Phase.pdf)
4. Write a program ‘Part_2.m' which
a) loads the data saved in the ‘wave2.xlsx',
b) calculates the phase-averaged data of each of the measurements (Ch1_Phase_WP_PhAv, Ch3_Surge_Force_PhAv and Ch5_Pitch_Moment_PhAv) as well as the related vector Tvec (using your PhaseAveraging function), and plot the results.
c) calculates the averaged amplitudes of the surge force (A_Surge) and the pitch moment (A_Pitch) (using Ampl).
d) calculates the phases of the surge force (Phi_Surge) and the pitch moment (Phi_Pitch) (using Phase).
e) saves the figures as ‘.png' format named ‘Part_2_ChX_[Name]_[Measurement]_PhAv.png'.
f) and saves the results (f, Tvec, Ch1_Phase_WP_PhAv, Ch3_Surge_Force_PhAv, Ch5_Pitch_Moment_PhAv, A_Surge, A_Pitch, Phi_Surge, Phi_Pitch ) in a .mat file named "Wave2.mat".
Your program should display the resulted amplitudes and phases on the command window.
Part Three: Application to the processing of Experimental Data
In the previous two parts the data has already been pre-selected and processed with the calibration parameters. The data file returned in an experiment through LabVIEW has first to be processed to include the calibration factors and zeros (See KAA109_Reading_Experimental_data.pdf document). Furthermore, the data have several regions, a transitional region, a stationary region and a reflection region, see Figure 9 in (Howe and Nader, 2017).
1. Reading (5%):
Write a user defined function,
[Time, Ch0_Incident_WP, Ch1_Phase_WP, Ch2_Sway_Force, Ch3_Surge_Force], Ch4_Heave_Force, Ch5_Pitch_Moment] = read_Truncated_Cylinder_experiment_data(datafileName),
which returns the time and calibrated measurement related to one of the experimental data file, "DataFileName.dat".
2. Cropping:
It is important to understand that the incident wave probe is only used to measure the incident wave amplitude and being ahead of the cylinder, it receives the waves earlier than the other channels.
On the other-hand, the phase wave probe is only used for phase measurement reference to the other measurements and is in line with the cylinder.
It follows that the Ch0_Incident_WP needs to be cropped separately to the other measurements (Time_Ch0) and that all other measurements must be cropped together (Time_Ch1_5).
Write a user defined function
[Time, Ch0_Incident_WP, Ch1_Phase_WP, Ch2_Sway_Force, Ch3_Surge_Force], Ch4_Heave_Force, Ch5_Pitch_Moment] = read_and_crop_experiment_data(DatafileName),
which:
a) Reads the experimental data (make use of the function read_experiment_data);
b) Plots the Ch0_Incident_WP versus Time, allows the user to select the region of interest and crops the data following this region, (returning the related cropped data in Time_Ch0, Ch0_Incident_WP); (try to use the Matlab ginput funtion)
c) Plots all the other measurements versus Time on the same figure, allows the user to select the region of interest and crops the data following this region, (returning the cropped data Time_Ch1_5, Ch1_Phase_WP, Ch2_Sway_Force, Ch3_Surge_Force, Ch4_Heave_Force, Ch5_Pitch_Moment);
d) Saves the results (Time_Ch0, Ch0_Incident_WP, Time_Ch1_5, Ch1_Phase_WP, Ch2_Sway_Force, Ch3_Surge_Force, Ch4_Heave_Force, Ch5_Pitch_Moment) in a .mat file named ‘DataFileName_Cropped_Data.mat'. DataFileName being the actual name of the input file.
e) And saves the figure of the selected regions in ‘DataFileName_Ch0_Selected_Region.png'
and ‘DataFileName_Ch1_5_Selected_Region.png'.
(Ex: If the file related to the data is R12-02_moving.dat then the .mat file should be named ‘R12-02_moving_Cropped_Data.mat',
and the saved figures ‘R12-02_moving_Ch0_Selected_Region.png' and ‘R12- 02_moving_Ch1_5_Selected_Region.png'.)
3. By using your previously developed UDFs make a new UDF:
[A_Inc, A_Sway, Phi_Sway, A_Surge, Phi_Surge, A_Heave, Phi_Heave, A_Pitch, Phi_Pitch] = Process_Truncated_Cylinder_Experiment_Data(DataFileName, f)
where
A_Inc Amplitude (mm) of the incident wave.
A_Sway, Phi_Sway Amplitude (N) and Phase (degrees) of the Sway Force.
A_Surge, Phi_Surge Amplitude (N) and Phase (degrees) of the Suge Force.
A_Heave, Phi_Heave Amplitude (N) and Phase (degrees) of the Heave Force.
A_Pitch, Phi_Pitch Amplitude (Nm) and Phase (degrees) of the Pitch Moment.
(Careful with the units).
which:
a. loads the data from a given file, as in Part 3 - 1,
b. allows the user to crop the data as in Part 3 - 2;
c. uses the UDF PhaseAveraging (Part 2) to apply the phase-averaging method to the different channels;
d. uses the ampl and phase UDFs (Part 2) to calculate the amplitudes and phases;
e. saves these amplitudes, phases and the frequency in a .mat file
‘DataFileName_Processed_Data.mat';
f. Plot and save the phase averaging figures with the resulted amplitudes and phases in the title and with the appropriate name.
Write a program ‘Part_3.m‘ which applies this function to the given file ‘R11- 02_moving.dat' with frequency f = 1Hz.
(Note: this will be the first test we will perform when marking your assignment. We will use a different file to test your function. If your function works perfectly, you will get 85% on the spot).
Part Four: Presenting the Data
Using the pre-processed data on the provided spreadsheet plot on the same axis, but different colour, Asurge (in N) related to the targeted wave amplitude 10mm and Asurge related to the targeted wave amplitude 30mm. Save the figure as "Fx_truncated_Cylinder.png".
In a different figure, compare the normalised forced this time Asurge/Ainc (in N/m) related to the different targeted wave amplitude. Ainc the amplitude of the incident wave, should be transferred to SI units (N). Save the figure as "Fx_Normalised_truncated_Cylinder.png". (10%)
Do the same for the normalised heave force ASway/Ainc (N/m) and pitch moment Apitch/Ainc(N).
Attachment:- Experimental Data Processing.rar