联系方式

  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-23:00
  • 微信:codinghelp

您当前位置:首页 >> Database作业Database作业

日期:2024-07-15 02:37

104A Homework 2

July 2024

1 Theory

1.1 Splines

Let s(x) be the natural cubic spline on [a, b] i.e. s(x) = si(x) on [xi , xi+1], i = 0, . . . ,(n − 1). Show that

for any g ∈ C2([a, b]) such that g(xi) = yi , i = 0, . . . , n. Hint: consider h(x) = s(x) − g(x) and rewrite g(x).

1.2 Lagrange

Prove that the functions form. a basis for degree n polynomials.

2 Coding

2.1 Spline

Consider data points (xi, yi) with {xi} equidistant. Let h = (xi+1 − xi) for any i = 0, . . . ,(n − 1) and s(x) the piecewise natural cubic spline. Denote zi = s ′′(xi). The tridiagonal system stems from equation (10) in Chapter 6.4,

Setup and solve the tridiagonal system for , you can use (Scipy) or (R) linear algebra libraries. The splines then can be evaluated with and equation (7) in Chapter 6.4. Evaluate them at a given set of test values. Use the function signature,

findAndEvalSpline(double[] x data, double[] y data, double[] x testVals) return double[] spline testVals.




版权所有:留学生编程辅导网 2020 All Rights Reserved 联系方式:QQ:99515681 微信:codinghelp 电子信箱:99515681@qq.com
免责声明:本站部分内容从网络整理而来,只供参考!如有版权问题可联系本站删除。 站长地图

python代写
微信客服:codinghelp