Presentation on theme: "(for Prof. Oleg Shpyrko)"— Presentation transcript:
1(for Prof. Oleg Shpyrko) PHYSICS 2CL – SPRING Physics Laboratory: Electricity and Magnetism, Waves and OpticsProf. Leonid Butov(for Prof. Oleg Shpyrko)Mayer Hall Addition (MHA) 3681, extOffice Hours: Mondays, 3PM-4PM.Lecture: Mondays, 2:00 p.m. – 2:50 p.m., York Hall 2722Course materials via webct.ucsd.edu(including these lecture slides, manual, schedules etc.)
2Today’s Plan:Chi-Squared, least-squared fitting Next week: Review Lecture (Prof. Shpyrko is back)
3Long-term course schedule WeekLecture TopicExperiment1Mar. 30 IntroductionNO LABS2Apr. 6 Error propagation; Oscilloscope; RC circuits3Apr. 13 Normal distribution; RLC circuits4Apr. 20 Statistical analysis, t-values;5Apr. 27 Resonant circuits6May 4 Review of Expts. 4, 5, 6 and 74, 5, 6 or 77May 11Least squares fitting, c2 test8May 18 Review Lecture9May 25No Lecture (UCSD Holiday: Memorial Day)No LABS,Formal Reports Due10June 1Final ExamSchedule available on WebCT
4Labs Done This Quarter 0. Using lab hardware & software Analog Electronic Circuits (resistors/capacitors)Oscillations and Resonant Circuits (1/2)Resonant circuits (2/2)Refraction & Interference with MicrowavesMagnetic FieldsLASER diffraction and interferenceLenses and the human eyeThis week’slab(s),3 out of 4
6LINEAR FIT x1 y1 x2 y2 x3 y3 x4 y4 x5 y5 x6 y6 y(x) = A +Bx : LINEAR FITy(x) = A +Bx :A – intercept with y axisB – slopex1y1x2y2x3y3x4y4x5y5x6y6q where B=tan qA
7? LINEAR FIT x1 y1 x2 y2 x3 y3 x4 y4 x5 y5 x6 y6 y(x) = A +Bx y=-2+2x LINEAR FIT?y(x) = A +Bxx1y1x2y2x3y3x4y4x5y5x6y6y=-2+2xy=9+0.8x
8LINEAR FIT x1 y1 x2 y2 x3 y3 x4 y4 x5 y5 x6 y6 y(x) = A +Bx y=-2+2x LINEAR FITy(x) = A +Bxx1y1x2y2x3y3x4y4x5y5x6y6y=-2+2xy=9+0.8xAssumptions:dxj << dyj ; dxj = 0yj – normally distributedsj: same for all yj
9S LINEAR FIT: y(x) = A + Bx Yfit(x) 2 Quality [yj-yfitj] of the fit Method of linear regression, aka the least-squares fit….Yfit(x)[yj-yfitj]S2Qualityof the fity4-yfit4y3-yfit3
10S LINEAR FIT: y(x) = A + Bx true value 2 minimize [yj-(A+Bxj)] Method of linear regression, aka the least-squares fit….true value[yj-(A+Bxj)]S2minimizey4-(A+Bx4)y3-(A+Bx3)
11What about error bars?Not all data points are created equal!
12Weight-adjusted average: Reminder:Typically the averagevalue of x is given as:Sometimes we want to weigh data points with some“weight factors” w1, w2 etc:You already KNOW this – e. g. your grade:Weights: 20 for Final Exam, 20 for Formal Report, and12 for each of 5 labs – lowest score gets dropped)
13More precise data points should carry more weight! Idea: weigh the points with the ~ inverse of their error bar
14Weight-adjusted average: How do we average values with different uncertainties?Student A measured resistance 100±1 W (x1=100 W, s1=1 W)Student B measured resistance 105±5 W (x2=105 W, s2=5 W)Or in this case calculate for i=1, 2:with “statistical” weights:BOTTOM LINE: More precise measurements get weighed more heavily!
15c2 TEST for FIT (Ch.12) How good is the agreement between theory and data?
16d = N - c c2 TEST for FIT (Ch.12) # of degrees of freedom # of data points# of parameterscalculated from data# of constraints
17LEAST SQUARES FITTING true value xj yj y=f(x) y4-(A+Bx4) y3-(A+Bx3) … y(x)=A+Bx+Cx2+exp(-Dx)+ln(Ex)+…y4-(A+Bx4)y3-(A+Bx3)1.2. Minimize c2:…3. A in terms of xj yj ; B in terms of xj yj , …4. Calculate c25. Calculate6. Determine probability for
18Usually computer program (for example Origin) can minimize as a function of fitting parameters (multi-dimensional landscape)by method of steepest descent.Think about rolling a bowling ball in some energy landscapeuntil it settles at the lowest pointBest fit (lowest c2)Sometimes the fitgets “stuck” in local minima like this one.Solution? Give it a “kick” by resetting one of the fitting parameters and trying againFitting Parameter Space
19Example: fitting datapoints to y=A*cos(Bx) “Perfect” Fit
20Example: fitting datapoints to y=A*cos(Bx) “Stuck” in localminima of c2landscape fit