0% found this document useful (0 votes)
9 views3 pages

Splines Notes

The document provides test preparation notes on splines, focusing on the use of piecewise polynomials to address large oscillations in interpolating polynomials. It outlines the definition and properties of linear splines, including the setup for implementation and key MATLAB commands for plotting. Additionally, it details the calculation of coefficients for linear spline segments.

Uploaded by

mivuyo490
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views3 pages

Splines Notes

The document provides test preparation notes on splines, focusing on the use of piecewise polynomials to address large oscillations in interpolating polynomials. It outlines the definition and properties of linear splines, including the setup for implementation and key MATLAB commands for plotting. Additionally, it details the calculation of coefficients for linear spline segments.

Uploaded by

mivuyo490
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

SPLINES - TEST PREPARATION NOTES

1. KEY CONCEPTS

Introduction

• Problem: Large oscillations in interpolating polynomials between nodes

• Solution: Use piecewise polynomials (splines) between consecutive nodes

• Splines generate function/data values only at the nodes

Splines Definition

• Given nodes (xₖ, yₖ) for k = 1,2,...,n

• Spline S(x) consists of polynomials S₁(x), S₂(x),...,Sₙ₋₁(x)

• Key property: S(xₖ) = yₖ for k = 1,2,...,n

2. LINEAR SPLINES

Mathematical Form

Properties

1. Generates data at nodes: Sₖ(xₖ) = yₖ, k = 1,2,...,n-1, Sₙ₋₁(xₙ) = yₙ

2. Continuous at interior nodes: Sₖ(xₖ₊₁) = Sₖ₊₁(xₖ₊₁), k = 1,2,...,n-2

Basic Structure for Linear Spline Implementation


Example from Exercise 1:

Plotting Splines:

Step-by-Step Method:

1. Set up data matrix: D = [x_values; y_values]

2. Calculate slopes for each segment:

• For segment k: slope = (yₖ₊₁ - yₖ)/(xₖ₊₁ - xₖ)

3. Define spline functions:

1. Ensure continuity: Check that Sₖ(xₖ₊₁) = Sₖ₊₁(xₖ₊₁)


2. Evaluate at required points using appropriate spline segment

Key MATLAB Commands:

• clear - Clear workspace

• format long - Set number display format

• @(x) - Anonymous function syntax

• fplot(function, [x_range]) - Plot function over range

• plot(x,y,'o') - Plot points with circles

• hold on/off - Control plot overlay

Linear Spline Segments:

Coefficient Calculation:

• aₖ = yₖ (y-value at node k)

• bₖ = (yₖ₊₁ - yₖ)/(xₖ₊₁ - xₖ) (slope of segment k)

You might also like