DOC PREVIEW
CSU MECH 102 - Interpolation

This preview shows page 1-2 out of 5 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 5 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 5 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 5 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

InterpolationTabulated Data:≔f((x))sin⎛⎜⎝⋅―4x⎞⎟⎠≔vx00.511.52⎡⎢⎢⎢⎢⎢⎣⎤⎥⎥⎥⎥⎥⎦≔i ‥04≔vyif⎛⎝vxi⎞⎠=vy00.3830.7070.9241⎡⎢⎢⎢⎢⎢⎣⎤⎥⎥⎥⎥⎥⎦0.10.20.30.40.50.60.70.80.91-0.101.10.25 0.5 0.75 1 1.25 1.5 1.75 2-0.25 0 2.25vyvxwe wish to estimate the y value for an untabulated x value of 0.7 (between 0.5 and 1)Linear Interpolation:≔x .7≔x0vx1≔y0vy1≔x1vx2≔y1vy2≔y_linear +y0⋅―――−y1y0−x1x0⎛⎝−xx0⎞⎠=y_linear 0.512≔ytf((x))=yt0.522499≔εt|||―――――−yty_linearyt|||=εt%1.923MathCAD method:changed Formatting-Display-Precision to 5 decimal places=linterp((,,vx vy .7))0.51245QdiI liNon-Commercial Use OnlyQuadratic Interpolation:≔x2vx3≔y2vy3adding another tabulated point≔y_quadratic +y_linear ⋅⋅――――――−―――−y2y1−x2x1―――−y1y0−x1x0−x2x0⎛⎝−xx0⎞⎠⎛⎝−xx1⎞⎠=y_quadratic 0.525≔εt|||――――――−yty_quadraticyt|||=εt%0.55Cubic Interpolation:≔x3vx4≔y3vy4adding another tabulated point≔fdd1⎛⎝,xixj⎞⎠――――−f⎛⎝xi⎞⎠f⎛⎝xj⎞⎠−xixj≔fdd2⎛⎝,,xixjxk⎞⎠―――――――――−fdd1⎛⎝,xixj⎞⎠fdd1⎛⎝,xjxk⎞⎠−xixk≔fdd3⎛⎝,,,xixjxkxl⎞⎠―――――――――――−fdd2⎛⎝,,xixjxk⎞⎠fdd2⎛⎝,,xjxkxl⎞⎠−xixl≔b0f⎛⎝x0⎞⎠=b00.383≔b1fdd1⎛⎝,x1x0⎞⎠=b10.649≔b2fdd2⎛⎝,,x2x1x0⎞⎠=b2−0.215≔b3fdd3⎛⎝,,,x3x2x1x0⎞⎠=b3−0.044≔y_linear +b0⋅b1⎛⎝−xx0⎞⎠=y_linear 0.512≔y_quadratic +y_linear ⋅⋅b2⎛⎝−xx0⎞⎠⎛⎝−xx1⎞⎠=y_quadratic 0.525Non-Commercial Use Only≔y_cubic +y_quadratic ⋅⋅⋅b3⎛⎝−xx0⎞⎠⎛⎝−xx1⎞⎠⎛⎝−xx2⎞⎠=y_cubic 0.523≔εt|||――――−yty_cubicyt|||=εt%0.145Alternative (full) equation:≔y_cubic +++b0⋅b1⎛⎝−xx0⎞⎠⋅⋅b2⎛⎝−xx0⎞⎠⎛⎝−xx1⎞⎠⋅⋅⋅b3⎛⎝−xx0⎞⎠⎛⎝−xx1⎞⎠⎛⎝−xx2⎞⎠=y_cubic 0.52326Lagrange Interpolating Polynomials:≔vxT0.511.52[[]]≔L((,,,vx i x n))‖‖‖‖‖‖‖‖‖‖|||||||||←L 1for ∊|||||||j ‥0 n‖‖‖‖‖‖‖|||||if≠ji‖‖‖‖‖←L ⋅L――――⎛⎝−xvxj⎞⎠⎛⎝−vxivxj⎞⎠checking some of the Lagrange factors [Li(x)=1 for x=xi; Li(x)=0 at x = xj where j<>i]:=L⎛⎝,,,vx 0 vx01⎞⎠1=L⎛⎝,,,vx 0 vx12⎞⎠0=L⎛⎝,,,vx 2 vx23⎞⎠1=L⎛⎝,,,vx 2 vx33⎞⎠0≔Lagrange_poly((,,nvxx))∑=i 0n⎛⎝⋅L((,,,vx i x n))f⎛⎝vxi⎞⎠⎞⎠=Lagrange_poly((,,1 vx .7))0.51245=Lagrange_poly((,,2 vx .7))0.52537=Lagrange_poly((,,3 vx .7))0.52326Fi di C ffi i f I l i P l i lNon-Commercial Use OnlyFinding Coefficients of an Interpolation Polynomial:=f((x))+++a0⋅a1x ⋅a2x2⋅a3x3=⋅1 x0⎛⎝x0⎞⎠2⎛⎝x0⎞⎠31 x1⎛⎝x1⎞⎠2⎛⎝x1⎞⎠31 x2⎛⎝x2⎞⎠2⎛⎝x2⎞⎠31 x3⎛⎝x3⎞⎠2⎛⎝x3⎞⎠3⎡⎢⎢⎢⎢⎢⎢⎢⎣⎤⎥⎥⎥⎥⎥⎥⎥⎦a0a1a2a3⎡⎢⎢⎢⎢⎢⎢⎣⎤⎥⎥⎥⎥⎥⎥⎦y0y1y2y3⎡⎢⎢⎢⎢⎢⎢⎣⎤⎥⎥⎥⎥⎥⎥⎦≔x0.511.52⎡⎢⎢⎢⎣⎤⎥⎥⎥⎦≔i ‥03 ≔yif⎛⎝xi⎞⎠=y0.3830.7070.9241⎡⎢⎢⎢⎣⎤⎥⎥⎥⎦≔j ‥03≔A,ij⎛⎝xi⎞⎠j=A1 0.5 0.25 0.12511 1 11 1.5 2.25 3.37512 4 8⎡⎢⎢⎢⎣⎤⎥⎥⎥⎦≔a0a1a2a3⎡⎢⎢⎢⎢⎢⎢⎣⎤⎥⎥⎥⎥⎥⎥⎦⋅A−1y0y1y2y3⎡⎢⎢⎢⎢⎢⎢⎣⎤⎥⎥⎥⎥⎥⎥⎦=a0a1a2a3⎡⎢⎢⎢⎢⎢⎢⎣⎤⎥⎥⎥⎥⎥⎥⎦−0.0160.851−0.083−0.044⎡⎢⎢⎢⎣⎤⎥⎥⎥⎦≔f((x))∑i⎛⎜⎝⋅aixi⎞⎟⎠=f((.7))0.52326same result as Newton and Lagrangecubic interpolations (because the polynomial is unique)Non-Commercial Use OnlyComparing the cubic polynomial fit to the tabulated data and the theoretical function:≔xr ,‥.5 .51 2 ≔ft((x))sin⎛⎜⎝⋅―4x⎞⎟⎠0.50.560.620.680.740.80.860.920.980.380.441.040.8 0.95 1.1 1.25 1.4 1.55 1.7 1.850.5 0.65 2yft((xr))f((xr))x xr xrNon-Commercial Use


View Full Document

CSU MECH 102 - Interpolation

Download Interpolation
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Interpolation and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Interpolation 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?