{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

datastudio assignment

Their uncertainties are negligible(approximately zero

Info iconThis preview shows pages 6–7. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: their uncertainties are negligible (approximately zero: dx = zeros ( s i z e ( y ) ) ; For the model function, we will use an exponential decay: f ( x ) = A * exp(- x τ ) + B . A is a scaling parameter, B shifts the graph vertically, and τ is the decay time (it controls the steepness of the decay). Understanding the model function is critical to performing well on most labs. However, understanding the MATLAB syntax for its entry is not. This will always be provided for you, simply copy and paste. model = @ ( p , x ) p (1) . * exp (- x ./ p (2) )+ p (3) ; The parameters are now a vector p = [ p (1) ,p (2) ,p (3)]. We can clearly see that [ p (1) ,p (2) ,p (3)] refer to [ A,τ,B ], respectively. 3.2 Plotting and Parameter Initialization Figure 5: Scatterplot of our data in MATLAB It is useful now to produce a plot of our data. You should see a figure generated that looks like Figure 5. errorbarxy ( x , y , dx , dy ) ; The trickiest part of the MATLAB fitting is the parameter estimation. Please reference the guide for details, but it suffices to say that we must provide order-of-magnitude estimations 6 for the 3 parameters here. The easiest way to do that is by looking at the graph and understanding the model. We can perform some asymptotic analysis to do this. – f ( x → 0) = A * exp(- τ ) + B ≈ A * 1 + B = A + B – f ( x → τ ) = A * exp(- τ τ ) + B ≈ A e + B – f ( x → ∞ ) = A * exp(-∞ τ ) + B ≈ A * 0 + B = B 3.3 Putting it all together Now we have all of the necessary inputs to our fitting function. We simply call it, and it will list the parameters we seek. wnlfit ( x , y , dx , dy , model , guess ) ; But wait, we get all this crazy text about Jacobians and the fitted function (in blue) looks terrible. The astute reader may have noticed that in our guessing (asymptotic analysis), we used t → 0 as the time of our first variable. However, this is clearly not the case as the first data point occurs at some nonzero time (recall, the irrelevant time it takes between starting the data run and turning on the voltage). Whenever we have time as our x-axis, this is likely the case and the graph must be shifted. Close the figure and try this: x = x- x (1) ; wnlfit ( x , y , dx , dy , model , guess ) ; Now we see a figure like that of Figure 6. Attach this plot (with the fit) to your assignment. What values did you obtain for A , τ , and B ? Be sure to include the uncertainties in your reporting, and do not forget units and the proper rounding as described in the textbook. Figure 6: Finally finished 7...
View Full Document

{[ snackBarMessage ]}

Page6 / 7

their uncertainties are negligible(approximately zero dx =...

This preview shows document pages 6 - 7. Sign up to view the full document.

View Full Document Right Arrow Icon bookmark
Ask a homework question - tutors are online