121- Experiment 01

Embed Size (px)

Citation preview

  • 8/13/2019 121- Experiment 01

    1/18

    27

    Experiment

    IFunctions and Graphs: The Computer

    I. Introduction

    The purpose of this laboratory is to review the properties of some simple functions thatwill be used later to describe various physical phenomena. If you have not already doneso, you should read the Mathematics Review(sections VIII and IX) in the front of thelaboratory manual. This laboratory presupposes that you already know something aboutthe concept of a function, a function table, and its representation by a graph. pon

    completion of this laboratory, you will be e!pected to be thoroughly familiar with thelinear, "uadratic, sine, and cosine functions. To test and aid your understanding, you willmake graphs of these functions by hand and by computer graphics.

    II. Prelab

    #s a pre$laboratory e!ercise, make all the graphs and fill in all the function tables that youare re"uested to do by hand. That way, all your lab time can be used to run thecomputer. %oing a correct prelab in advance will give you bonus points& 'ee item ofthe ules and *rading +rocedures at the beginning of the laboratory manual.

    III. Printing Graphs

    Note:

    In the course of this aboratory you will be running the computer to make several kindsof graphs on the computer screen. %o not print these graphs onto paper using the laserprinter unless you are e!plicitly instructed to do so& -nly four of your graphs should beprinted onto paper. ach of the sections V# through V% will re"uire one such printing.

    ach particular subsection where a print is re"uired is marked by a /.

  • 8/13/2019 121- Experiment 01

    2/18

    28

    IV. The IBM Personal Computer: Appendix on Usage

    To complete this laboratory, you will have to have some familiarity with the use of apersonal computer. If you already have this familiarity, you are ready to proceed. If not,you should read this appendi! on computer usage before attempting to complete the

    parts of this laboratory that re"uire use of the computer.

    Figure I-1: The I01 +.2. with keyboard and monitor

    2omputer programs for the various laboratories have been written and are storedinternally on a hard disk. These programs can be loaded into the computer memory ande!ecuted by the central processing unit (2+). These operations, and the input of data tothe computer, are done via the keyboard. The instructions entered with the keyboardand the output of the computer are displayed on the %isplay 1onitor.

    ocate (but do not press&) the keys corresponding to the letters of the alphabet and theintegers. They are generally positioned according to the standard typewriter layout.ocate the additional keys indicated below that may be of use in your various labs.

    To start the computer running for the +hysics 343 aboratory, take the following steps5

    #. Turn on the power using the switch on the power strip.

    0. 2heck that the computer c.p.u. and the monitor are on. The monitor has a lightto show when it is on, and writing will appear on the screen if the computer ison.

    2. ither pull down the Physics menu with the mouse, or hit #lt + on thekeyboard.

  • 8/13/2019 121- Experiment 01

    3/18

    29

    %. ither select Physics 121by clicking on it with the mouse, or scroll to it using up$down arrow keys and then hitting enter.

    . ither click on Plots, or scroll to it and hit enter.

    6. 6ollow the instructions on the screen.

    *. If you get hung up, hit 2trl 0reak or call your T#.

    'hift The Shiftkey is always used in con7unction with a second keyand changes from lower case to upper case for letters, or to thesymbols indicated on the top of the key (e.g., 8 9 : key enters;). The eys

    #lt This key is used in con7unction with other keys in a mannersimilar to the shift key.

    2trl This key is used in con7unction with other keys in a mannersimilar to the shift key.

    +ause or0reak

    Top and front face of same key.

  • 8/13/2019 121- Experiment 01

    4/18

    30

    V. Exercises for Experiment I: Functions and Graphics

    ?ame 88888888888888888888888

    ab +artner ?ame 88888888888888888888888

    'core 88888888888888888888888

    A. he !i"ear Fu"ctio"

    inear functions are described by e"uations of the form

    baxy += .

    @ere xis the input variable andyis the output variable. The "uantities a, bare fi!edparameters (that is, definite known numbers) which specify the particular linearfunction of interest. ach such function is called li"earbecause its graph is a straightline. The parameter a is called the slo#eA it controls the rise or fall of the line withrespect to the horiBontal. The parameter b is called the y (vertical) i"terce#tA itdetermines the value thatytakes whenx = C.

    3. 'uppose the parameters a, bhave the values aD 4, bD l. sing a calculator,complete the function table below. et x range over the values $E to E withincrements of .: between successive xvalues.

    12 ==+= babaxy

    6or e!ample5 when $D E,yD (4 F E) 9 3 D G 9 3 D H.

    $ y

    $E.C

    $4.:

    $4.C

    $3.:

    $3.C $3.C

    $C.: C.C

    C.C 3.C

  • 8/13/2019 121- Experiment 01

    5/18

    31

    C.: 4.C

    3.C E.C

    3.: .C

    4.C :.C

    4.: G.C

    E.C H.C

    4. +lot on the ne!t page selected points from the function table you have 7ustcompleted. 'elect the ! and y scales in a way that is both convenient and yetconveys ade"uate information about the function plotted. 1ake sure all the valuesof ! and y fit on the page, but are not bunched too close together. In the samespirit, it is not always necessary to plot every point in the function table. 6or thisfigure, and those to follow, plot only enough points to get a feeling for how thefunction behaves. 'ome functions re"uire more points than others. 'ome parts ofthe graph, for e!ample regions where the function is changing rapidly, may re"uiremore points than others. %raw a smooth, simple curve through the points. abelthe a!es.

    yD a$9 %

    aD 4, %D 3

    E. *iven a function table or a graph for a linear function, let (x3,y3) and (x4,y4) be twopoints in the table or on the graph. 'ince two points determine a straight line, itshould be possible to compute aand%from(x3,y3) and (x4,y4). Indeed, the slope ais given by the relation

    ( ) ( )1212 xxyya = .

    -nce the slope ahas been found, the y intercept%is given by the relation

    11 axyb = .

    +ick two points on the graph you have 7ust made in part #4 above. se themto compute aand%from the formulas above, and verify that you do indeedget the correct values foraand%. 'how your work below.

  • 8/13/2019 121- Experiment 01

    6/18

    32

    . 2alculate and plot the linear function using the computer. ?ote that a singleprogram is used to calculate all of the functions for this lab, the particular function

    being selected from the menu. To e!ecute the program carry out the followingsteps5

    a. 'elect the linear function from the menu. %oing so causes e!ecution of thelinear function program. It will ask you for the values of the parameters aandb. Type, 4 and 3 (separated by a comma), and press the ?T key. ?e!t it

    will ask you for the X1I?, X1#X, and the increment @ (step siBe) betweensuccessive xvalues. Type $E, E, .: and press the ?T key.

  • 8/13/2019 121- Experiment 01

    7/18

    33

    b. Jhen the computation is finished the computer will ask if you want to see thefunction table. (2hoose to display 4C values of x. This fills the screen.) ookat this table. ?ote that the computer uses computer notation for displayingnumbers. %o the numbers agree with the table you preparedK 888888888888

    c. +lot the contents of the table by continuing. &o "ot #ri"t the gra#h' 'ketchthe graph in the space below. @ow does it compare with your graphK

    d. se the computer to compute and plot the linear function with the parametervalues aD l, bD 4A keep X1I?, X1#X, and @ the same as before. Agai"()o "ot #ri"t the gra#h'@ow does the plot compare with that found for a =4, b =3K 'ketch it below.

    e. !periment with the linear function by running the computer program severaltimes with different values of aand b, including both positive and negativevalues. &o "ot #ri"t your gra#hs.

    :. se the computer to plot a linear function that goes through the points (3,4)

    and (E,:). +ress + to print a copy of the graph. %o this twice to get a copy foreach lab partner, and sign your copy. 2ircle the points (3,4) and (E,:). Includethis printed graph as part of your lab report.

  • 8/13/2019 121- Experiment 01

    8/18

    34

    *. he +ua)ratic Fu"ctio"

    The "uadratic function is described by an e"uation of the form

    yD a$2 9 %$9 c

    where x is the input variable, y the output variable, and the "uantities a, b, c areparameters. ?ote that putting aD C gives the linear function as a special case. The"uadratic function e"uation

    y, a$2 %$ c

    can also be written in the form

    ( )[ ] ( )abcabxay 42 22 ++= .

    ?ote that the "uantity ( )[ ]22abx + , since it is a s"uare, is always positive or Bero.

    2onse"uently, the "uadratic function has an e$tremum (ma!imum or minimumdepending on the sign of a) when ( )[ ]22abx + DC, or e"uivalently

    ( )abx 2= .

    3. 'uppose the parameters a, b, chave the values aD $l, bD l, cD l. sing acalculator, complete the function table below. The tabulated values of yshould be accurate to : significant figures. et xrange over the values $4 to 4with increments of .4 between successive xvalues.

    yD a$4 9 %$9 c aD $l, %D l, cD l

    $ y $ y

    $4.C C.4 3.3G

    $3.L C. 3.4

    $3.G C.G 3.4

    $3. C.L 3.3G

    $3.4 $3.G 3.C 3.CC

    $3.C $3.CC 3.4 C.HG

    $C.L $C. 3. C.

    $C.G C.C 3.G C.C

    $C. C. 3.L $C.

    $C.4 C.HG 4.C $3.CC

    C.C 3.CC

  • 8/13/2019 121- Experiment 01

    9/18

    35

    4. +lot below selected points from the function table you have completed. 'electappropriate scales. %raw a curve through the points and label the a!es. Moushould get an inverted#ara%ola. abel the e!tremum, and state whether it is aminimum or a ma!imum. (If you make a mistake and find you need a new pieceof graph paper, there is an e!tra copy at the end of this lab.

    yD a$4 9 %$9 c aD $3, %D 3, cD 3

  • 8/13/2019 121- Experiment 01

    10/18

    36

    E. 2alculate and plot the "uadratic function using the computer.

    a. !ecute the "uadratic function program, list the first few entries of thefunction table, and plot the contents of the table as you did before. &o "ot#ri"t a"y gra#hs' se the same parameter values etc. as you used beforewhen making the function table and graph by hand. %o your and thecomputerNs function tables agreeK ('ketch your graph below.)

    b. !periment with the "uadratic function by running the computer programseveral times with different values of the parameters a, b, and c, including bothpositive and negative values. &o "ot #ri"t a"y gra#hs' Jhat controlswhether the parabola opens upward or downwardK %oes the e!tremum

    occur at ( )abx 2= K Jrite a formula in terms of a,b,cfor the value of yatthe e!tremum.

    . +lot a "uadratic function that has a mi"imumat (x =C,y =$4). +rint a copy ofthe graph for each lab partner, and sign your copy. Include this printed graph aspart of your lab report.

    . he Si"e Fu"ctio"

    The sine function is described by the e"uation

    ( )bxay sin=

    where aand bare parameters. The sine function is useful in describing oscillatoryphenomena. (6or the language buffs, the word sinuous, which means serpentineor wavy, comes from the same root as sine.) #s will be seen shortly, theparameter acontrols the amplitude or amount of oscillation, and the parameter bcontrols the rate (fre"uency) of oscillation.

  • 8/13/2019 121- Experiment 01

    11/18

    37

    3. 'uppose the parameters have the values aD l, bD l. sing a calculator,complete the function table below. The calculated values ofyshould beaccurate to : significant figures. et x range from $E.4 to E.4 withincrements of .4 between successive xvalues.

    # word of caution is necessary at this point. Mour calculator is probably e"uipped tocalculate sin(x) when xis e!pressed in degrees, radians, or grads. 'ee sections 0 and2 of the 1athematics eview given in +art VIII of the Introduction to *eneralaboratory Jork and #rcane and 1athematical 1atters. (ook in the front of yourlaboratory manual.) Note that it is a" acce#te) mathematics a") #hysics

    co"ve"tio" that (unless clearly stated otherwise)whe" writi"g ( )xsin or ( )bxsin ,it is u")erstoo) that $or bx are to %e e$#resse) i" ra)ia"s. ?ote also that, inthis aboratory, the symbol x plays a different role than it did in the 1athematicseview. In the 1athematics eview x denoted the horiBontal coordinate and fdenoted the angle. ?ow x, or more generally bx, denotes the angle$like variable.

    'et your calculator to work with angles measured in radians. 2heck it by computing

    sin (O), sin (O4), sin (EO4). (?ote that your calculator should have the value ofstored in its innards. 'o it is easy to produce O, O4, etc.) Jhat should the answersbeK

    sin(O) D sin() D

    sin(O4) D sin(EO4) D

    ?ow complete the table. If some numbers in the table do not look "uite right, do

    not worry about it until you get to part 4.

    yD asin %$ aD 3, %D 3

    $ y

    $E.4

    $E.C

    $4.L

    $4.G

    $4. $C.GH:G

    $4.4 $C.LCL:C

    $4.C $C.CEC

    $3.L $C.HEL:

    $3.G $C.:H

  • 8/13/2019 121- Experiment 01

    12/18

    38

    $3. $C.L::

    $3.4 $C.E4C

    $3.C $C.G3H

    $C.L $C.H3HEG

    $C.G $C.:GG

    $C. $C.EL4

    $C.4 $C.3LGH

    C.C C.CCCCC

    C.4 C.3LGH

    C. C.EL4

    C.G C.:GG

    C.L C.H3HEG

    3.C C.L3H

    3.4 C.E4C

    3. C.L::3.G C.:H

    3.L C.HEL:

    4.C C.CEC

    4.4 C.LCL:C

    4. C.GH:G

    4.G C.:3::C

    4.L C.EE

    E.C C.3334

    E.4 $C.C:LEH

    Jhat are the ma!imum and minimum values taken byyK

    aD 3

    ma!imumyvalue D minimumyvalue D

    'uppose the amplitude ahad the value aD 4 instead of aD 3. Jhat would then be the

    ma!imum and minimum values taken byyK

    aD 4

    ma!imumyvalue D minimumyvalue D

  • 8/13/2019 121- Experiment 01

    13/18

    39

    ?ote from the function table that whenxis near Bero, sin xand xare nearly the same,providing xis measured in radians. This fact should also be obvious from geometricalreasoning. 2onsider a circle having a radius rof length 3 as shown below.

    Figure I-/

    %raw a right triangle inside the circle as indicated. To specify the angle x in radians,you simply report the length of the arc l. #lso, since the radius rhas the value 3, thesine of xis given by the relation

    ( ) xxy sinsin1 == .

    It is evident from the drawing that the sideyof the triangle and the length l of the arcare very nearly e"ual when l is small.

    4. +lot on the ne!t page selected points from the function table you have completed.'elect the appropriate scales. %raw a curve through the points and label the a!es.There is an error in the function table& 6ind it, circle it, and put in the correctyvalue. ?ow make sure your plot is right. ?ote that for values of xoutside the rangeof the plot, the sine function merely repeats itself over and over again. 6or thisreason sin xis called a#erio)icfunction. The interval in x re"uired for repetition iscalled the#erio)of the function.

    Jhat is the period of sin xK

    period of sin xD

  • 8/13/2019 121- Experiment 01

    14/18

    40

    y = a sin bx a = 1, b = 1

  • 8/13/2019 121- Experiment 01

    15/18

    41

    E. 2alculate and plot the sine function using the computer.

    a. !ecute the sine function program, list the first few entries of the functiontable, and plot the contents of the table. &o "ot #ri"t a"y gra#hs' se thesame parameter values as you used before when making the function tableand graph by hand. @owever, use an Hvalue of .C: in order to get enoughpoints to make a smooth curve. %o your and the computerPs function tablesagreeK ('ketch your graph below.)

    8888888888888888888888888888888888888888888888888888

    88888888888888888888888888888888888888888888888888888

    b. se the computer to plot the sine function with the parameter values a D l, bD 4Akeep the values of X1I?, X1#X, and Hthe same as those you used in part Ea,7ust above. &o "ot #ri"t a"y gra#hs' @ow does the plot compare with thatobtained in part E.aK (1ake a sketch below.)

    88888888888888888888888888888888888888888888888888888

    888888888888888888888888888888888888888888888888888

    c. !periment with the sine function by running the computer program several timeswith different values of the parameters a and b, including both positive andnegative values. &o "ot #ri"t a"y gra#hs'

    . 2onsider the function

    ( ) ( )[ ]xy 6.4sin2.5= .

  • 8/13/2019 121- Experiment 01

    16/18

    42

    vidently y is a periodic function. Its ma!imum value is called its am#litu)e.The interval in xre"uired for repetition is called its#erio).

    a. Jhat is its amplitude numericallyK

    amplitude D

    b. !plain why the period is given by the relation

    ( ) 366.16.42period ==

    :. @ave the computer make a graph of the function

    ( ) ( )[ ]xy 6.4sin2.5= .

    +rint a copy of the graph for each lab partner, and sign your copy. Indicate theamplitude and period on your printed copy. %oes the period agree with theresults of part 2..b given aboveK

    &. he osi"e Fu"ctio"

    The cosine function is described by the e"uation

    ( )bxay cos=

    where a and b are parameters. The cosine function is also useful in describingoscillatory phenomena.

    3. 2alculate and plot the cosine function.

    a. !ecute the cosine function program and plot the contents of thefunction table. &o "ot #ri"t a"y gra#hs' se the parameter values aD3 and bD 3. #gain use an Hvalue of .C: in order to get enough pointsto make a smooth curve. 'ketch your graph below.

    b. !periment with the cosine function by running the computer programseveral times with different values of the parameters a and b, includingboth positive and negative values. &o "ot #ri"t a"y gra#hs'

    4. 2onsider the function

    ( ) ( )[ ]xy 6.4cos2.5=

  • 8/13/2019 121- Experiment 01

    17/18

    43

    videntlyyis a periodic function.

    a. Jhat is its amplitudeK

    amplitude D

    b. Jhat is its periodK

    period D

    E. +lot a cosine function with two complete oscillations on the screen. Jhat are thema!imum and minimum values ofyK Jhat is the amplitudeK Jhat is the periodK+rint a copy of the graph for each lab partner, and sign your copy. -n your copy,list the values of a and b, the ma!imum and minimum value of y, the amplitude,and the period. Include this printed graph as part of your lab report.

    VI. Laboratory Report

    Jrite up your aboratory eport following the format described in 'ection IV,6ormat for eports, which is in the front of the laboratory manual.

  • 8/13/2019 121- Experiment 01

    18/18

    44

    'pare 'heet of *raph +aper