0% found this document useful (0 votes)
24 views

Mmaths

This document discusses cubic splines. A spline is a piecewise polynomial function composed of subintervals. The order of a spline refers to the highest order polynomial used on each subinterval. Cubic splines use cubic (third degree) polynomials on each subinterval. The document provides the formula for cubic splines and outlines the step-by-step process for cubic spline interpolation given data points, which involves calculating M values, determining the cubic spline function f(x) for each interval, and applying boundary conditions. Examples of problems solving for cubic splines and their derivatives are also presented.

Uploaded by

Nivi Senthil
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views

Mmaths

This document discusses cubic splines. A spline is a piecewise polynomial function composed of subintervals. The order of a spline refers to the highest order polynomial used on each subinterval. Cubic splines use cubic (third degree) polynomials on each subinterval. The document provides the formula for cubic splines and outlines the step-by-step process for cubic spline interpolation given data points, which involves calculating M values, determining the cubic spline function f(x) for each interval, and applying boundary conditions. Examples of problems solving for cubic splines and their derivatives are also presented.

Uploaded by

Nivi Senthil
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 21

NUMERICALMETHODS

UNIT-2

CUBIC SPLINES

What are Splines?

A spline is a piecewise-polynomial real function


S: [a,b]--->R

on an interval [a,b] composed of k ordered disjoint sub-intervals [ti-1,ti] with a = t0< t1<. . .< t k-1<tk = b.

Order of a Spline

The restriction of S to an interval i is a polynomial so that


S(t) = P1 (t) for t0<= t < t1,

Pi: [ti-1, ti]-->R,

S(t) = P2 (t) for t1<= t < t2,


goes on..... S(t) = Pk (t) for tk-1<=t< tk.

The highest order of the polynomials Pi(t) is said to be the order of the spline S.

Uniform and Non-Uniform Splines


If all sub-intervals are of the same length, the spline is said to be uniform and non-uniform otherwise.
A cubic spline drawn with 8 points

Cubic Spline Interpolation and its applications


1.It is one of the finite element methods.

2.The spline function results in smooth curves through a set of points.


3.It have been used in
Design work Design of aircraft wings Design of car bodies.

4.At present widely used in Computer graphics programs.


5.Derived from Lagrange's interpolation formula.

How to do the problem???


Given data :The set of values for x and the corresponding f(x) and some yn'' (end conditions) values where n=0,1,2,..

To find :The cubic spline approximation for the function y=f(x).

How to do the problem???


Step-1:Find the value of h which is the interval between successive x values given. Step-2:-

Write down the Cubic Spline formula given by,

3 y(x)=f(x)= (1/6) [ (xi-x) Mi-1 + (x-xi3 1) Mi]


+(xi-x) [fi-1 (1/6) Mi-1]

How to do the problem???


Step-3:Write down the formula relating the terms in the above formula as:-

Mi-1 + 4Mi +Mi+1 = 6( fi-1 -2fi +fi+1)


Here take values for i from 1,2,...n-1 where n is the number of values given in the table.

Step-4:Form equations in M1, M2,...from the above and solve them.

How to do the problem???


Step-5:After getting the values of M1, M2,.... substitute them in the first formula (for cubic Splines) taking i=1. This gives the value of f1(x) which is the functional value in the first interval. Step-6:-

Repeat the above step for i=2,3,...n-1 to get f2(x) , f3(x),.....fn-1(x)

How to do the problem???

Step-7:Finally write the function compressed like

f1(x) in 1st interval


f(x)= f2(x) in 2nd interval f3(x) in 3rd interval

Important Points
1.Calculation of M values.

2.Calculation of f(x) values.


3.Doing the deductions like f '(a), f ''(b) and so on. 4.Every f(x) should be of order 3. 5.The interval should be equally spaced.

Problem-1 Question
i
xi yi

0
1 1

1
2 5

2
3 11

3
4 8

End Conditions:y0''=y3''=0.

Problem-1 Solution
To find:1.The Cubic Spline for y=f(x). 2.Compute y(1.5). 3.Compute y'(2).

Problem-1 Solution
Equations for M terms:-

For i=1,
the equation is 4M1+M2= 12. For i=2,

the equation is M1+4M2= -54. Solving we get,


M1= 102/15 and M2= -228/15.

Problem-1 Solution
The final answer is:-

3 2 f1(x) = (1/15) [ 17x -51x +94x-45] 3 2 f2(x) = (1/15) [-55x + 381x -770x+531] 3 2 f3(x)= (1/15) [38x -456x + 1741x-1980]

Problem-1 Solution
Deductions:-

(1) y(1.5):As 1.5 lies in [1,2] take f1(x) and put x=1.5 to get the answer as 2.575. (2)y'(2):As 2 lies in [1,2] take f1(x), differentiate it and put x=2 to get the answer as 6.267.

Problem-1 Solution
Deductions:-

(1) y(1.5):As 1.5 lies in [1,2] take f1(x) and put x=1.5 to get the answer as 2.575. (2)y'(2):As 2 lies in [1,2] take f1(x), differentiate it and put x=2 to get the answer as 6.267.

University Questions
Fit a natural cubic spline for the following data
Problem-1:- (year-2006) x: 0 1 2 3

Y : 1 4 0 -2
Problem-2:- (year-2007) X: 1 2 3 4 Y: 0.5 0.3333 0.25 0.2 and find f(2.5).

University Questions
1. Define splines and Cubic splines.

2.Give the applications of cubic splines.


3.Give the cubic spline equations. 4.What is the basis for Cubic splines? What is the method used to find? 5.From the given cubic splines, evaluate f(a), f''(a),etc...

Cubic Spline between three points -Sample Curve

THANK YOU!!!!

You might also like