Practical 1 P 1 Aintrotocomputingpdf

Download as pdf or txt
Download as pdf or txt
You are on page 1of 12

Department of Materials University of Oxford

Practical 1P1a

Introduction to Computing
What you should learn from this exercise

How to use the teaching lab computers and printers

How to use a spreadsheet for basic data analysis.

How to embed Excel tables and graphs in a Word document report.

How to consider accuracy and indicate errors in a practical write-up.

Safety

This practical only involves using computers and as such does not have any significant
practical risks.

Covid changes for 2020

In 2020 this practical is to be completed remotely without actually visiting the Teaching
Laboratory.

The practical briefing presentation by the Senior Demonstrator has been recorded and is
available online. In addition there is a recording of actually completing the whole practical
by following through the instructions in this guidance script.

You will not be sitting in front of the computers in the teaching lab, but instead you are
expected to use your own personal computer. As a member of Oxford University your
Nexus365 account provides Office365 which can be used online via a web-browser at
http://www.office365.com ( click Sign-In at top right of page and enter
username@DOMAIN e.g. [email protected] then at the Oxford Webauth webpage
enter your username and password ). Note that your account is also licensed to be able
to download and install upto 5 copies of Office365 onto your personal computers (see
“Install Office” button top right). Please now check that you are able to access Excel and
Word using your own personal computer.

Although you are expected to use your own personal computer to do this practical and
store your files, you should also be aware that the department runs a terminal server which

1P1a Introduction to Computing Page 1 of 12


Department of Materials University of Oxford
allows any member of department to use Remote Desktop to remotely login as though
sitting at a departmental desktop and to access files on the departmental fileserver, like
you would do when using the computers in the teaching lab computer room. Please follow
guidance at https://www.materials.ox.ac.uk/local/it/materials-remote-working.html to
make a VPN connection into the university network and then make a RDP connection to
oums-ts.materials.ox.ac.uk before login with <SSO>@OX.AC.UK. Note that anyone with
an Apple computer running MacOS will need to use version 8 Remote Desktop software
as supplied by [email protected] since the version 10 is incompatible.

In order to avoid overloading the limited resources of the terminal server you do NOT need
to use the terminal server for completing this practical (but is useful that you now know
how to do so). Please fully signout/logout from the terminal server (do not just disconnect).

From now on please just use your own personal computer and save files anywhere on
your own computer or in onedrive if using office365 online.

Since you are working remotely please ignore the section about printing from the teaching
lab computers and collecting your printout from the departmental photocopier. Similarly
please ignore the section about showing the printout to the Senior Demonstrator. If you
wish you can email your finished writeup to [email protected] but the
practical will not be formally assessed.

Overview

Download the example completed spreadsheet “Practical 1P1a complete.xls” from


https://canvas.ox.ac.uk under course “Practical Classes” and module “Michaelmas
Term”.

Open using Excel. The spreadsheet shows the results of running a model of plastic
behaviour of a metal, to simulate the effect of grain size (d) on yield stress (y). The
expected relationship is:


 y  B  A d 0 .5 
where d is the grain size and A and B are constants. The table in the upper left hand corner
shows the results: the yield stress produced by the model is shown for various simulated
grain sizes. There is also a column where 1/d has been calculated, so that we should be

1P1a Introduction to Computing Page 2 of 12


Department of Materials University of Oxford
able to get a straight line by plotting y against 1/d. From this we can then calculate A
and B (the intercept and gradient of the best fit line). You can see from the rest of the
spreadsheet that this has been done. Click on the "Graph" tab at the bottom to change
worksheet and view the completed graph.

In this computing exercise, you will build up this spreadsheet step by step. You will then
present these results in an unassessed practical write-up. You should include an
estimate of the errors (lack of accuracy) in the original data and therefore the error in the
calculation of the parameters A and B.

First Login

The teaching laboratory computers all run Windows 10. During term time the computers
are set to default to using SSO login credentials via the OX.AC.UK domain. Use your
university SSO login credentials to logon to the teaching laboratory computer.
e.g. OX.AC.UK\abcd1234 or [email protected]

Create a working folder

Open the file explorer window (Start->Search “explorer”, or use shortcut Windows+E). On
the teaching laboratory computers your main directory is stored on network drive “O:”
which is on the department fileserver. This means that it does not matter which computer
you sit at when using computers within the computer room.

It's a good idea to keep future work (practical’s, etc.) in suitably named folders so that you
can easily tell what is what. Create a new folder on drive O: called “1P1a” (click to select
drive O: then use the ribbon button “New Folder” or right-click the viewing pane and select
New -> New Folder).

Make a graph of the data.

Download the spreadsheet “Practical 1P1a blank.xls” from https://canvas.ox.ac.uk under


course “Practical Classes” and module “Michaelmas Term”. Store the downloaded file in
the 1P1a folder you created above.

Open using Excel. This version of the spreadsheet only has the basic data in it. (The
example file “Practical 1P1a complete.xls” should still be open and available for
reference; see VIEW tab / WINDOW group / SWITCH WINDOWS item in the Excel menu

1P1a Introduction to Computing Page 3 of 12


Department of Materials University of Oxford
ribbon. Alternatively you might like to ARRANGE ALL as TILED for side-by-side viewing.)

If prompted you may need to click on “Enable Editing” to trust the downloaded document.

Click on cell B2, and drag down to B6 which selects the column title “d(mm)" and values
for grain size which will become the x-axis for the graph. Hold the control key down (this
lets you select non-adjacent areas at the same time), and move the mouse to D2; drag
over the D2:D6 cells, which selects the “Stress(MPa)” title and data that you need to plot
on the y-axis..

Now create an X-Y scatter plot with the selected data, using the column B data series for
X-data and column D for Y-data. ( See INSERT tab / CHARTS group / SCATTER item –
version showing just points with no lines)

You can see that the stress on the system falls as the grain size (d) increases. However
the theory predicts that it falls linearly as 1/d. To see this, you need to plot the yield
stress against 1/d, not d.

Save the modified blank spreadsheet in your 1P1a folder with new filename “Practical
1P1a results.xls”.

Adding a new data series to the graph.

I have left a blank column (C) for you to put in the 1/d data. Select cell C3, and type “
=1/sqrt( “ then click on cell B3 (i.e. you are pointing at what you want the square root of)
then type “ ) ” and press “enter”. The number 0.141 should appear in cell C3. You now
need to copy this formula down over the remaining cells in column C. Click on cell C3 (if
it’s not already selected). You will see a little square in the bottom right-hand corner of the
cell. “Grab” this by clicking and holding the left mouse button over it, and “drag” the box
down over the cells below. Release the mouse button and the numbers will appear in all
the cells as the same formula has been applied to the selected cells.

Save your work again when you have got this right.

Now you need to add this new data to the graph. Select cell C2 then “click & drag” to select
cells C2-D6. Select the HOME tab / CLIPBOARD group / COPY item or use shortcut Ctl-
C. This has copied these data onto the windows “clipboard”. You will see (information bar
at bottom of window) that Excel now wants to know where to put it! Click on the graph,

1P1a Introduction to Computing Page 4 of 12


Department of Materials University of Oxford
thus activating the graph, and then select HOME tab / CLIPBOARD group / PASTE
dropdown / PASTE SPECIAL item. Tick the “Categories(X values) in First Column” box,
and then click “OK”.

The graph accepts the data but it isn’t quite right yet. The problem is that everything is
being plotted against a common X-axis, so all the newly added d data points all appear
stacked above X=0. You need to set up a different X-axis for the d data.

Make sure the chart is still active, and click on one of the data points that you have just
added. The data points in this series will "light up", and you can now fiddle with its layout
and characteristics. Selecting the chart causes CHART TOOLS to appear on the menu
ribbon. Select FORMAT tab / CURRENT SELECTION group / FORMAT SELECTION item
(or alternatively click the right mouse button and select FORMAT DATA SERIES item). A
set of options pop up, and you want to alter the "axis" characteristic. Make the series plot
on the "Secondary Axis". It is closer, but still not quite right, since a secondary Y axis has
been put in and what you want is a secondary X-axis. Now select DESIGN tab / CHART
LAYOUTS group / ADD CHART ELEMENT dropdown / AXES / SECONDARY
HORIZONTAL which gets rid of the “Secondary Vertical axis” and turns on the "Secondary
Horizontal axis". The data points which previously appeared bunched above X=0 should
now be distributed across the whole area of the graph.

A few more minor changes are desirable. The graph axes and the chart itself all need
labeling. You could also select your new x-axis at the top, and format it to have a fixed
scale that starts at 0.05 rather than 0.00. If there is a legend beside the graph, select and
delete it. Comparing with the completed example, work out how to make the changes
using the DESIGN tab / CHART LAYOUTS group / ADD CHAR ELEMENT dropdown
menu.

Your graph should be looking better and suitable for presenting in your report.
Time to save again!

Regression analysis

There are two functions to perform regression analysis. One, "LINEST", returns the
parameters of the best fit line (slope, intercept, goodness of fit, etc.). Another, "TREND",
given a set of "wanted" X-values, returns the Y-values that lie on the best fit straight line

1P1a Introduction to Computing Page 5 of 12


Department of Materials University of Oxford
to the real data (i.e. you can use the TREND results to plot the best fit line). We'll use both:
TREND to get “best fit” values to plot, and LINEST to get A and B.

TREND

First, set up a column of your desired Trend X-values on the data worksheet. I suggest
values 0, 0.05, 0.10, 0.15 and 0.2, nice and regular. (See the finished version for an idea
of where to put these - in F3 to F7). We will use the column to the right of our "Trend X"
values to receive the "Predicted Stress" results.

1. Click and drag to highlight the empty “Predicted Stress” cells (G3:G7).
2. Click the "function" button, fx and search for TREND. Alternatively
3. select menu FORMULAS tab / FUNCTION LIBRARY group / MORE
FUNCTIONS dropdown / STATISTICAL menu:TREND / (you will see that there
are lots of other useful statistical functions available, such as "AVERAGE" and
"STDEV".)
4. Click "next". A Function Arguments dialog box appears asking you to select the
"known y's" (cursor is blinking in this bit) and "known x's". We want the stresses
(cells D3:D6) for "known y". You can either type D3:D6 into the box, or drag the
"function wizard" panel so that you can see the spreadsheet data, and then just
click and drag on the cells you want.
5. Now use the same method to select cells C3:C6 for the "known x's", and
F3:F7 for the "new x's".
6. If you were to press OK now, then only one value will appear in cell G3. ( if
you did this you will need to undo!) What you actually need to do is to press
Ctrl-Shift-Return all together. All the "best fit" Y-values now appear in cells
G3-G7. Why the Ctrl-Shift? Because what you are entering is an "array
formula". Each item in the “results” column is related to a calculation over
the whole “source” column.
7. Now add the data we have just created to the graph, in the same way as
you did above. Select F3:G7, copy it to the clipboard (HOME tab /
CLIPBOARD group / COPY item), activate the graph and paste special
(HOME tab / CLIPBOARD group / PASTE dropdown / PASTE SPECIAL
item).

1P1a Introduction to Computing Page 6 of 12


Department of Materials University of Oxford
Save it!

Finish the graph off / pretty it up by:

1. Clicking on the “best fit” data, and format to remove the data points, and make
the line a nice solid red.
2. Ensure that there are no lines joining the real data.
3. Since there is no legend and there are two sets of data and two X-axes, insert some
arrows to indicate which data points go with which X-axis. (INSERT tab /
ILLUSTRATIONS group / SHAPES dropdown / ARROW item)

LINEST

You will now get the values A and B that fit:


 y  B  A d 0 .5 
Select cells F11 and G11. Type "=" and use the "fx" button to activate the "function wizard"
again. Set up the "LINEST" function, with C3:C6 as the "known x" and D3:D6 as the "known
y". Remember to use Ctrl-Shift-Return (it’s another array formula, producing the results
from the “known y-values” D3:D6 and the “known x-values” C3:C6). Format the result to 2
decimal places. If you wanted to do so, you could confirm that these values do in fact give
the same straight line that TREND returns by using this formula to create another table of
model data and plotting another line on the graph.

Save the spreadsheet. The first part of the practical is now complete.

Write a one-page summary about this practical


Start the application “Word”. Add your name, today’s date and the title of this practical
report. This one-page write-up should contain a short paragraph about each of the
following: the aim of this practical; what you have done; what results you obtained; how
you analysed the data; what your conclusions are. Remember to clearly explain what data
you have used and how you have modified it and what the graph shows.

Do not spend too much time making the write-up perfect – you need to try to finish the rest
of this script!

To insert bits of spreadsheet into a word document:

1P1a Introduction to Computing Page 7 of 12


Department of Materials University of Oxford
1. Switch back to “Excel” (Alt+Tab switches between windows).

2. Select the bits you want from the spreadsheet (e.g. cells B2:D6)
and copy (HOME tab:CLIPBOARD group:COPY item)

3. Switch back to “Word”. (Alt+Tab)

4. I recommend pasting into Word as a “picture”. (HOME tab / CLIPBOARD


group / PASTE dropdown / PASTE SPECIAL item)

Save the document.

Printing and photocopying


Printing in the Department uses your SSO credentials. On teaching lab computers select
Start->Settings->Devices->Printers&Scanners to list the printers available on your
teaching lab computer. You should find “followme” and “hb30-tl-hp401dn” in addition to
several PDF printers.

“followme” should be the default printer. The followme print queue can be released at any
of the color photocopiers within the department (e.g. if there is a problem with the Holder
Building photocopier try going to Reception and using the photocopier there instead).

“hb30-tl-hp401dn” is a small desktop black&white printer in the computer room. The printer
will start printing paper as soon as you send your print job to that printer.

Further information about printing is at https://www.materials.ox.ac.uk/local/it/materials-


printing.html

Print your report to “followme” and then go and collect it

- go to the Holder Building photocopier in the main corridor near the stairs;
- present your university card to the contact-less card reader to authenticate;
- The photocopier should identify you and set your email address as the “scan-to-
me” email address. Then the photocopier will list any print jobs you have sent which
can be released for printing on that device. Release your print job and pick-up the
paper printout.
- After printing your document, you might also like to test using the scan-to-email
functionality of the photocopier. Put the paper printout onto the glass for
photocopying. Press Home button then select Scanner. Select the “Scan-to-me”

1P1a Introduction to Computing Page 8 of 12


Department of Materials University of Oxford
email address and press Go button to start scanning the page. Insert next sheet of
paper to scan or press # to finish (or wait 60 seconds timeout). A PDF scanned
copy of your document has been emailed to you.
- When you finish using the copier logout by pressing either of the right-hand buttons
showing the moon or the lock symbol.
- Note that spare toners are kept with the printer and can be fitted by users, but you
probably will want to ask the Teaching Lab technician for assistance if you
encounter problems with the copier.

Show the printout to the Demonstrator. They will check it over with you.

Further work - considering accuracy and errors

Whenever you present data to support an argument it is important to be able to justify


the accuracy of the data. For this practical you have been provided with model
measurements of stress and grain size.

Let us first consider how this data may have been obtained. Each yield stress value
represents a single measurement of the yield stress of one specimen. After testing
the specimen has been examined metallographically from which the grain size has
been measured as an average of measuring the size (average diameter? mean linear
intercept method?) of lots of grains (> 100 grains?).

What is the (lack of) accuracy of these measurements? Since each yield stress
measurement is a single measurement it has one value, but the value (e.g. 19 MPa) has
a precision of ±0.5 MPa due to being measured to the nearest 1 MPa. However the grain
size is an average of lots of measurements therefore it is possible to statistically analyse
these measurements to determine the standard error of each average. This is done from
the standard deviation of the data assuming a Gaussian distribution and therefore gives a
different error for each specimen.

The original spreadsheet “Practical 1P1a complete.xls” has a worksheet tab called “Data
with errors” which contains additional data for the errors in the stress and grain size
measurements. These errors have then been added to the graph as error bars as shown
on the worksheet tab called “Graph with errors”.

It is also desirable to consider the accuracy of the best fit line, especially the resultant

1P1a Introduction to Computing Page 9 of 12


Department of Materials University of Oxford
parameters A and B. We could get an approximate measure of that by putting a ruler over
the data with the error bars and calculating the lines with maximum gradient and line with
minimum gradient to give an estimate of the possible range of best fit line. This is shown
on the second graph on the worksheet tab called “Graph with errors”. However be aware
that this is approach is not mathematically justifiable! There is a proper mathematical
treatment for calculating the accuracy of the best fit line taking into account known errors
presented in “Errors of observation and their Treatment” by J. Topping (Chapman and
Hall) but it is not incorporated into Excel and is beyond the scope of this practical.

The analysis of errors is very important and will be covered in considerable detail later in
the course. At this early stage in the course students are expected to be aware of the
magnitude and source of errors and students should include consideration of errors when
presenting data in practical write-ups.

Add error bars to your graph


(DESIGN tab / CHART LAYOUTS group / ADD CHART ELEMENT dropdown / ERROR
BARS item / MORE ERROR BAR OPTIONS...)

Use the help menu in Microsoft Excel to work out how to add error bars to your graph!
(have a play around and see if you can work out how excel does error bars…)

You should also look at the spreadsheet “Practical 1P1a complete.xls” and try to work out
how the error data given on the sheet called “Data with error” has been added to the
graph entitled “Petch Plot with error bars” on the worksheet “Graph with errors”.

Consider the specimen with Stress = 11 MPa. We could ask how significant is it that this
point does lie off the best-fit line? When you add the error bars you find that the best-fit line
is intersected by the error bar indicating that the off-set of the data point from the line is
not significant.

If you want to get more marks for your practical write-up you should give a brief
description of errors in the practical and incorporate the new graph with error bars.

Updated your practical write-up with data and graph including error bars and add a brief
description of how errors have been considered and what the errors are in the values of
A and B. You will probably need to extend your write-up onto a second page.

1P1a Introduction to Computing Page 10 of 12


Department of Materials University of Oxford
Finishing
When you have finished, print off the final word processor document including the
consideration of errors, and show it to the Demonstrator. They will check it over with
you, to make sure you are clear on all points of this exercise.

Note: there are no marks given for this “practical”. It is for your benefit; unless you can do
the basic data manipulation dealt with here, you may have problems in handling and
presenting data from many of the other practicals.

Feedback
This practical class does not use the formal online practical feedback assessment
questionnaire however you are invited to complete following paper feedback form and put
your anonymous responses in the letterbox located in the corridor outside the teaching
labs.

1P1a Introduction to Computing Page 11 of 12


Department of Materials University of Oxford
Feedback Form for Practical 1P1a
Please complete this questionnaire and put your anonymous responses in the letterbox
located in the corridor outside the teaching labs.

1. How helpful was the Senior Demonstrator’s “briefing” session?

completely useless 0 1 2 3 4 5 very useful

2. Do you consider that you got out of the exercise what you were meant to?

not at all 0 1 2 3 4 5 completely

3. How did you find writing up the exercise?

very difficult 0 1 2 3 4 5 no problem

4. How did you find the length of the exercise?

far too short -3 -2 -1 spot on 1 2 3 far too long

5. How interesting did you find the exercise?

very boring 0 1 2 3 4 5 very interesting

6. How complicated did you find the exercise?

too basic 0 1 2 3 4 5 too complicated

7. Did the script give you enough information to do the exercise?

not enough -3 -2 -1 spot on 1 2 3 too detailed

Was there any information that was missing you would have expected/would have liked to
have received? If so, please give details below.

Any other comments? (Particularly for any problems exposed by responses to the
questions above)

1P1a Introduction to Computing Page 12 of 12

You might also like