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!

Approximating co-efficents

  1. Nov 9, 2004 #1

    Zurtex

    User Avatar
    Science Advisor
    Homework Helper

    I've got a situation where I can approximate a line by the function:

    [tex]y = a_0 + a_1 \sin x + a_2 \sin 2x + b_1 \cos x + b_2 \cos 2x[/tex]

    From experimental data I will be able to find certain values for x and y, namely yn and xn for some value of n. Now I can easily write a computer program which could work out the co-efficients in this problem if I have 5 values for y and 5 values for x. However, being a particle situation and wanting as many results as possible or perhaps not being able to gain that many results due to constraints, how would I be able to approximate these co-efficient please?
     
  2. jcsd
  3. Nov 9, 2004 #2

    shmoe

    User Avatar
    Science Advisor
    Homework Helper

    How about least squares approximation?

    Let the ith row of an n by 5 matrix [tex]M[/tex] be given by [tex][ 1\ \sin(x_i)\ \sin(2x_i)\ \cos(x_i)\ \cos(2x_i)][/tex], and let [tex]Y=[y_1,\ldots,y_n]^T[/tex].

    Then coefficients that will minimize the sum of the squares of the differences of your data points to [tex]y = a_0 + a_1 \sin x + a_2 \sin 2x + b_1 \cos x + b_2 \cos 2x[/tex] will be any column [itex]A=[a_0,a_1,a_2,b_1,b_2]^T[/itex] which satisfies the linear system [itex](M^{T}M)A=M^{T}Y[/itex]
     
  4. Nov 9, 2004 #3

    Zurtex

    User Avatar
    Science Advisor
    Homework Helper

    Thanks I haven't seen that method yet (well I've researched it but not been able to make sense of it). Thanks a lot, just need to try and make sense of it, but I think I can :smile:
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Approximating co-efficents
  1. Polar Co-ordiantes (Replies: 9)

  2. Co-prime of vectors (Replies: 1)

  3. Function Co-domain! (Replies: 4)

Loading...