Math 104A Homework


Math 104A Homework #4 ∗
General Instructions: Please write your homework papers neatly, and follow TA’s instructions
(on Gauchoapace) to turn it in. Write your own code individually. Do not copy codes!
1. Write a code to compute a natural spline S(x) which interpolates a collection of given points
(x0, y0),(x1, y1), ...,(xn, yn) where x0 < x1 < x2 < ... < xn (do not assume they are equidistributed).
2. One important application of spline interpolation is the construction of smooth curves that
are not necessarily the graph of a function but that have a parametric representation x = x(t)
and y = y(t) for t ∈ [a, b]. Hence one needs to determine two splines interpolating (tj , xj )
and (tj , yj ) (j = 0, 1, ...n).
The arc length of the curve is a natural choice for the parameter t. However, this is not
known a priori and instead the tj s are usually chosen as the distances of consecutive points:
t0 = 0, tj = tj−1 +q(xj − xj−1)2 + (yj − yj−1)2, j = 1, 2, ...n.
Use the values in Table 1 to construct a smooth parametric representation of a curve passing
through the points (xj , yj ), j = 0, 1, ..., 8 by finding the two natural cubic splines interpolating
(tj , xj ) and (tj , yj ), j = 0, 1, ...8, respectively. Tabulate the coefficients of the splines and plot
the resulting (parametric) curve.
∗All course materials (class lectures and discussions, handouts, homework assignments, examinations, web materials)
and the intellectual content of the course itself are protected by United States Federal Copyright Law, the
Math 104A作业代写
California Civil Code. The UC Policy 102.23 expressly prohibits students (and all other persons) from recording
lectures or discussions and from distributing or selling lectures notes and all other course materials without the prior
written permission of Prof. Hector D. Ceniceros.
1
Table 1
j tj xj yj
0 0 1.50 0.75
1 0.618 0.90 0.90
2 0.935 0.60 1.00
3 1.255 0.35 0.80
4 1.636 0.20 0.45
5 1.905 0.10 0.20
6 2.317 0.50 0.10
7 2.827 1.00 0.20
8 3.330 1.50 0.25

If necessary, please add QQ: 99515681 or email: [email protected] micro letter: codehelp

Guess you like

Origin www.cnblogs.com/welcomeyou/p/12444124.html