Consulting

Results 1 to 5 of 5

Thread: interpolation

  1. #1
    VBAX Regular
    Joined
    Jan 2011
    Posts
    55
    Location

    interpolation

    Dear Forum,
    I am looking to make interpolation way to expand original scanned curve+digitalised over step of 1 in the "x" axe, so thank you sir to support me to fulfill the column"F".

    over this forum, I tested macro from this forum discussion "InterpolationData_Example.xlsm", but its not accurate at all,!!

    looking for your advice, thank you in advance
    Br,
    Amrane
    Attached Files Attached Files

  2. #2
    VBAX Guru Kenneth Hobs's Avatar
    Joined
    Nov 2005
    Location
    Tecumseh, OK
    Posts
    4,956
    Location
    The thread you referenced was: http://www.vbaexpress.com/forum/show...ith-empty-data

    Try changing the scale to be the same so that you can compare apples to apples.

    I know of some polynominal fits we could try if the scale deal doesn't pan out for you.

  3. #3
    VBAX Regular
    Joined
    Jan 2011
    Posts
    55
    Location
    Dear Mr Kenneth Hobs

    thank you sir for your advice,
    actually I was referring to the same tread, I used the function in my second sheet "=PINTERP($A$2:$A$15,$B$2:$B$15,E2)", but the result are not so good, for instance:
    In the original curve the max is [14024.056 // 7.0932953: cells( 9,a & b)] no more than 10 in the vertical axe,
    but
    the interpolated curve it is more than 30: ie [14012 33.33822278: cells( 69,E & F)]

    so the produced curve is not so accurate, , is there any way to improve?

    thank you sir for you help,

    Br, Amrane

  4. #4
    VBAX Guru Kenneth Hobs's Avatar
    Joined
    Nov 2005
    Location
    Tecumseh, OK
    Posts
    4,956
    Location
    If you use it just for those X points, it returns the same Y points. If you use it for each whole number of X points, even for the same X point used earlier, it returns a slightly different Y point.

    You could try a spline fit if you don't need smoothing. An addon says it can find the Y point given and X. http://www.xlxtrfun.com/XlXtrFun/XlXtrFun.htm

    If you just want to try splines, see: shg's post #2 at: http://www.mrexcel.com/forum/excel-q...ions-code.html

    SHG's routine returns the X and then the Y points. After adding his routines, enter this in one cell: =CubicSpline($A$2:$B$15,1,1)
    Press F2, select 28 rows in a column and press Alt+Ctrl+Enter. Again, it is very close to the original Y points. No or interpolation or extrapolation is possible. One can easily to extrapolation between two known points with the same slope though using standard routines.

  5. #5
    VBAX Regular
    Joined
    Jan 2011
    Posts
    55
    Location
    Dear Mr Kenneth Hobs


    thank you soo much for your help, the function "interpolate" under "XlXtrFun.xll" is perfect.

    Br,
    Amrane

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •