SlideShare a Scribd company logo
1 of 3
Download to read offline
AMTH250                                                                   Assignment 4
                                Due: 27th August




Question 1 [2 marks]
   The following data are related to the life expectation of citizens of two
countries:
                                 1975      1980       1985         1990
                        Tanab    72.8      74.2       75.2         76.4
                        Sarac    70.2      70.2       70.3         71.2

   Use the interpolating polynomial of degree three to estimate the life
expectation in 1977, 1983, and 1988.
Question 2 [2 marks]
   A function

                   y = a1 e−2x + a2 e−x + a3 + a4 ex + a5 e2x

has the values

              x      -2           -1         0               1          2
              y    125.948      7.673     -4.000          -14.493    -103.429

   Determine the coefficients a1 , a2 , a3 , a4 , a5 .
Question 3 [2 marks]
                                                                 √
   Interpolate and plot the following values of the function y = x using
(a) a cubic spline, (b) a pchip cubic and (c) a polynomial of degree 5.

                    x    0   0.01       0.04       0.09     0.16    0.25
                    y    0    0.1        0.2        0.3      0.4     0.5

   Which is most accurate over most of the domain?
   Which is most accurate between 0 and 0.01?
(Plot the errors over the domain of x and over the interval [0, 0.01] and
compare them.)




                                               1
Question 4 [3 marks]
     For the data

                     x     1.0    2.0    3.0    4.0        5.0   6.0    7.0
                     y     1.9    2.7    4.8    5.3        7.1   9.4   11.3

    (a) Compute and plot the cubic spline and pchip interpolants and their
first, second and third derivatives. Use ppderiv for the derivatives.
    (b) Verify, from the graphs, that the defining conditions for a cubic
spline and a pchip cubic are satisfied. How does the ”not-a-knot” condition
for the cubic spline show up in the graphs?

Question 5 [3 marks]
    The following problem arises in surveying. Suppose we wish to determine
the altitudes x1 , x2 , x3 and x4 of four points. As well as measuring each
altitude with respect to some reference point, each point is measured with
respect to all of the others. The resulting measurements are:

                                           x1         2.95
                                           x2         1.74
                                           x3        -1.45
                                           x4         1.32
                                        x1 − x2       1.23
                                        x1 − x3       4.45
                                        x1 − x4       1.61
                                        x2 − x3       3.21
                                        x2 − x4       0.45
                                        x3 − x4      -2.75

These form an overdetermined set of linear equations. Find the least-squares
solution. How do the computed values compare to the direct measurements?
Question 6 [4 marks]
   Fit a quadratic polynomial, a power function y = axp and an exponential
function y = aekx to the data:

 x      1.0    2.0        3.0     4.0    5.0         6.0      7.0       8.0     9.0     10.0
 y     27.7   39.3       38.4    57.6    46.3       54.8     108.5     137.6   194.1   281.2

     Which do you think gives the best representation of the data?




                                                2
Notes on the Assignment
    Don’t forget to put your scripts in the Latex file and to attach to your
submission all graphs you produced. You can use verbatim environment to
include the ’unprintable’, e.g.,

begin{verbatim}
octave:28> hold on
octave:29> plot (x, ppval(pc,x),’g-’)

end{verbatim}


Question 4
Given a piecewise polynomial pp found by

pp = interp1(..., ..., ’spline’, ’pp’)

for example, then

pp1 = ppderiv(pp)

will compute the derivative of pp as a piecewise polynomial. Like the original
function, pp1 can then be evaluated with ppval.




                                      3

More Related Content

What's hot

Fuzzy c means clustering protocol for wireless sensor networks
Fuzzy c means clustering protocol for wireless sensor networksFuzzy c means clustering protocol for wireless sensor networks
Fuzzy c means clustering protocol for wireless sensor networksmourya chandra
 
Gaussian Integration
Gaussian IntegrationGaussian Integration
Gaussian IntegrationReza Rahimi
 
Lec02 03 rasterization
Lec02 03 rasterizationLec02 03 rasterization
Lec02 03 rasterizationMaaz Rizwan
 
Line drawing algorithm and antialiasing techniques
Line drawing algorithm and antialiasing techniquesLine drawing algorithm and antialiasing techniques
Line drawing algorithm and antialiasing techniquesAnkit Garg
 
Mid point line Algorithm - Computer Graphics
Mid point line Algorithm - Computer GraphicsMid point line Algorithm - Computer Graphics
Mid point line Algorithm - Computer GraphicsDrishti Bhalla
 
Circle generation algorithm
Circle generation algorithmCircle generation algorithm
Circle generation algorithmAnkit Garg
 
Fuzzy image processing- fuzzy C-mean clustering
Fuzzy image processing- fuzzy C-mean clusteringFuzzy image processing- fuzzy C-mean clustering
Fuzzy image processing- fuzzy C-mean clusteringFarah M. Altufaili
 
Intro to scan conversion
Intro to scan conversionIntro to scan conversion
Intro to scan conversionMohd Arif
 
Num Integration
Num IntegrationNum Integration
Num Integrationmuhdisys
 
Output primitives in Computer Graphics
Output primitives in Computer GraphicsOutput primitives in Computer Graphics
Output primitives in Computer GraphicsKamal Acharya
 
Integration and its basic rules and function.
Integration and its basic rules and function.Integration and its basic rules and function.
Integration and its basic rules and function.Kartikey Rohila
 
12 epe11 applied mathematics - june, july 2013
12 epe11  applied mathematics - june, july 201312 epe11  applied mathematics - june, july 2013
12 epe11 applied mathematics - june, july 2013Dover Solutions India
 
Comuter graphics dda algorithm
Comuter graphics dda algorithm Comuter graphics dda algorithm
Comuter graphics dda algorithm Rachana Marathe
 

What's hot (20)

Dda algo notes
Dda algo notesDda algo notes
Dda algo notes
 
Fuzzy c means clustering protocol for wireless sensor networks
Fuzzy c means clustering protocol for wireless sensor networksFuzzy c means clustering protocol for wireless sensor networks
Fuzzy c means clustering protocol for wireless sensor networks
 
Gaussian Integration
Gaussian IntegrationGaussian Integration
Gaussian Integration
 
Lec02 03 rasterization
Lec02 03 rasterizationLec02 03 rasterization
Lec02 03 rasterization
 
Line circle draw
Line circle drawLine circle draw
Line circle draw
 
Line drawing algorithm and antialiasing techniques
Line drawing algorithm and antialiasing techniquesLine drawing algorithm and antialiasing techniques
Line drawing algorithm and antialiasing techniques
 
Mid point line Algorithm - Computer Graphics
Mid point line Algorithm - Computer GraphicsMid point line Algorithm - Computer Graphics
Mid point line Algorithm - Computer Graphics
 
Circle generation algorithm
Circle generation algorithmCircle generation algorithm
Circle generation algorithm
 
Lect3cg2011
Lect3cg2011Lect3cg2011
Lect3cg2011
 
Computer Graphics
Computer GraphicsComputer Graphics
Computer Graphics
 
Fuzzy image processing- fuzzy C-mean clustering
Fuzzy image processing- fuzzy C-mean clusteringFuzzy image processing- fuzzy C-mean clustering
Fuzzy image processing- fuzzy C-mean clustering
 
Intro to scan conversion
Intro to scan conversionIntro to scan conversion
Intro to scan conversion
 
DDA algorithm
DDA algorithmDDA algorithm
DDA algorithm
 
Num Integration
Num IntegrationNum Integration
Num Integration
 
Integration
IntegrationIntegration
Integration
 
Dda algorithm
Dda algorithmDda algorithm
Dda algorithm
 
Output primitives in Computer Graphics
Output primitives in Computer GraphicsOutput primitives in Computer Graphics
Output primitives in Computer Graphics
 
Integration and its basic rules and function.
Integration and its basic rules and function.Integration and its basic rules and function.
Integration and its basic rules and function.
 
12 epe11 applied mathematics - june, july 2013
12 epe11  applied mathematics - june, july 201312 epe11  applied mathematics - june, july 2013
12 epe11 applied mathematics - june, july 2013
 
Comuter graphics dda algorithm
Comuter graphics dda algorithm Comuter graphics dda algorithm
Comuter graphics dda algorithm
 

Similar to AMTH250 Assignment 4 Interpolation and Curve Fitting

Sistem pertidaksamaan kuadrat 2 variabel
Sistem pertidaksamaan kuadrat 2 variabelSistem pertidaksamaan kuadrat 2 variabel
Sistem pertidaksamaan kuadrat 2 variabelAlya Titania Annisaa
 
Image Processing
Image ProcessingImage Processing
Image Processingyuvhashree
 
Introduction to matlab
Introduction to matlabIntroduction to matlab
Introduction to matlabkrishna_093
 
Pc12 sol c08_8-6
Pc12 sol c08_8-6Pc12 sol c08_8-6
Pc12 sol c08_8-6Garden City
 
Review for the Third Midterm of Math 150 B 11242014Probl.docx
Review for the Third Midterm of Math 150 B 11242014Probl.docxReview for the Third Midterm of Math 150 B 11242014Probl.docx
Review for the Third Midterm of Math 150 B 11242014Probl.docxjoellemurphey
 
Perspective in Informatics 3 - Assignment 1 - Answer Sheet
Perspective in Informatics 3 - Assignment 1 - Answer SheetPerspective in Informatics 3 - Assignment 1 - Answer Sheet
Perspective in Informatics 3 - Assignment 1 - Answer SheetHoang Nguyen Phong
 
Mathematica model test paper
Mathematica model test paperMathematica model test paper
Mathematica model test paperLuckshay Batra
 
Module 1 quadratic functions
Module 1   quadratic functionsModule 1   quadratic functions
Module 1 quadratic functionsdionesioable
 
Mathematics 9 Quadratic Functions (Module 1)
Mathematics 9 Quadratic Functions (Module 1)Mathematics 9 Quadratic Functions (Module 1)
Mathematics 9 Quadratic Functions (Module 1)Juan Miguel Palero
 
Amth250 octave matlab some solutions (2)
Amth250 octave matlab some solutions (2)Amth250 octave matlab some solutions (2)
Amth250 octave matlab some solutions (2)asghar123456
 
Computer Graphics End Semester Question Paper
Computer Graphics End Semester Question PaperComputer Graphics End Semester Question Paper
Computer Graphics End Semester Question PaperAnsuman Mahapatra
 
3D Math Primer: CocoaConf Atlanta
3D Math Primer: CocoaConf Atlanta3D Math Primer: CocoaConf Atlanta
3D Math Primer: CocoaConf AtlantaJanie Clayton
 
7.curves Further Mathematics Zimbabwe Zimsec Cambridge
7.curves   Further Mathematics Zimbabwe Zimsec Cambridge7.curves   Further Mathematics Zimbabwe Zimsec Cambridge
7.curves Further Mathematics Zimbabwe Zimsec Cambridgealproelearning
 
Name ____________________________ Calculus 2 Mike Huff .docx
Name ____________________________ Calculus 2   Mike Huff  .docxName ____________________________ Calculus 2   Mike Huff  .docx
Name ____________________________ Calculus 2 Mike Huff .docxrosemarybdodson23141
 
Module 3 quadratic functions
Module 3   quadratic functionsModule 3   quadratic functions
Module 3 quadratic functionsdionesioable
 

Similar to AMTH250 Assignment 4 Interpolation and Curve Fitting (20)

Sistem pertidaksamaan kuadrat 2 variabel
Sistem pertidaksamaan kuadrat 2 variabelSistem pertidaksamaan kuadrat 2 variabel
Sistem pertidaksamaan kuadrat 2 variabel
 
Image Processing
Image ProcessingImage Processing
Image Processing
 
Introduction to matlab
Introduction to matlabIntroduction to matlab
Introduction to matlab
 
Pc12 sol c08_8-6
Pc12 sol c08_8-6Pc12 sol c08_8-6
Pc12 sol c08_8-6
 
Final exam mariluz 1
Final exam mariluz 1Final exam mariluz 1
Final exam mariluz 1
 
Lec3
Lec3Lec3
Lec3
 
Review for the Third Midterm of Math 150 B 11242014Probl.docx
Review for the Third Midterm of Math 150 B 11242014Probl.docxReview for the Third Midterm of Math 150 B 11242014Probl.docx
Review for the Third Midterm of Math 150 B 11242014Probl.docx
 
Perspective in Informatics 3 - Assignment 1 - Answer Sheet
Perspective in Informatics 3 - Assignment 1 - Answer SheetPerspective in Informatics 3 - Assignment 1 - Answer Sheet
Perspective in Informatics 3 - Assignment 1 - Answer Sheet
 
Mathematica model test paper
Mathematica model test paperMathematica model test paper
Mathematica model test paper
 
Module 1 quadratic functions
Module 1   quadratic functionsModule 1   quadratic functions
Module 1 quadratic functions
 
Mathematics 9 Quadratic Functions (Module 1)
Mathematics 9 Quadratic Functions (Module 1)Mathematics 9 Quadratic Functions (Module 1)
Mathematics 9 Quadratic Functions (Module 1)
 
Amth250 octave matlab some solutions (2)
Amth250 octave matlab some solutions (2)Amth250 octave matlab some solutions (2)
Amth250 octave matlab some solutions (2)
 
Q addmaths 2011
Q addmaths 2011Q addmaths 2011
Q addmaths 2011
 
Mit6 094 iap10_lec03
Mit6 094 iap10_lec03Mit6 094 iap10_lec03
Mit6 094 iap10_lec03
 
Introduction to MATLAB
Introduction to MATLABIntroduction to MATLAB
Introduction to MATLAB
 
Computer Graphics End Semester Question Paper
Computer Graphics End Semester Question PaperComputer Graphics End Semester Question Paper
Computer Graphics End Semester Question Paper
 
3D Math Primer: CocoaConf Atlanta
3D Math Primer: CocoaConf Atlanta3D Math Primer: CocoaConf Atlanta
3D Math Primer: CocoaConf Atlanta
 
7.curves Further Mathematics Zimbabwe Zimsec Cambridge
7.curves   Further Mathematics Zimbabwe Zimsec Cambridge7.curves   Further Mathematics Zimbabwe Zimsec Cambridge
7.curves Further Mathematics Zimbabwe Zimsec Cambridge
 
Name ____________________________ Calculus 2 Mike Huff .docx
Name ____________________________ Calculus 2   Mike Huff  .docxName ____________________________ Calculus 2   Mike Huff  .docx
Name ____________________________ Calculus 2 Mike Huff .docx
 
Module 3 quadratic functions
Module 3   quadratic functionsModule 3   quadratic functions
Module 3 quadratic functions
 

More from asghar123456

Answers assignment 5 open channel hydraulics-fluid mechanics
Answers assignment 5 open channel hydraulics-fluid mechanicsAnswers assignment 5 open channel hydraulics-fluid mechanics
Answers assignment 5 open channel hydraulics-fluid mechanicsasghar123456
 
Answers assignment 4 real fluids-fluid mechanics
Answers assignment 4 real fluids-fluid mechanicsAnswers assignment 4 real fluids-fluid mechanics
Answers assignment 4 real fluids-fluid mechanicsasghar123456
 
Answers assignment 3 integral methods-fluid mechanics
Answers assignment 3 integral methods-fluid mechanicsAnswers assignment 3 integral methods-fluid mechanics
Answers assignment 3 integral methods-fluid mechanicsasghar123456
 
Answers assignment 2 fluid statics-fluid mechanics
Answers assignment 2 fluid statics-fluid mechanicsAnswers assignment 2 fluid statics-fluid mechanics
Answers assignment 2 fluid statics-fluid mechanicsasghar123456
 
assignment 1 properties of fluids-Fluid mechanics
assignment 1 properties of fluids-Fluid mechanicsassignment 1 properties of fluids-Fluid mechanics
assignment 1 properties of fluids-Fluid mechanicsasghar123456
 
Buckling test engt110
Buckling test engt110Buckling test engt110
Buckling test engt110asghar123456
 
Amth250 octave matlab some solutions (4)
Amth250 octave matlab some solutions (4)Amth250 octave matlab some solutions (4)
Amth250 octave matlab some solutions (4)asghar123456
 
Amth250 octave matlab some solutions (3)
Amth250 octave matlab some solutions (3)Amth250 octave matlab some solutions (3)
Amth250 octave matlab some solutions (3)asghar123456
 
Amth250 octave matlab some solutions (1)
Amth250 octave matlab some solutions (1)Amth250 octave matlab some solutions (1)
Amth250 octave matlab some solutions (1)asghar123456
 

More from asghar123456 (10)

Answers assignment 5 open channel hydraulics-fluid mechanics
Answers assignment 5 open channel hydraulics-fluid mechanicsAnswers assignment 5 open channel hydraulics-fluid mechanics
Answers assignment 5 open channel hydraulics-fluid mechanics
 
Answers assignment 4 real fluids-fluid mechanics
Answers assignment 4 real fluids-fluid mechanicsAnswers assignment 4 real fluids-fluid mechanics
Answers assignment 4 real fluids-fluid mechanics
 
Answers assignment 3 integral methods-fluid mechanics
Answers assignment 3 integral methods-fluid mechanicsAnswers assignment 3 integral methods-fluid mechanics
Answers assignment 3 integral methods-fluid mechanics
 
Answers assignment 2 fluid statics-fluid mechanics
Answers assignment 2 fluid statics-fluid mechanicsAnswers assignment 2 fluid statics-fluid mechanics
Answers assignment 2 fluid statics-fluid mechanics
 
assignment 1 properties of fluids-Fluid mechanics
assignment 1 properties of fluids-Fluid mechanicsassignment 1 properties of fluids-Fluid mechanics
assignment 1 properties of fluids-Fluid mechanics
 
Buckling test engt110
Buckling test engt110Buckling test engt110
Buckling test engt110
 
Assignment6
Assignment6Assignment6
Assignment6
 
Amth250 octave matlab some solutions (4)
Amth250 octave matlab some solutions (4)Amth250 octave matlab some solutions (4)
Amth250 octave matlab some solutions (4)
 
Amth250 octave matlab some solutions (3)
Amth250 octave matlab some solutions (3)Amth250 octave matlab some solutions (3)
Amth250 octave matlab some solutions (3)
 
Amth250 octave matlab some solutions (1)
Amth250 octave matlab some solutions (1)Amth250 octave matlab some solutions (1)
Amth250 octave matlab some solutions (1)
 

Recently uploaded

Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 

Recently uploaded (20)

Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 

AMTH250 Assignment 4 Interpolation and Curve Fitting

  • 1. AMTH250 Assignment 4 Due: 27th August Question 1 [2 marks] The following data are related to the life expectation of citizens of two countries: 1975 1980 1985 1990 Tanab 72.8 74.2 75.2 76.4 Sarac 70.2 70.2 70.3 71.2 Use the interpolating polynomial of degree three to estimate the life expectation in 1977, 1983, and 1988. Question 2 [2 marks] A function y = a1 e−2x + a2 e−x + a3 + a4 ex + a5 e2x has the values x -2 -1 0 1 2 y 125.948 7.673 -4.000 -14.493 -103.429 Determine the coefficients a1 , a2 , a3 , a4 , a5 . Question 3 [2 marks] √ Interpolate and plot the following values of the function y = x using (a) a cubic spline, (b) a pchip cubic and (c) a polynomial of degree 5. x 0 0.01 0.04 0.09 0.16 0.25 y 0 0.1 0.2 0.3 0.4 0.5 Which is most accurate over most of the domain? Which is most accurate between 0 and 0.01? (Plot the errors over the domain of x and over the interval [0, 0.01] and compare them.) 1
  • 2. Question 4 [3 marks] For the data x 1.0 2.0 3.0 4.0 5.0 6.0 7.0 y 1.9 2.7 4.8 5.3 7.1 9.4 11.3 (a) Compute and plot the cubic spline and pchip interpolants and their first, second and third derivatives. Use ppderiv for the derivatives. (b) Verify, from the graphs, that the defining conditions for a cubic spline and a pchip cubic are satisfied. How does the ”not-a-knot” condition for the cubic spline show up in the graphs? Question 5 [3 marks] The following problem arises in surveying. Suppose we wish to determine the altitudes x1 , x2 , x3 and x4 of four points. As well as measuring each altitude with respect to some reference point, each point is measured with respect to all of the others. The resulting measurements are: x1 2.95 x2 1.74 x3 -1.45 x4 1.32 x1 − x2 1.23 x1 − x3 4.45 x1 − x4 1.61 x2 − x3 3.21 x2 − x4 0.45 x3 − x4 -2.75 These form an overdetermined set of linear equations. Find the least-squares solution. How do the computed values compare to the direct measurements? Question 6 [4 marks] Fit a quadratic polynomial, a power function y = axp and an exponential function y = aekx to the data: x 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 y 27.7 39.3 38.4 57.6 46.3 54.8 108.5 137.6 194.1 281.2 Which do you think gives the best representation of the data? 2
  • 3. Notes on the Assignment Don’t forget to put your scripts in the Latex file and to attach to your submission all graphs you produced. You can use verbatim environment to include the ’unprintable’, e.g., begin{verbatim} octave:28> hold on octave:29> plot (x, ppval(pc,x),’g-’) end{verbatim} Question 4 Given a piecewise polynomial pp found by pp = interp1(..., ..., ’spline’, ’pp’) for example, then pp1 = ppderiv(pp) will compute the derivative of pp as a piecewise polynomial. Like the original function, pp1 can then be evaluated with ppval. 3