Numerical Methods for Engineers
Numerical Methods for Engineers
7th Edition
ISBN: 9780073397924
Author: Steven C. Chapra Dr., Raymond P. Canale
Publisher: McGraw-Hill Education
bartleby

Videos

Textbook Question
Book Icon
Chapter 18, Problem 14P

Develop cubic splines for the data in Prob. 18.6 and (a) predict f (4) and f (2.5) and (b) verify that f 2 ( 3 ) and f 3 ( 3 ) = 19 .

(a)

Expert Solution
Check Mark
To determine

To calculate: The value of f(4), and f(2.5) by developing the cubic splines for the data points mentioned Prob 18.6.

Answer to Problem 14P

Solution:

f3(4)=48.41157 and f2(2.5)=10.78398

Explanation of Solution

Given Information:

Write the data points mentioned in the Prob. 18.6.

x 1 2 3 5 7 8
f(x) 3 6 19 99 291 444

Formula Used:

A third order polynomial is derived for each interval between data points in cubic splines.

Write the expression of polynomial for each interval from Eq.18.36.

fi(x)=(fi(xi1)(xíx)36(xíxi1)+fi(xi)6(xíxi1)×(xxi1)3+[f(xi1)(xíxi1)f(xi1)×(xíxi1)6]×(xíx)+[f(xi)(xíxi1)f(xi)×(xíxi1)6]×(xxi1))

Here, 4n conditions are required to evaluate 4n unknowns.

Write the equations to calculate the unknowns,

((xíxi1)f(xi1)+2(xi+1xi1)f(xi)+(xi+1xi)f(xi+1))=(6[f(xi+1)f(xi)](xi+1xi)+6[f(xi1)f(xi)](xixi1))

Calculation:

Recall the table mentioned in the Prob. 18.6.

x 1 2 3 5 7 8
f(x) 3 6 19 99 291 444

From the table the value is,

For  x0=1,f(x0)=3For  x1=2,f(x1)=6For  x2=3,f(x2)=19For  x3=5,f(x3)=99For  x5=7,f(x5)=291

Recall the equations to calculate the unknowns,

((xíxi1)f(xi1)+2(xi+1xi1)f(xi)+(xi+1xi)f(xi+1))=(6[f(xi+1)f(xi)](xi+1xi)+6[f(xi1)f(xi)](xixi1)) …… (1)

Write the equation(1) for i=1.

((x1x0)f(x0)+2(x2x0)f(x1)+(x2x1)f(x2))=(6[f(x2)f(x1)](x2x1)+6[f(x0)f(x1)](x1x0))

Substitute all the above values.

[(21)f(1)+2(31)f(2)+(32)f(3)]=(6×[196](32)+6×[36](21))

Because of natural spline condition f(1)=0 and f(8)=0 thus,

4f(2)+f(3)=60

Similarly, equation(1) can be write for all interior knot i=2,3,5,7.

f(2)+6f(3)+2f(5)=162

2f(3)+8f(5)+2f(7)=336

2f(5)+6f(7)=342

Write all the above equations in matrix form.

[4100162002820026][f(2)f(3)f(5)f(7)]=[60162336342]

Solve the equations by using the MATLAB,

Write the following codes in MATLAB.

A=zeros(4,4);

A(1,1)=4;

A(1,2)=1;

A(2,1)=1;

A(2,2)=6;

A(2,3)=2;

A(3,2)=2;

A(3,3)=8;

A(3,4)=2;

A(3,5)=1;

A(4,3)=2;

A(4,4)=6;

%

B= [60;162;336;342];

Sol = A\B

The values are,

f(2)=10.84716f(3)=16.61135f(5)=25.74236f(7)=48.41921

Recall the polynomial expression for each interval,

fi(x)=(fi(xi1)(xíx)36(xíxi1)+fi(xi)6(xíxi1)×(xxi1)3+[f(xi1)(xíxi1)f(xi1)×(xíxi1)6]×(xíx)+[f(xi)(xíxi1)f(xi)×(xíxi1)6]×(xxi1)) …… (2)

Write the equation (2) for i=1.

f1(x)=(f1(x0)(x1x)36(x1x0)+f1(x1)6(x1x0)×(xx0)3+[f(x0)(x1x0)f(x0)×(x1x0)6]×(x1x)+[f(x1)(x1x0)f(x1)×(x1x0)6]×(xx0))

Substitute the all values.

f1(x)=(f1(1)(2x)36(21)+f1(2)6(21)×(x1)3+[f(1)(21)f(1)×(21)6]×(2x)+[f(2)(21)f(2)×(21)6]×(x1))

Again, substitute all the values.

f1(x)=((0)(2x)36(21)+(10.84716)6(21)×(x1)3+[3(21)(0)×(21)6]×(2x)+[6(21)(10.84716)×(21)6]×(x1))=(10.84716)6(x1)3+[3](2x)+[6(10.84716)6](x1)=1.80786(x1)3+3(2x)+4.19241(x1)

Similarly solve for the i=2,3,5,7.

f2(x)=1.80786(3x)3+2.768559(x2)3+4.19241(3x)+16.23144(x2)

f3(x)=1.384279(5x)3+2.145197(x3)3+3.962882(5x)+40.91921(x3)

f5(x)=2.145179(7x)3+4.034934(x5)3+40.91921(7x)+129.3603(x3)

f7(x)=8.069869(8x)3+282.9301(8x)+444(x7)

Calculate the value of f(4).

Substitute 4 for x in f3(x).

f3(4)=1.384279(5x)3+2.145197(43)3+3.962882(54)+40.91921(43)=1.384279+2.145197+3.962882+40.91921=48.41157

Calculate the value of f(2.5).

Substitute 2.5 for x in f2(x).

f2(2.5)=1.80786(32.5)3+2.768559(2.52)3+4.19241(32.5)+16.23144(2.52)=1.80786(0.5)3+2.768559(0.5)3+4.19241(0.5)+16.23144(0.5)=10.78398

Therefore, the value f(4)=48.41157 and f(2.5)=10.78398.

(b)

Expert Solution
Check Mark
To determine

To show: The value of f2(3), and f3(3)=19.

Answer to Problem 14P

Solution:

f2(3)=f3(3)=19 verified.

Explanation of Solution

Given Information:

f2(x)=1.80786(3x)3+2.768559(x2)3+4.19241(3x)+16.23144(x2)

f3(x)=1.384279(5x)3+2.145197(x3)3+3.962882(5x)+40.91921(x3)

Calculation:

Calculate the value of f2(3).

Recall the expression of f2(x).

f2(x)=1.80786(3x)3+2.768559(x2)3+4.19241(3x)+16.23144(x2)

Substitute 3 for x in f2(x).

f2(3)=1.80786(33)3+2.768559(32)3+4.19241(33)+16.23144(32)=2.768559+16.23144=19

Calculate the value of f3(3).

Substitute 3 for x in f3(x).

f3(x)=1.384279(53)3+2.145197(33)3+3.962882(53)+40.91921(33)=1.384279(2)3+3.962882(2)=19

Thus, f2(3)=f3(3)=19 proved.

Want to see more full solutions like this?

Subscribe now to access step-by-step solutions to millions of textbook problems written by subject matter experts!

Chapter 18 Solutions

Numerical Methods for Engineers

Knowledge Booster
Background pattern image
Advanced Math
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, advanced-math and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Text book image
Algebra & Trigonometry with Analytic Geometry
Algebra
ISBN:9781133382119
Author:Swokowski
Publisher:Cengage
Text book image
Algebra: Structure And Method, Book 1
Algebra
ISBN:9780395977224
Author:Richard G. Brown, Mary P. Dolciani, Robert H. Sorgenfrey, William L. Cole
Publisher:McDougal Littell
Interpolation | Lecture 43 | Numerical Methods for Engineers; Author: Jffrey Chasnov;https://www.youtube.com/watch?v=RpxoN9-i7Jc;License: Standard YouTube License, CC-BY