Results 1 to 6 of 6

Math Help - Approximation of function

  1. #1
    Member
    Joined
    Apr 2008
    Posts
    123

    Approximation of function

    An inner product <f,g> is defined as the integral from -1 to 1 of f(x)g(x).

    Given an orthonormal basis for the set of polynomials of degree less than or equal to 2, i.e.,

    w1 = (rt 2)/2,
    w2 = (rt 6)/2,
    w3 = [(x^2 - 1/3) 3(rt10)] / 4,

    Find the polynomial of degree at most two which is closest to sin (pi x).

    I tried to minimize the norm of v - a linear combination of w1, w2 and w2, and I arrived at the answer 3/pi, which seems wrong. I checked my answer using an approximation through taylor series and as expected I obtained pi.

    I can't figure out where I went wrong - all the integration seems to be correct; any help would be much appreciated. Thanks!
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4
    Quote Originally Posted by h2osprey View Post
    An inner product <f,g> is defined as the integral from -1 to 1 of f(x)g(x).

    Given an orthonormal basis for the set of polynomials of degree less than or equal to 2, i.e.,

    w1 = (rt 2)/2,
    w2 = (rt 6)/2,
    w3 = [(x^2 - 1/3) 3(rt10)] / 4,

    Find the polynomial of degree at most two which is closest to sin (pi x).

    I tried to minimize the norm of v - a linear combination of w1, w2 and w2, and I arrived at the answer 3/pi, which seems wrong. I checked my answer using an approximation through taylor series and as expected I obtained pi.

    I can't figure out where I went wrong - all the integration seems to be correct; any help would be much appreciated. Thanks!
    1. Check you basis, as what you have given is not an orthonormal basis for your desired space.

    2. When you have the right basis your approximating polynomial for f(x) should be:

     <br />
P(x)=\langle w1,f\rangle w_1(x) + \langle w2,f\rangle w_2(x) + \langle w3,f \rangle w_3(x) <br />

    CB
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Member
    Joined
    Apr 2008
    Posts
    123
    Sorry, w2 should be (rt 6)x / 2. That should be orthonormal, right?
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4
    Quote Originally Posted by h2osprey View Post
    Sorry, w2 should be (rt 6)x / 2. That should be orthonormal, right?
    Yes

    CB
    Follow Math Help Forum on Facebook and Google+

  5. #5
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4
    Quote Originally Posted by h2osprey View Post
    An inner product <f,g> is defined as the integral from -1 to 1 of f(x)g(x).

    Given an orthonormal basis for the set of polynomials of degree less than or equal to 2, i.e.,

    w1 = (rt 2)/2,
    w2 = (rt 6)/2,
    w3 = [(x^2 - 1/3) 3(rt10)] / 4,

    Find the polynomial of degree at most two which is closest to sin (pi x).

    I tried to minimize the norm of v - a linear combination of w1, w2 and w2, and I arrived at the answer 3/pi, which seems wrong. I checked my answer using an approximation through taylor series and as expected I obtained pi.
    Taylor series are no guide here, the will give a best point approximation, this process will give you the best approximation on an interval with respect to the norm implied by the inner product.

    What you can say without any computation is that as w_1 and w_3 are even functions (and we are working with the interval [-1,1] and the usual inner product) that their coefficients in the expansion of \sin(\pi x) will be zero. So your approximation will be:

    P(x)=\langle w_2,g \rangle w_2(x)

    where g(x)=\sin(\pi x)

    The attachment shows a plot of the function and the fitted polynomial (line).

    CB
    Attached Thumbnails Attached Thumbnails Approximation of function-gash.jpg  
    Last edited by CaptainBlack; April 4th 2009 at 05:31 AM.
    Follow Math Help Forum on Facebook and Google+

  6. #6
    Member
    Joined
    Apr 2008
    Posts
    123
    Ah, I see what you mean, thanks for clearing all that up!
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Replies: 2
    Last Post: September 2nd 2010, 11:28 AM
  2. Function approximation
    Posted in the Calculus Forum
    Replies: 2
    Last Post: February 17th 2010, 04:40 PM
  3. Function approximation of piecewise function
    Posted in the Advanced Math Topics Forum
    Replies: 1
    Last Post: October 19th 2008, 12:23 AM
  4. Function Approximation
    Posted in the Calculus Forum
    Replies: 3
    Last Post: March 5th 2008, 09:23 PM
  5. Approximation of Sin Function
    Posted in the Calculus Forum
    Replies: 8
    Last Post: October 9th 2007, 04:17 PM

Search Tags


/mathhelpforum @mathhelpforum