{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Lecture+06+Notes (1) - 14:440:127 Introduction to Computers...

Info icon This preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
14:440:127– Introduction to Computers for Engineers Notes for Lecture 06 Rutgers University, Fall 2009 Instructor- Blase E. Ur 1 Fitting To More Complicated Functions Now you know how to find the line of best fit for some data points if they are linearly related. You can use this fact, along with the idea of ”linearizing data”, to find more complicated relationships. ”Linearizing” means making a few substitutions for variables, which result in an equation for a line. Note that ”linearization” has some pretty complex ramifications about what it does to your assumptions about (and ability to determine) the experimental error of your data– if you’re interested, see http://en.wikipedia.org/wiki/Nonlinear_regression 1.1 Figuring Out The Relationship In a number of scientific processes, y and x are exponentially or logarithmically related i.e. y=exp(x) or vice versa. However, it’s sometimes hard when looking at a graph to determine whether or not there is an exponential relationship, or what sort of exponential relationship exists. Matlab contains alternatives to the plot function that display exponential values for one or both axes, which is equivalent to taking the logarithm of x, y, or both x and y. 1.1.1 Semilogx Plots = Logarithmic Data In a semilogx plot, the x axis is displayed as powers of 10. Note that semilogx is used in place of plot i.e. semilogx([10 100 1000], [1 2 3]) displays that graph. The graph that is displayed is equivalent to having taken the logarithm of the x points, but left the y points the same. If your semilogx plot looks like a line, then your data may be logarithmic, of the form y = K * log ( x ) + C . Why? y = K * log ( x ) + C SUBSTITUTE: x 2 = log ( x ) y = K * x 2 + C , which is linear 1.1.2 Semilogy Plots = Exponential Data In a semilogy plot, the y axis is displayed as powers of 10. Note that semilogy is used in place of plot i.e. semilogy([1 2 3], [10 100 1000]) displays that graph. The graph that is displayed is equivalent to having taken the logarithm of the y points, but left the x points the same. If your semilogy plot looks like a line, then your data may be exponential, of the form y = C * e Kx . Why? y = C * e Kx Take the natural log of both sides of the equation: log ( y ) = log ( C * e Kx ) log ( y ) = log ( e Kx ) + log ( C ) log ( y ) = K * x + log ( C ) SUBSTITUTE: y 2 = log ( y ) AND C 2 = log ( C ) y 2 = K * x + C 2 , which is linear Solve for the coe ffi ciencts K and C 2 ; Remember that C = e C 2 !!! Here’s a semilogy plot in action: x = linspace(1,20,100); y = 5*exp(x); semilogy(x,y) 1
Image of page 1

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

View Full Document Right Arrow Icon
1.1.3 Loglog Plots = Power Function Data In a loglog plot, both the x and y axes are displayed as powers of 10. The graph that is displayed is equivalent to having taken the logarithm of both the x and y points. If your loglog plot looks like a line, then your data may be a power function, of the form y = C * x K . Why? y = C * x K Take the natural log of both sides of the equation: log ( y ) = log ( C * x K ) log ( y ) = log ( C ) + log ( x K ) log ( y ) = K * log ( x ) + log ( C ) SUBSTITUTE: x 2 = log ( x ), y 2 = log ( y ), and C 2 = log ( C ) y 2 = K * x 2 + C 2 , which is linear Solve for the coe ffi ciencts K and C 2 ; Remember that C = e C 2 !!!
Image of page 2
Image of page 3
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