matlab VBA代写:H14ERP Coursework 3 Error and Data Analysis Laboratory Assignment

H14ERP Coursework 3 – Error and Data Analysis Laboratory Assignment 1. Assignment Learning Outcomes

It is intended that you will demonstrate the following learning outcomes and be able to:

  •  Formulate and evaluate methods of experimental measurement and error analysis;
  •  Synthesize experimental data using a variety of software tools. It is anticipated that you will also develop your skills in:
  •  Preparation of technical reports and effective communication.
  •  Effective use of general IT tools.
  •  Adopting a scientific approach to problem solving.
  •  Exercising initiative and personal responsibility.

    2. Resources

    You will need:

  •  to be enrolled on the Moodle course H14ERP;
  •  your own memory stick to save files;
  •  ‘bouncy’ balls and measuring tapes (all provided);
  •  your own digital watch or stopwatch phone app;
  •  a hard floor and next to a wall onto which you can affix the measuring tape;
  •  a group of 4, 5 or 6 people with whom you will work;
  •  MS Excel, MATLAB and MS Word or similar; and
  •  audio recorder (supplied).

    3. Requirements

    You are required to form groups of 4-6 people and arrange to complete the experiment and data collection in your own time.

    Using the equipment provided and the theory below, you are required to determine the Coefficient of Restitution of the ‘bouncy’ ball as accurately as you can, applying whichever measuring techniques you deem to be most appropriate. Further you are to plot data in MS Excel and MATLAB and present the plots in your report – see later details.

    You are required to submit a report which should not need to exceed 6 pages of size 11 text. The report should contain the following:

  •  a title, including, your name and ‘studentID’;
  •  ashortsummary(oneparagraph);
  •  an introduction to the laboratory (one paragraph);
  •  a concise but complete account of the selection and justification of

    measuring techniques, describing your methods and focusing on the more H14ERP Laboratory Assignment 1 Error and Data Analysis

challenging issues, and outlining how the errors in measurement could be

reduced;

  •  a concise but complete account of the data and error analysis as a

    commentary to accompany the plots presented within the report;

  •  mainconclusions(oneparagraph);
  •  include appropriate diagrams and screenshots; and
  •  (additionally)youaretosubmitthefilesdevelopedinMSExcelandMATLAB.

    4. Marking Scheme

    This laboratory is worth 50% of the H14ERP module. A provisional detailed marking scheme can be found on the last page of this document. You must also hand in the MATLAB scripts and the MS Excel file you use.

    5. The Laboratory and Theory

    The aim of this laboratory is to enable you to apply the techniques for calculating the error in a final result based on the individual errors in measurements recorded. You will then compare the values obtained with theoretical values generated using simulation methods and finally do a comparison of data obtained with these values.

    5.1 The Theory

    Following each bounce the height to which the ball rises is determined by the coefficient of restitution (COR) which is a fractional value that represents the ratio of velocities before and after impact. For a COR value of 1 the collision is perfectly elastic, there is no loss of energy and the ball will continue to bounce indefinitely; a value of COR=0 and the ball stop on the first impact; for values in between there is a decay in bounce height (there is a ‘theoretical’ idea of COR>1 but we will not consider this!).

    𝐶𝑅 = 𝑣𝑏−𝑣𝑎 (1) 𝑢𝑎−𝑢h

    for two colliding objects, where
    va is the final velocity of the first object after impact

    vb is the final velocity of the second object after impact
    ua is the initial velocity of the first object before impact
    ub is the initial velocity of the second object before impact.

    Even though the equation does not reference mass, it is important to note that it still relates to momentum since the final velocities are dependent on mass.

    For an object bouncing off a stationary object, such as a floor:
    𝐶𝑅 =−𝑢𝑣 (2)

H14ERP Laboratory Assignment 2 Error and Data Analysis

where,

v is the scalar velocity of the object after impact, and

u is the scalar velocity of the object before impact. The coefficient can also be found with:

𝐶𝑅 = √𝐻h (3) for an object bouncing off a stationary object, such as a floor, where

  •  h is the bounce height, and
  •  H is the drop height.
    For two- and three-dimensional collisions of rigid bodies, the velocities used are

    the components perpendicular to the tangent line/plane at the point of contact.

    5.2 Speeds after impact

    The equations for collisions between elastic particles can be modified to use the COR, thus becoming applicable to inelastic collisions as well, and every possibility in between.

and

where

va is the final velocity of the first object after impact,
vb is the final velocity of the second object after impact,
ua is the initial velocity of the first object before impact,
ub is the initial velocity of the second object before impact, ma is the mass of the first object, and
mb is the mass of the second object.

(4)

(5)

H14ERP Laboratory Assignment 3 Error and Data Analysis

5.3 Derivation

The above equations can be derived from the analytical solution to the system of equations formed by the definition of the COR and the law of the conservation of momentum (which holds for all collisions). Using the notation from above where u represents the velocity before the collision and v after, we get:

(6) Solving the momentum conservation equation for va and the definition of the

coefficient of restitution for vb yields:

(7) Next, substitution into the first equation for vb and then re-solving for va gives:

(8)

A similar derivation yields the formula for vb. 5.4 Technique

You will drop one of the provided balls from a height of your choice. You need to record the time between bounces, the initial drop height and the height to which the ball rises following each bounce; this is shown in Figure 1. This should be done for five bounces; you should also record the time taken for bounce number 10.

H14ERP Laboratory Assignment 4 Error and Data Analysis

You should estimate the accuracy with which each measurement can be taken. This will depend on many factors, one of which is your reaction speed. As well as taking manual measurements, record the sound of the ball dropping using the audio recorder, for later analysis.

6. Data Analysis (using Excel)

Using the data you took by hand, you are required to plot graphs showing for each bounce:

the heights returned to (H0, H1, H2 etc.); and
the time taken from initial release to each bounce (i.e. Δt0, Δt0+ Δt1,

Δt0+Δt1+ Δt2,).

For each graph, plot a line of best fit and determine the value of COR – you may need to research how to do this yourself. (Hint: This will not be a straight line – think about equation 3!)

Now calculate the average and standard deviation the COR values within each ball drop experiment. Also calculate the average value of COR and standard deviation across all experiments, which value do you think will be more accurate?

6. Simulations based on determined value for COR 6.1 Using MS Excel

Knowing the COR and initial height dropped in the experiment, simulate ten bounces of the ball displaying both the height returned to following each bounce and the total time to each impact.

Compare the value for the time taken for bounce ten and compare this with the value observed during the experimental work.

H14ERP Laboratory Assignment 5 Error and Data Analysis

6.2 Using MATLAB to simulate the ball bounce

You are required to develop a simulation that prompts for the initial drop height and COR. It should then produce a plot showing the bounce pattern of the ball (it should resemble Figure 1).

Compare the value for the time taken for bounce ten and compare this with the value observed during the experimental work and from the simulation from 6.1. Comment on any dependencies.

Once you have done this edit your code to produce an animation of the bouncing ball. Save this as an .avi file. Make sure you submit it to Moodle in the .zip file with the rest of your work.

6.3 Using MATLAB to more accurately analyze the ball bounce data

You should have used the audio recorder to record the sounds of the ball dropping and bouncing. Use the following code to plot the audio data as a function of time. Make sure the graph has correctly labeled axes and a title. Now adjust the code to remove the background noise. This should only require one for loop and one if statement, make sure you place the code in your final report. Replot this graph of processed data and include it in the report. Choosing just one experiment, use this program to help you calculate the error in the manual measurements. Calculate by how much this error could have changed the value of COR? Comment on how accurate the audio recorder and MATLAB script are in determining the time between bounces.

a=audioread(‘file_name.WMA’); l=size(a);
l=l(1);
sound(a,44000)

b=a(1:l); x=linspace(0,1,l); plot(x,b);

7. Submission

You should submit, via electronic submission, the following in a single .zip file:

  •  The report file as a pdf. This pdf should include plots from MS Excel and MATLAB.
  •  The MS Excel file
  •  The MATLAB files
  •  The animation.

    The zipped folder should be entitled as <surname>_<firstname>_<studentID> e.g. Smith_John_00000000.zip

    The assignment should be submitted in Moodle as follows: H14ERP > Coursework Information > Coursework 3 – Submission

H14ERP Laboratory Assignment 6 Error and Data Analysis

Note: The main text must be submitted as a pdf, docx/doc files will not be marked and awarded a mark of zero. Also, only zip files should be submitted. If our computers cannot open the archive file because it’s in a strange formation (.rar, .tar, .gz, .7z, etc.) we will also award a mark of zero for the work.

N.B.: Although you are collecting the experimental data as a group, you should note that the analysis of the data and all subsequent written work must be individual work not group work. For this assignment, all work submitted to Moodle or the student office must be individual work not group work. The standard university plagiarism rules apply.

Please keep a backup of your submission.

H14ERP Laboratory Assignment 7 Error and Data Analysis