It's a numerical analysis question
by

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.

1 Answer

Divide the x interval [α,β]=[-2,2] into three ordered points (-2,0.2), (1,0.5), (2,0.2). So n=3. Refer to these as (x0,y0), (x1,y1), (x2,y2). The question doesn't specify the number of splines (interpolants), so as an illustration I'll just use 2 (that is, n-1), which are splines between (-2,0.2) and (1,0.5) (knot), and (1,0.5) and (2,0.2). (In general, for n data points there would be n-1 splines and n-2 knots.)

A cubic spline: Si(x)=ai+bi(x-xi)+ci(x-xi)2+di(x-xi)3 where i=0, 1, or 2 in this example. The splines must pass through the 3 given points. Therefore we have:

S0(x)=a0+b0(x-x0)+c0(x-x0)2+d0(x-x0)3=f(x0)=y0 for x∈[x0,x1];

S1(x)=a1+b1(x-x1)+c1(x-x1)2+d1(x-x1)3=f(x1)=y1 for x∈[x1,x2];

S2(x)=a2+b2(x-x2)+c2(x-x2)2+d2(x-x2)3=f(x2)=y2 for x≥x2.

These are the pieces of the piecewise function S(x). We have 12 (=4n) unknown coefficients here, so we need to find more conditions to satisfy the equations. For the required condition of continuity, the end-point of the first interval is also the start-point of the second interval:

S0(x1)=S1(x1)=f(x1)=f(1)=y1=0.5 and, similarly for the end-point of the second interval and (β,f(β)):  S1(x2)=S2(x2)=f(x2)=f(2)=y2=0.2=f(β).

Also: S0(x0)=S0(α)=S0(-2)=f(-2)=y0=0.2.

We can now partly solve for these unknowns:

S0(x)=a0+b0(x-x0)+c0(x-x0)2+d0(x-x0)3 at (-2,0.2) becomes:

S0(-2)=a0=f(-2)=y0=0.2, so a0=0.2, because x0-x0=0. Also:

S2(2)=a2=f(2)=y2=0.2, so a2=0.2.

S1(1)=a1=f(1)=y1=0.5, so a1=0.5.

S0(1)=S1(1)=0.5⇒S0(1)=0.2+3b0+9c0+27d0=0.5.

S1(2)=S2(2)=0.2⇒S1(2)=0.5+b1+c2+d2=0.2.

Now we turn to the "smoothness" of the knot. This involves another condition, that the first derivatives are equal at common points on the splines. In this example there's only one common point at (1,0.5).

S0'(1)=S1'(1) and S1'(2)=S2'(2).

S0'(x)=b0+2c0(x-x0)+3d0(x-x0)2

S1'(x)=b1+2c1(x-x1)+3d1(x-x1)2

S2'(x)=b2+2c2(x-x2)+3d2(x-x2)2

The second derivative is used to equate the curvature at the knot.

S0"(1)=S1"(1) and S1"(2)=S2"(2).

S0"(x0)=2c0+6d0(x-x0)

S1"(x1)=2c1+6d1(x-x1)

S2"(x2)=2c2+6d2(x-x2)

Another condition distinguishes natural splines from clamped splines and enables us to find all the coefficients. This condition applies specifically to the end-points of the encompassing interval [α,β].

For clamped cubic splines we need the first derivatives at the end-points (α,f(α)) and (β,f(β)). We can only work out all the coefficients if we know f'(α) and f'(β). f'(x)=-2x/(1+x2)2; f'(-2)=4/25=0.16; f'(2)=-4/25=-0.16, because we know f(x)=1/(1+x2), just as we knew f(x) for x=-2, 1, 2=0.2, 0.5, 0.2. For natural cubic splines we only have to know that the second derivatives are zero at the end-points (α,f(α)) and (β,f(β)).

S0'(-2)=b0=f'(-2)=0.16, so b0=0.16; and S2'(2)=b2=f'(2)=-0.16. So we now have all ai, b0 and b2. We need b1, all ci and all di (7 coefficients). Using all the conditions and making substitutions for known coefficients, we have:

S0(1)=S1(1): 0.2+0.48+9c0+27d0=0.5;

S1(2)=S2(2): 0.5+b1+c1+d1=0.2;

S0'(1)=S1'(1): 0.16+2c0(1+2)+3d0(1+2)2=0.16+6c0+27d0=b1;

S1'(2)=S2'(2): b1+2c1+3d1=-0.16;

S0"(1)=S1"(1): 2c0+6d0(1+2)=2c0+18d0=2c1;

S1"(2)=S2"(2): 2c1+6d1=2c2 (to be omitted).

But we have no use for c2 or dbecause we don't need a spline for anything beyond x=β, a2 was only used in S1(2)=S2(2), and b2 was only used in S1'(2)=S2'(2). So the last second derivative equation (containing c2) can be omitted. That leaves 5 equations and 5 unknown coefficients: b1, c0, c1, d0, d1. We have all we need. We can solve using a 5×5 matrix A or elimination and substitution.

Matrix A=

⎛ 0  9   0  27  0 ⎞

⎜ 1   0  1    0 1 ⎟

⎟ 1 -6   0 -27 0 ⎟

⎜ 1  0   2   0  3 ⎟

⎝ 0  2 -2  18  0 ⎠

Matrix X=

⎛ b1 ⎞

⎜c0 ⎜

⎜c1 ⎟

⎜ d0 ⎜

⎝ d1 ⎠

and B=

⎛ -0.18 ⎞

⎜ -0.30 ⎟

⎜  0.16 ⎟

⎜-0.16 ⎟

⎝    0    ⎠

We solve for X in AX=B.

d0=-(0.18+9c0)/27=-(0.02+c0)/3,

b1-6c0+0.18+9c0=0.16, b1=-0.02-3c0,

c1=c0-(0.18+9c0)/3=-2c0-0.6,

d1=-0.3+0.02+3c0+2c0+0.6=5c0+0.32,

-0.02-3c0-4c0-1.2+15c0+0.96=-0.16, 8c0=-0.16+0.02+1.2-0.96=0.1, c0=0.0125.

Therefore: d0=-13/1200=-0.01083 approx; b1=-0.0575; c1=-0.625; d1=0.3825.

S0(x)=0.2+0.16(x+2)+0.0125(x+2)2-(13/1200)(x+2)3,

S1(x)=0.5-0.0575(x-1)-0.625(x-1)2+0.3825(x-1)3.

by Top Rated User (1.1m points)

I don't have access to MATLAB or other computational apps. The example I used is just an illustration of the method. In practice there would be multiple data points and, without an appropriate app, computations would be very laborious and time-consuming, as well as being prone to error. There may be errors in my solution despite the relative simplicity of the example.

Related questions

0 answers
asked May 6, 2013 in Calculus Answers by anonymous | 637 views
Welcome to MathHomeworkAnswers.org, where students, teachers and math enthusiasts can ask and answer any math question. Get help and answers to any math problem including algebra, trigonometry, geometry, calculus, trigonometry, fractions, solving expression, simplifying expressions and more. Get answers to math questions. Help is always 100% free!

Most popular tags

algebra problems solving equations word problems calculating percentages math problem geometry problems calculus problems math fraction problems trigonometry problems rounding numbers simplifying expressions solve for x order of operations probability algebra pre algebra problems word problem evaluate the expression slope intercept form statistics problems factoring polynomials solving inequalities 6th grade math how to find y intercept equation of a line sequences and series algebra 2 problems logarithmic equations solving systems of equations by substitution dividing fractions greatest common factor square roots geometric shapes graphing linear equations long division solving systems of equations least to greatest dividing decimals substitution method proving trigonometric identities least common multiple factoring polynomials ratio and proportion trig identity precalculus problems standard form of an equation solving equations with fractions http: mathhomeworkanswers.org ask# function of x calculus slope of a line through 2 points algebraic expressions solving equations with variables on both sides college algebra domain of a function solving systems of equations by elimination differential equation algebra word problems distributive property solving quadratic equations perimeter of a rectangle trinomial factoring factors of a number fraction word problems slope of a line limit of a function greater than or less than geometry division fractions how to find x intercept differentiation exponents 8th grade math simplifying fractions geometry 10th grade equivalent fractions inverse function area of a triangle elimination method story problems standard deviation integral ratios simplify systems of equations containing three variables width of a rectangle percentages area of a circle circumference of a circle place value solving triangles parallel lines mathematical proofs solving linear equations 5th grade math mixed numbers to improper fractions scientific notation problems quadratic functions number of sides of a polygon length of a rectangle statistics zeros of a function prime factorization percents algebra 1 evaluating functions derivative of a function equation area of a rectangle lowest common denominator solving systems of equations by graphing integers algebra 2 diameter of a circle dividing polynomials vertex of a parabola calculus problem perpendicular lines combining like terms complex numbers geometry word problems converting fractions to decimals finding the nth term range of a function 4th grade math greatest to least ordered pairs functions radius of a circle least common denominator slope unit conversion solve for y calculators solving radical equations calculate distance between two points area word problems equation of a tangent line multiplying fractions chemistry binomial expansion place values absolute value round to the nearest tenth common denominator sets set builder notation please help me to answer this step by step significant figures simplifying radicals arithmetic sequences median age problem trigonometry graphing derivatives number patterns adding fractions radicals midpoint of a line roots of polynomials product of two consecutive numbers limits decimals compound interest please help pre-algebra problems divisibility rules graphing functions subtracting fractions angles numbers discrete mathematics volume of a cylinder simultaneous equations integration probability of an event comparing decimals factor by grouping vectors percentage expanded forms rational irrational numbers improper fractions to mixed numbers algebra1 matrices logarithms how to complete the square mean statistics problem analytic geometry geometry problem rounding decimals 5th grade math problems solving equations with variables solving quadratic equations by completing the square simplifying trigonometric equation using identities
87,447 questions
99,052 answers
2,422 comments
4,785 users