Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

need help with part a also need to find out how to define the function in terms of x(i) in matlab 2) In class, we

image text in transcribed

need help with part a

also need to find out how to define the function in terms of x(i) in matlab

2) In class, we derived the following matrix equation that must be solved to generate cubic spline interpolation 01 D2 D3 21 ZT-1 Un-2 hn-2 un-1 hn-1 (Here the blank entries in the matrix indicate these entries are equal to 0.) a) To form the natural cubic spline, we set zo0 and zn0 in (1), obtaining U1 12 U3 21 h ha Un-1 h-2 Un-1 2n-1 Write Matlab code to solve (2) (using your tridfun.m function), thus deter- mining the spline pieces S(z), and thus the entire spline S() Your code should then prompt the user for a number p and return the value S(p). Ifp is out of range, your program should say so. Finally, produce a Matlab plot of the graph of S(x). Have the spline itself as a solid green curve with the data points as magenta circles b) Another variant of the cubic spline is the "clamped" cubic spline in which we assign values to the derivative S'(z) at the endpoints to and tn. Modify (1) to include these two conditions while maintaining the tridiagonal structure, if possible. Your "answer" should be a matrix equation similar to (2). This is a "paper and pencil" exercise; I am not asking you to write code. 2) In class, we derived the following matrix equation that must be solved to generate cubic spline interpolation 01 D2 D3 21 ZT-1 Un-2 hn-2 un-1 hn-1 (Here the blank entries in the matrix indicate these entries are equal to 0.) a) To form the natural cubic spline, we set zo0 and zn0 in (1), obtaining U1 12 U3 21 h ha Un-1 h-2 Un-1 2n-1 Write Matlab code to solve (2) (using your tridfun.m function), thus deter- mining the spline pieces S(z), and thus the entire spline S() Your code should then prompt the user for a number p and return the value S(p). Ifp is out of range, your program should say so. Finally, produce a Matlab plot of the graph of S(x). Have the spline itself as a solid green curve with the data points as magenta circles b) Another variant of the cubic spline is the "clamped" cubic spline in which we assign values to the derivative S'(z) at the endpoints to and tn. Modify (1) to include these two conditions while maintaining the tridiagonal structure, if possible. Your "answer" should be a matrix equation similar to (2). This is a "paper and pencil" exercise; I am not asking you to write code

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Management System MCQs Multiple Choice Questions And Answers

Authors: Arshad Iqbal

1st Edition

1073328554, 978-1073328550

More Books

Students also viewed these Databases questions

Question

Describe the linkages between HRM and strategy formulation. page 74

Answered: 1 week ago

Question

Identify approaches to improving retention rates.

Answered: 1 week ago