Please turn in this assignment (and all future assignments for
this course) by emailing them to me .
Please use the subject of "Physics 222 HW5" for these assignments
(if you use the link above, the subject will be added automatically).
Please *attach * the source code to any programs that
you write for this assignment. If you write more than one program,
attach *each separately*. When answering the questions themselves
feel free to answer directly in the body of your message (or attach your
answers). I may take off points for assignments that are not
sent to me in the correct form.

#### Wind Chill Calculator

In the problem your will write a program that will calculate wind chill using both the "old" and the "new" formulas. The wind chill factor is a numerical formula which is supposed to take into account how cold it feels on bare skin due to the effects of the wind. The wind chill as determined by these formulas depends on the air temperature in Fahrenheit and the wind speed in miles per hour. The "old" formula (used up until 2001) is :

OWC = 91.4 - (0.486 + 0.305 v

The "new" formula is:^{0.5}- 0.020 v)(91.4 - T)NWC = 35.74 + 0.6215T - 35.75v

Using these formulas, create a program which will write a separate table of wind chill results to a separate file for each formula. These tables should include results for temperatures ranging from -50 to 50 degrees Fahrenheit and for wind speeds from 5 to 50 miles per hour, in increments of 5 for each. Your results should be rounded to the nearest degree, but^{0.16}+ 0.4275Tv^{0.16}*do not*use integer math when making the calculations. In your tables, let the rows correspond to a given air temperature and the columns correspond to a the wind speed. Pay attention to the formatting of the data - make sure that your columns line up.Also, for a wind speed of 20 miles per hour plot the wind chill versus air temperature. On your plot include separate lines for the new and old wind chill formulas and use a temperature range from -50 to 50 degrees Fahrenheit.

- What differences do you notice between the two tables?
- What do you notice about the plot?

#### Least Squares Fit of Exponential Data

In this problem , you will write a program to read in data from a file, calculate a least square fit of the data, and then plot the resulting data and fit. The method of doing least squares fits is outlined in detail in Chapter 8 of Taylor's

*Introduction to Error Analysis*. Most of you should have a copy. If you don't have a copy then borrow one. Also, note that your text shows an example of a simpler least squares fit prgram on page 194 (Example 4-5).For this problem, I will provide you with two data files (Data set 1 and Data set 2), though if you have data from previous lab work, feel free to use one data file that you provide and one that I provide. In the provided data file, the first line will be the title of the graph, the second line will be the x-axis label for the graph, the third line will be the y-axis label for the graph, and the fourth line will be the number of data points in the plot. The lines after that will be the x data, the y data, and the uncertainty in y. For this program you can assume that the x uncertainty is negligible.

As explained by Taylor, to fit an exponential, you take the natural log of your y data and fit that a line to log y versus x. The fit that you are doing is to the equation:

ln y = ln A + Bx

which is equivalent toy = Ae

where^{Bx}*A*and*B*are the fit parameters. To take into account the fact that the uncertainties will vary for y, we will use equations 8.37-8.39 on page 201 in Taylor's book to find*A*and*B*. Look there for the equations and how to use them. Note that in this case, as is explained on page 196 of Taylor, the uncertainty of y (*σ*) should be replaced by the uncertainty of the ln y which is*σ/y*(equation 8.34). Also note that in this case equation 8.37 will give you*ln A*, not*A*itself.As well as calculating the fit parameters

*A*and*B*, you should calculate the uncertainties in*A*and*B*using equations 8.12 and 8.15-8.17. Your program should print out the values of the constant and their uncertainties, as well as the plot described below.Send me postscript copies of plots of both of your sets of data including line for your least squares fit, as well as the output specified above. For your plots, use the PGPlot library again (or GNUPlot if you prefer, but all the GNUPlot commands must be sent by your program). In you should plot the points with error bars - look at the PGERRY subroutine. For the plots, you can either make semi-log plots using the value of 20 for the last parameter you send to PGENV and drawing straight fit lines using the method shown in simple_pgplot.f or by using PGFUNX to draw the line. Or, you can use linear axes, but then explicitly plot the fits as exponentials.

- Compare your fit parameters to what Linfit gives you for one of the data sets. Comment on any differences.