1. Not finding help here? Sign up for a free 30min 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!

Trying to find the equation of a cubic

  1. Jan 17, 2009 #1
    1. Find an equation that best fits the data?
    Data
    2 16.40
    3 15.70
    4 15.30
    5 15.20
    6 15.21
    7 15.40
    8 15.80
    9 16.30
    10 16.80
    11 17.50
    12 18.18
    13 18.70
    14 19.36
    15 19.88
    16 20.40
    17 20.85
    18 21.22
    19 21.60
    20 21.65

    I have narrowed it down that it is most likely a cubic, because it seems to make sense.


    I tried to use a matrix to solve this equation but found that it gave me a quartic, that did not match the data at all any help would be appreciated, is there a formula on how to solve cubics?
     
  2. jcsd
  3. Jan 17, 2009 #2

    HallsofIvy

    User Avatar
    Staff Emeritus
    Science Advisor

    If you mean "find the least squares best fit cubic", you would want to write, in general, [itex]y= ax^3+ bx^2+ cx+ d[/itex] and then find a, b, c, d to minimize [itex]\sum (y_i- (ax_i^3+ bx_i^2+ cx_i+ d[/itex]
     
  4. Jan 17, 2009 #3
    Have you tried simply using Finite differences?
     
  5. Jan 17, 2009 #4
    not really sure how i would use it, but ill try to
     
    Last edited: Jan 17, 2009
  6. Jan 17, 2009 #5
    I did a regression by least squares and it seems to almost perfectly fit a cubic.
    a = -0.00407
    b= 0.15356
    c=-1.2757
    d=18.27288
    (approximate values)
    where it is in the form y = ax^3 + bx^2 + cx + d
    normally you would use a computer package like MatLab or a programmable calculator to do these. I don't recommend doing this by hand, it's very long.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?



Similar Discussions: Trying to find the equation of a cubic
  1. Cubic equation (Replies: 3)

  2. Cubic equation (Replies: 5)

Loading...