Understanding the model function is critical to

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

View Full Document Right Arrow Icon
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
Image of page 6

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

View Full Document Right Arrow Icon
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( - 0 τ ) + 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
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern