Physics 281: Computational Physics
Computational Physics
项目类别:物理

Hello, dear friend, you can consult us at any time if you have any questions, add  WeChat:  zz-x2580

Physics 281: Computational Physics

Handout Fitting models to data, through the section“Outliers”.Fit to data with unknown  uncertainties.

In-Class Activities Computational 

Completing all of the non-starred activities will count as A-level work. To receive credit, these activities must be checked off in class or office hours within three weeks. (by Thurs 3/28, skipping over Spring Break so really four weeks this time.)

1.Polynomial fit to data. Computational 

Fit the data in the file txt to poly- nomials of various orders, and use the results to decide what model (whatorder polynomial) is justified for fitting this data. For this pur- pose, if you like you can simply copy code from the section “Nonlinear least-squares fitting” in the Fitting models to data handout, or you can use your own code. In any case, be sure to include the parts that print out the parameters with their uncertainties, and χ2.

2.Fit to data with unknown  uncertainties.   

The file txt has only two columns (x and y, but not yerr). Make some slight modifications to the program to deal with this kind of data with no uncertainties given. and again fit the data to polynomials of various ordersand decide what order polynomial is justified as a model for the data.Computational  Here are the modifications you need to make to the program:

3.Parameter guesses in nonlinear fits. Computational 

Redo the 5-parameter (gaus- sian + linear background) fit to the data in txt that is in the Fitting models to data handout (you can cut and paste the program from the handout). Then, change the parameter guesses to all ones and see what happens. This was OK for a linear model like the poly-nomial(which has only one minimum in χ2) but it doesn’t work here. Explore a bit how much the guesses can be changed while still success- fully finding the global minimum in χ2.

4.Addinga  

Fit the data in peak4.txt using one additional parameter, so the model is a gaussian plus a quadratic background. Determine whether or not using this additional parameter is justified.

5.Fita sine wave  Computational 

The data in the file txt is oscillatory. First simply read the data and plot it. Based on the plot, decide on a likely model for the data. Write a program to fit your model to the data.

6.Gaussian vs Lorentzian

(You may want to start by googling the nameof this ) The following two functions both describe peaks of height A and width w centered at x0, with constant additive back- ground B:

1

The first function fg(x) is the by-now familiar Gaussian peak. The second function fA(x) is called a Lorentzian peak – it occurs naturally in resonant phenomena such as optical transitions of atoms.Computational

Fit the data in the two files gl1.txt and gl2.txt to see which type of peak best describes each data set. Note: Since these data sets do not have specified uncertainties, you should not expect to find the reported χ2 = 1. Nevertheless, is does make sense to compare χ2 between the two types of fit to help determine which function fits a data set better.

留学ICU™️ 留学生辅助指导品牌
在线客服 7*24 全天为您提供咨询服务
咨询电话(全球): +86 17530857517
客服QQ:2405269519
微信咨询:zz-x2580
关于我们
微信订阅号
© 2012-2021 ABC网站 站点地图:Google Sitemap | 服务条款 | 隐私政策
提示:ABC网站所开展服务及提供的文稿基于客户所提供资料,客户可用于研究目的等方面,本机构不鼓励、不提倡任何学术欺诈行为。