Administrivia. Next Monday is Thanksgiving holiday. Tuesday and Wednesday the lab will be open for make-up labs. Lecture as usual on Thursday.

Similar documents
Diode Lab vs Lab 0. You looked at the residuals of the fit, and they probably looked like random noise.

An introduction to plotting data

Using PSpice to Simulate Transmission Lines K. A. Connor Summer 2000 Fields and Waves I

Here is the data collected.

In math, the rate of change is called the slope and is often described by the ratio rise

Excel Basics Rice Digital Media Commons Guide Written for Microsoft Excel 2010 Windows Edition by Eric Miller

ENCM 339 Fall 2017 Lecture Section 01 Lab 9 for the Week of November 20

How to Do Everything We Need to Do on a TI Calculator in Algebra 2 for Now (Unless Davies Forgot Something)

MAT 003 Brian Killough s Instructor Notes Saint Leo University

Math 182. Assignment #4: Least Squares

TNG-3B derives its operating power from the serial port. The DTR, RTS, and both data lines are all used, and must be properly connected.

ELEC4042 Signal Processing 2 MATLAB Review (prepared by A/Prof Ambikairajah)

Data and Function Plotting with MATLAB (Linux-10)

Geology Geomath Estimating the coefficients of various Mathematical relationships in Geology

1.7 Limit of a Function

3.7 Rational Functions. Copyright Cengage Learning. All rights reserved.

GAP CLOSING. Grade 9. Facilitator s Guide

,!7IA3C1-cjfcei!:t;K;k;K;k ISBN Graphing Calculator Reference Card. Addison-Wesley s. Basics. Created in conjuction with

Why Use Graphs? Test Grade. Time Sleeping (Hrs) Time Sleeping (Hrs) Test Grade

Introduction to Spreadsheets

Using Microsoft Excel

APCS-AB: Java. Recursion in Java December 12, week14 1

Sec 4.1 Coordinates and Scatter Plots. Coordinate Plane: Formed by two real number lines that intersect at a right angle.

CSC 101 Spring 2010 Lab #8 Report Gradesheet

Magic Tutorial #1: Getting Started

Lesson 6-5: Transforms of Graphs of Functions

Advanced Curve Fitting. Eric Haller, Secondary Occasional Teacher, Peel District School Board

ES-2 Lecture: Fitting models to data

Introduction to Excel 2007

x 2 + 3, r 4(x) = x2 1

GAP CLOSING. Integers. Intermediate / Senior Facilitator s Guide

GRAPHING WORKSHOP. A graph of an equation is an illustration of a set of points whose coordinates satisfy the equation.

APPM/MATH Problem Set 4 Solutions

What the Dual-Dirac Model is and What it is Not

Lab 1: Setup 12:00 PM, Sep 10, 2017

CMPSCI 145 MIDTERM #1 Solution Key. SPRING 2017 March 3, 2017 Professor William T. Verts

Precalculus Summer Packet

Part 6b: The effect of scale on raster calculations mean local relief and slope

Patterning Math Lab 4a

SNAP Centre Workshop. Graphing Lines

LIGHT: Two-slit Interference

Lab #2 Physics 91SI Spring 2013

Physics 101, Lab 1: LINEAR KINEMATICS PREDICTION SHEET

Intro. Scheme Basics. scm> 5 5. scm>

Exercise: Graphing and Least Squares Fitting in Quattro Pro

Tips and Guidance for Analyzing Data. Executive Summary

Practical 1P1 Computing Exercise

3.1. 3x 4y = 12 3(0) 4y = 12. 3x 4y = 12 3x 4(0) = y = x 0 = 12. 4y = 12 y = 3. 3x = 12 x = 4. The Rectangular Coordinate System

CS 1110 SPRING 2016: GETTING STARTED (Jan 27-28) First Name: Last Name: NetID:

Computer Data Analysis and Use of Excel

Pattern Maker Lab. 1 Preliminaries. 1.1 Writing a Python program

Table of Laplace Transforms

GEO 425: SPRING 2012 LAB 9: Introduction to Postgresql and SQL

Optimization and least squares. Prof. Noah Snavely CS1114


EDTE 330A/B. Educational Technology in the Classroom: Applications and Integrations

Lab 1 Intro to MATLAB and FreeMat

Excel Spreadsheets and Graphs

Programming Project. Remember the Titans

Adding content to your Blackboard 9.1 class

Introduction to Digital Image Processing

Use the Move tool to drag A around and see how the automatically constructed objects (like G or the perpendicular and parallel lines) are updated.

2. Getting Started When you start GeoGebra, you will see a version of the following window. 1

Using Excel for Graphical Analysis of Data

the NXT-G programming environment

Lab 2 Building on Linux

Using Excel for Graphical Analysis of Data

FMA901F: Machine Learning Lecture 3: Linear Models for Regression. Cristian Sminchisescu

Authoring World Wide Web Pages with Dreamweaver

Lecture 3: Linear Classification

Roc Model and Density Dependence, Part 1

Week 7: The normal distribution and sample means

Lesson 1 CAD Mechanical Part 1 Beginning Drawing Objectives

Notes on Simulations in SAS Studio

Section Graphs and Lines

Hey there, I m (name) and today I m gonna talk to you about rate of change and slope.

Computer Graphics Prof. Sukhendu Das Dept. of Computer Science and Engineering Indian Institute of Technology, Madras Lecture - 14

HMC CS 158, Fall 2017 Problem Set 3 Programming: Regularized Polynomial Regression

Click on the SwCAD III shortcut created by the software installation.

Matlab for FMRI Module 1: the basics Instructor: Luis Hernandez-Garcia

Magic Tutorial #1: Getting Started

A Basic Guide to Using Matlab in Econ 201FS

The Very Basics of the R Interpreter

Error Analysis, Statistics and Graphing

PR3 & PR4 CBR Activities Using EasyData for CBL/CBR Apps

Spectroscopic Analysis: Peak Detector

Practice Test (page 391) 1. For each line, count squares on the grid to determine the rise and the run. Use slope = rise

and numbers and no spaces. Press after typing the name. You are now in the Program Editor. Each line of code begins with the colon character ( : ).

Divisibility Rules and Their Explanations

Learn to use the vector and translation tools in GX.

1. Working with PSpice:

10.4 Linear interpolation method Newton s method

Derivatives and Graphs of Functions

2 A little on Spreadsheets

Computer Data Analysis and Plotting

Lecture 5. If, as shown in figure, we form a right triangle With P1 and P2 as vertices, then length of the horizontal

Principles of Bioinformatics. BIO540/STA569/CSI660 Fall 2010

Polynomial Models Studio October 27, 2006

CSE 158 Lecture 2. Web Mining and Recommender Systems. Supervised learning Regression

IDS 101 Introduction to Spreadsheets

Transcription:

Administrivia Next Monday is Thanksgiving holiday. Tuesday and Wednesday the lab will be open for make-up labs. Lecture as usual on Thursday. Lab notebooks will be due the week after Thanksgiving, when we will start a new lab (Faraday Effect).

What Is The Goal? The goal of the diode lab is to map out the current-voltage relation of a diode over the largest possible range of parameters. You should try to fit the room-temperature data to the model function over the widest possible range of current and voltage, with the best possible understanding of the behavior of the equipment (noise, offset, etc). You will find that the model agrees with the data within the measurement errors over many orders of magnitude. You will also find that there are some regions where the model disagrees with the data by far more than any reasonable estimate of the measurement errors. You should make plots that emphasize the agreement in various regions of voltage and current (a single plot can t really show everything). You should also make some plots that emphasize the disagreements that you see. For extra credit, you should come up with models of the disagreements, and see how well your model would agree with the level of disagreement that you see.

What Is The Goal (2) For the temperature dependence, the main goal is to study how the I0 and V0 parameters of the data depend on temperature. You should concentrate on the region where the model fits the data well, and exclude the regions where it does not. We have a theoretical prediction for how V0 depends on temperature. You should test that model. You can use the result of this test to determine the ratio of the electron charge q to Boltzmann s Constant k. We didn t talk about the temperature dependence of I0, but it s enormous! The temperature dependence is in fact quite simple, but it s not the same as for V0. You should be able to find the right temperature dependence by doing some book/web research, and your data should be quite consistent with it. The data in prelab4.dat is fake, but it has the right kind of dependence of I0 and V0 on temperature.

Statistical Errors vs Systematic Biases vs Systematic Errors Statistical errors are due to random noise. If you repeat the measurement, the data will look slightly different. If you measure many times and average, then repeat the measure-and-average process many times, the averages will be more consistent than the individual measurements were, by a factor of N. There are other kinds of situations where repeated measurements averaged together don t improve the accuracy. An offset in your measurements is not a statistical error, because repeated measurements will give the same offset. A good term for such things is systematic bias Ideally, you would find problems like offsets and correct them somehow. After the correction, there would be no bias left (but any noise would still be present). Often we are not sure exactly how to correct for the systematic bias because we don t understand it well. This is usually called a systematic error

Systematic Errors There are no standard formulas for determining systematic errors. Some human judgement is always involved. There are two parts of any systematic error contribution the uncertainty of some input number the sensitivity of your result to that input number The input uncertainty is often controversial meaning that you have to make an educated guess about how sure you are about something. The sensitivity part is usually non-controversial meaning that anyone will agree how much your final answer will change if you change the input number. But as always in physics, we don t estimate the systematic errors by the deviation of the result from the theory we are trying to test! If you find some of your data disagrees with the model in a non-random way, outside of the (statistical) error bars, then either there are some systematic errors, or the model is imperfect. When you point out disagreements between model and data, you should make estimates of how large the systematic errors might be, and comment on whether they could plausibly explain the difference, or the model is really in disagreement with any reasonable interpretation of the data.

Other Hints Many people get rather large noise levels in their offset measurements, particularly for the V1 (voltage at the top of the diode) if they were taken by disconnecting the signal generator but leaving the circuit attached to the ADC. If you disconnected both cables from the ADC for the offset measurement, the noise level was pretty low for both channels. It s possible that the noisy V1 offset data is not really appropriate to use. The quieter V2 offset data is OK I think. Your 10 Meg data probably should have been taken at 0.1 Hz (with a slower sample rate). If it wasn t, you probably have two different curves near zero volts. The 10 Meg data taken while the triangle wave voltage was rising is OK; the data while the voltage was falling is not reliable. You can fix this by deleting the falling-voltage data from the file. Remember that you should include the 10 Meg resistance of the ADC in parallel with the circuit resistance. But you should not be making any corrections for the 50 ohm resistor in the output of the signal generator. (Why?)

Gnuplot Hints For Gnuplot on Windows, you can open a DOS window in the current directory by typing shell Then you can show the files in that directory by dir This is also useful for navigating directories. DOS understands cd.. etc. Doing this won t change Gnuplot s default directory, but it can help you find your files and get the path right when you do change the directory from inside Gnuplot You can look at the text in a file by the DOS command more filename Use the Q key to quit out of more You can edit files in a dumb but usable text editor by edit filename The editor pays attention to the mouse for the menu and for cursor positioning I found a way to go up a subdirectory or folder that works on all platforms. Just type cd..

Gnuplot Fitting Reminders You should be doing your fits with errors, meaning not just a column or calculation for x and y, but also a number, column, or calculation for the error fit f(x) file (x):(y):(error) via a,b,c,... The error should be calculated including both vertical and horizontal errors from all sources. You should be checking the reduced chi-square from the fit; it should be of order 1, not hundreds or thousands. You should be looking at residuals, pulls, ratios of data to fit, etc. Gnuplot fitting will work better if you remember to do FIT_START_LAMBDA = 0.01 Check the final lambda value, it should be much less than 1, or the fit isn t reliable (it s not in the final summary, you have scroll back to the previous iteration. Unless the function you are fitting is very simple like a straight line or polynomial, you need good guesses of the parameters for the fit to work. The diode function is quite hard for Gnuplot to fit without good guesses.

A Trick for Guessing Parameters Functions where the fit parameters only occur as coefficients times other functions, like straight lines or polynomials, don t require good guesses. You can define a linear function line(x)=a+b*x and fit it to the log of your data: fit line(x) file using ($1-$3):(log($3/R)) via a,b This converges very quickly, no matter what the initial parameter guesses are. But it doesn t converge to what we want, because all the negative-voltage data pulls the fit: -4-5 'diode.dat' u ($1-$2):(log($2/1000)) line(x) -6-7 -8-9 -10-11 -12-13 -14-10 -8-6 -4-2 0 2

A Trick for Guessing Parameters (2) The fix is to fit to just part of the data. To do this, we include the x range right after the word fit in square brackets. To fit from 0.3 to the upper limit, type fit [0.3:*] line(x) file u ($1-$3):(log($3/R)) via a,b -4 'diode.dat' u ($1-$2):(log($2/1000)) line(x) -6-8 -10-12 -14-16 -18 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 Then convert the fit parameters to the form you need for the non-logarithm version of the fit I0=exp(a) V0=1/b Why still do the non-log fit if this works so well? Because the errors are symmetric on the data, not the log of the data, and this matters for the points near zero, where the positive error is small but the negative error is infinite!

Gnuplot Fitting Problems The diode data for liquid nitrogen is really hard for Gnuplot to fit. (It s even hard for my own fitting program that doesn t have some of the bugs of Gnuplot). The usual symptom is that the fit takes thousands of iterations to converge, and/or the final lambda value is much greater than 1, rather than much less than 1 (lambda is displayed for each iteration, but not in the final summary) On Windows, there is no way that I know of to abort a fit. Pressing the alt key will pause it so you can see what s going on, and alt again will let it start up again. (On Unix or Linux, control-c will stop a fit) It will stop the fit after 100 iterations if you type FIT_MAXITER = 100 You can up-arrow to continue, and do 100-iteration chunks until it converges or you give up. If you do a fit that seems to work, but you get singular matrix errors right at the end, check to see if you are fitting for a parameter (in the via a,b,c,... part of the Gnuplot fit command) that does not appear in your function (it may be a typographical error)

Gnuplot Fitting Problems (2) Gnuplot also has a problems with fits when the relative size of the parameters is too different. For the liquid nitrogen data, the value of I0 is very very tiny, and causes problems. One trick is to re-define your function so the I0 parameter is closer to 1. For instance I(V) = 1.0e-30 * I30 * (exp(v/v0) -1) The I30 parameter will be 1 when the I0 parameter would have been 1.0e-30. The real I0 is 1.0e-30 times the I30 parameter. The error on the real I0 is 1.0e-30 times the (absolute) error on the I30 parameter. The fractional or percent error on I0 is the same as for I30.

Gnuplot Fitting Problems (3) If all else fails, you can use the parameters from the fit to the log of the current, converted to the right units. But, you need to do two extra things to get the errors right. You have to use the errors on the log of the current when you do the fit. The relation between the error of x and the error of the log of x is σ [ log( x) ] = σ [ x] d dx log x ( ) = σ [ x ] And, you need to go from the error on the fit slope and intercept to the errors on I0 and V0. You need σ [ exp( x) ] = σ [ x] d dx exp ( x ) = σ [ x]exp( x) x σ 1 x = σ x [ ] d dx [ ] 1 x = σ x x 2

Gnuplot Save-Files and Load-Files Many students have asked if there was a way to record Gnuplot commands to play them back later. Not exactly. You can type save filename right after making a plot, and the current state of Gnuplot will be written to filename, including functions, variables, and the last plot command. You can later type load filename to recreate the plot (assuming that the data file exists in the right place). Gnuplot commands can also be entered into a file manually using your favorite text editor, then executed by typing load filename For instance, you could make a loadfile that: defined the straight-line function, fit the log of your data over the appropriate range, converted the slope and intercept into I0 and V0, refit the data without the logarithm, and made a plot with the data and the function overlaid. A good way to work is to open an editor in a separate window from Gnuplot, and type all your commands into the editor window. Save the file as filename. Then from the Gnuplot window, all you do is type load filename Just edit the file until it s right, and save it. Then save a copy with a different name and edit that one for the next data file or plot.

Gnuplot Load-Files (2) If you want to have your load-file wait until you are done looking at some intermediate step, include the command pause -1 in the file. For a 3 second delay, use pause 3 Loadfiles can load other loadfiles, so you can make a loadfile that makes a plot then does load printit or even makes several plots each followed by load printit for making several printed pages at once. Blank lines in loadfiles are ignored. Lines starting with # are ignored too, so you can use them as comments, or to suppress execution of lines without deleting them (so you can put them back later). Load-files don t take arguments, but call-files do! call filename arg0 arg1 arg2 and write the call-file using $0, $1, $2 where you want arguments substituted You also have to use $$n rather than $n for column n in plot and fit commands. You may also need to add some quote characters in the call-file. It tends to be easier to edit several slightly different loadfiles for similar data files than to make a call-file that is the same for all the data files that works properly