Mathcad Worksheet 6

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 6

MathCAD worksheet 6 More Data Handling

This worksheet follows on from the techniques you learned in worksheet 5. e will use
mathCAD!s "ector and matri# maths o$erations to do some $rocessing of e#$erimental
data.
%y the end of this worksheet you should &e a&le to'
(ut error &ars on a gra$h of e#$erimental data
)se matri# maths to $re*$rocess e#$erimental data in a num&er of ways.
+nter$ret straight*line fits from $re*$rocessed data.
Error Bars on Graphs
+n worksheet 5 we saw how MathCAD could &e used to $lot e#$erimental data, in this
case the current measured through a resistor at different a$$lied "oltages. e will start &y
adding error &ars to this e#am$le. -$en the e#am$le where you created the gra$h to deal
with the resistor data.
MathCAD!s .*/ $lot facility has the a&ility to add error &ars to data $lotted. The error
&ars are formed from 0 ad1acent traces, one gi"ing the low limit of the &ar, the other
gi"ing the high limit. +n this case, to illustrate the $oint, we will assume that the measured
current is su&1ect to an error of 2345 of its "alue.
e start &y creating two "ectors to hold the high and low $oints of the readings.
Create a "aria&le to hold the $ercentage error.
6ote that 5 is a"aila&le as a unit.
Create the +Hi and +7o "ectors from +Measured
/our worksheet should look like this'
8rror 34 5
+Hi 3 8rror 9 : +Measured
.
+7o 3 8rror 9 : +Measured
.
MathCAD!s matri# maths a&ilities means that all of the "alues in +Hi are created with a
single line e#$ression, without the need to loo$ through the "ector, as you might do in
another $rogramming language.
Check the "alues of +Hi, and +7o as shown &elow'
6ote that in a ;$ro$er! worksheet, you would $ro&a&ly not lea"e the $rint of error "alues
in $lace if you were going to use it 1ust to create error &ars on the gra$h.
< D(7 0440,=,5,> 3?6
(H35>04 MathCAD orksheet 6
+Measured
4
3.0=
0.@5
=.>
@.A0
mA = +Hi
4
3.=5=
0.6A5
@.4>
5.@30
mA = +7o
4
3.34>
0.045
=.==
@.@0B
mA =
Ha"ing created the "ectors, it only remains to add them to the $lot, taking care to ensure
that the items on the #* and y*a#es corres$ond to each other. Call u$ the $lot formatting
dialog &o# and change the ty$e of $lot for the two error $lots to ;8rror!.
At this $oint your $lot should look like this'
4 3 0 = @ 5
4
4.440
4.44@
4.446
4.44B
6.35534
=
.
4
+Measured
+Hi
+7o
+Theory "" 9 :
5 4 CA$$lied CA$$lied , CA$$lied , "" ,
%y this time the $lot arguments a$$earing on the $lot a#es are starting to look a &it
cluttered. +t may &e &etter to use the format dialog &o# to turn off the dis$lay of $lot
arguments and $ut u$ some $ro$er a#es titles and a $lot legend.
Dee if you can work out how to format the gra$h to get the dis$lay shown &elow'
< D(7 0440,=,5,> 0?6
(H35>04 MathCAD orksheet 6
E
4 3 0 = @ 5
4
4.440
4.44@
4.446
4.44B
Measured
8rror
Theory
Measured Current across a resistor
A$$lied Coltage 9C:
M
e
a
s
u
r
e
d

c
u
r
r
e
n
t

9
A
:
Pre-processing experimental data
-ften, e#$erimental data will need some form of mathematical mani$ulation a$$lied to it
&efore it is in the correct form for a straight line $lot to &e taken. Here we will e#amine a
cou$le of cases and mani$ulate the data to get a straight line fit.
The Photoelectric Effect
The $hysics is co"ered in Felly, Gettys H Dko"e $A>6.
+n this e#am$le we will e#amine the case where a wa"elength needs to &e con"erted to a
frequency &efore $lotting.
hen a metal surface is illuminated with light of different wa"elengths the sto$$ing
$otentials 9C: of the $hotoelectrons are measured as shown in the ta&le'
934
*A
m: Dto$$ing (otential
9"olt:
=5B 3.64
@44 3.0=
@@4 4.A5
540 4.63
5@> 4.@4
5>4 4.=3
< D(7 0440,=,5,> =?6
(H35>04 MathCAD orksheet 6
Create a fresh worksheet to hold this data
Create an in$ut ta&le to hold all the readings.
e will &e referring to wa"elengths in nanometers 9nm: so define ;nm! as 34
*A
m
Create a "ector, , to hold the wa"elengths in nm
Create a "ector, Dto$C, to hold the sto$$ing $otentials in "olts.
/our worksheet should look like this'
8#$tData
=5B
@44
@@4
540
5@>
5>4
3.5A6
3.0==
4.A5=
4.646
4.@4=
4.=30
=
8#$tData
4 < >
nm
.
Dto$C 8#$tData
3 < >
C
.
Although the e#$erimental data gi"es the wa"elength in nanometers, the energy of a
$hoton, and hence the equation relating to sto$$ing $otentials is related to the frequency.
Do the ne#t task is to create a "ector to hold the frequencies, using the relationshi$'

where c is the s$eed of light, is the wa"elength and , 9greek letter nu: is the frequency.
MathCAD 3= already has a "aria&le ;c! defined which holds the "alue of the
"elocity of light. +f your "ersion of MathCAD does not ha"e this, you will need to
create the "aria&le and assign it the a$$ro$riate "alue.
Create the "ector to hold the frequencies.
(lot the sto$$ing $otential against the frequency.
Calculate the threshold frequency, 0, &elow which no electrons are emitted from
the surface.
8#$ress this as a frequency and as a wa"elength
According to the theory, the slo$e the line is h?q, where h is (lanck!s constant and q is the
electronic charge.
7ooku$ the electronic charge in the resource center, and use this to calculate an
e#$erimental "alue of (lanck!s constant. 9h8#$t:.
< D(7 0440,=,5,> @?6
(H35>04 MathCAD orksheet 6
/ou may well find that the "alue of he#$t is g"en as 4 &y mathCAD. This is due
to a feature of mathCAD known as ;Eero threshold!, where&y any num&er less
than the threshold is dis$layed as Eero.
To change the "alue of the Eero threshold, select the cursor away from any
equations and &ring u$ the dialog &o# ;IormatJKesult!. Change the "alue of Lero
threshold in the &o# to AA and close the dialog &o#. 6ow any num&er greater than
34
*AA
will dis$lay correctly.
+n the resource center, e is used as the sym&ol for the electronic charge. +
recommend using q to a"oid confusion with the &ase of natural logarithms.
Calculate the $ercentage error in the e#$erimental "alue of (lanck!s constant
com$ared with the "alue in the resource center.
Add a cur"e on your gra$h to show how the sto$$ing $otential should "ary with
frequency in theory. Does it follow the e#$erimental data $oints M
/our gra$h should look like this'
5
.
34
3@
6
.
34
3@
>
.
34
3@
B
.
34
3@
A
.
34
3@
3
.
34
35
4
4.5
3
3.5
0
0.5
8#$eriment
Theory f 9 :
f ,
E
< D(7 0440,=,5,> 5?6
(H35>04 MathCAD orksheet 6
(ower*7aw calculations
Many situations gi"e rise to a $ower law, in which the y "alue de$ends on the # "alue
raised to some $ower. The general form of these situations can &e modeled &y'
/ A e
% #
.
.
8#am$les of such situations, from $hysics and also the wider world are'
Kadioacti"e decay
Cooling
Com$ound +nterest
6um&er of transistors in a (C $rocessor
+n general, the im$ortant as$ect in all these cases is the time constant, %. +n order to
determine the "alue of the time constant we can take logarithms of &oth sides, which will
reduce the relationshi$ to a straight line fit.
ln A e
% #
.
9 :
.
e#$and ln A 9 : % #
.
where the interce$t of the line is ln9A: and the slo$e of the line is the time constant, %.
6ote that logarithms and e#$onentiation is only defined for dimensionless quantities, so
you need to ensure that'
There are no units on either # or y quantity &efore taking logs.
/ou correctly add &ack the units at the end of the calculation.
+t is sus$ected that some e#$erimental data confirms to the $ower law, /NA e
% #
The data is gi"en &elow, &y taking logarithms and finding the slo$e and interce$t,
determine the "alue of A and %.
3 3.568O=
0 5.==>8O=
= 3.B068O@
@ 6.0@>8O@
5 0.3=>8O5
The first column holds the #*"alues and the second holds the y*"alues.
Iirst $lot the y "alues against the # "alues on a standard gra$h,
Change the y*a#is to &e logarithmic and "erify that the $oints a$$ear to lie on a straight
line.
Iorm a "ector, ln/ and fill it with the logarithms of the y "alues.
(lot ln/ against the #*"alues on standard gra$h $a$er
)se Dlo$e and interce$t to determine A and %
Create a model and com$are with the data.
< D(7 0440,=,5,> 6?6

You might also like