1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Homework Help: Polynomial approximation to find function values

  1. Apr 1, 2014 #1
    1. The problem statement, all variables and given/known data
    If we have the following data

    Code (Text):
    T = [296 301 306 309 320 333 341 349 353];
    R = [143.1 116.3 98.5 88.9 62.5 43.7 35.1 29.2 27.2];
    (where T = Temperature (K) and R = Reistance (Ω) and each temperature value corresponds to the resistor value at the same position)

    2. Relevant equations
    We know that
    [tex]R=a \cdot e^{b/T}[/tex]
    The question of the problem is the following: How can we, from these data and the given equation, find the values of the constants a and b?

    3. The attempt at a solution
    In the assignment it is suggested one draws a diagram that shows ln(R/Ω) as a function of 1/T and then use MATLAB "polyfit" function which gives a polynom approximation of this line and then use that polynom to find the values of a and b.

    I have used the polyfit function in MATLAB to get a polynom approximation, but how does that polynom give me the constants a and b?
    Last edited: Apr 1, 2014
  2. jcsd
  3. Apr 1, 2014 #2
    Polyfit outputs polynomial coefficients, so I think what you'd have to do is plot ln(R) = ln(a) + b/T, and look for b = 0. Now you will know what value a is. From there, divide your polyfit matrix by a, and you will have the coefficients to the power series of eb/T. With the power series representation, you may have to do some approximating to find a value for b, but I would imagine the coefficients won't change much after the second order term.
  4. Apr 2, 2014 #3
    So MATLAB gives me this polynomial:

    Code (Text):
    1.0e+03 *

    3.0412   -0.0053
    which I assume means the same as a polynomial like
    [tex]y=10^{3}\cdot 3.0412x-0.0053 = 3041.2x - 5.3[/tex]
    I assume then, that -5.3 is the value of ln(a)?

    If I divide then the polynomial with -5.3 I get the following matrix:
    Code (Text):
    [-0.0018    1.0000]
    Correct so far?

    If so I wonder what does it means that these are the coefficients for the power series of e^(b/T)? I guess that should be a Maclaurin or Taylor series? How can I determine b from such a series?
  5. Apr 2, 2014 #4


    User Avatar

    Staff: Mentor

    If I were in your position, I would take logarithms of both sides of that equation, and plot a graph of your data. The y-intercept and the slope lead you to values for a and b. You will then know the approximate values for those constants, and can recognize when MATLAB is giving you nonsense.
  6. Apr 2, 2014 #5
    Right (I'd go with at least 3 significant figures).

    You'd like to fit your data to:
    \ln(R) = b \frac{1}{T} + \ln(a)
    and MATLAB has provided you with:
    \ln(R_\mathrm{fit}) = p_1 \frac{1}{T} + p_2
    You're basically done at this point. How does ##p_1## and ##p_2## relate to ##b## and ##a##, respectively?
  7. Apr 2, 2014 #6
    Thanks, that's how I figured also. Onwards
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted