Exercise 2Quadratic spline 40pts Consider a set of points xi

Exercise 2Quadratic spline [40pts]. Consider a set of points (xi.y)-0. N of your choice with N > 4. All y coordinates should be positive. Moreoever, they should neither belong to a straight line nor to a quadratic curve. It is asked to find a quadratic spline y(x) (every branch of the spline is a quadratic polynomial) interpolating these points. 1. Explain how many conditions are missing to enforce uniqueness. 2. Find a spline which minimizes its length. 3. Find a spline which minimizes the area under the curve. 4. Plot the found splines on the same figure.

Solution

{ 0, 1, 2, 3, 4}; y = {1, .5, .2, .1, (1/17)}; n = Length[t]; z = y; z[[0]] = 0; For[i = 2, i <= n, i++, z[[i]] = -z[[i - 1]] + 2 (y[[i]] - y[[i - 1]])/(t[[i]] - t[[i - 1]])]; spline2[x_] := Module[{i, j}, i = 0; For[j = 1, j < n, j++, If[x < t[[j + 1]], i = j; Break[]]]; If[i == 0, i = n - 1]; (x - t[[i]]) ((x - t[[i]]) (z[[i + 1]] - z[[i]])/(2 (t[[i + 1]] - t[[i]])) + z[[i]]) + y[[i]]]
 Exercise 2Quadratic spline [40pts]. Consider a set of points (xi.y)-0. N of your choice with N > 4. All y coordinates should be positive. Moreoever, they sh

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site