发布于: 2023-3-8最后更新: 2024-8-18字数 1461 分钟

type
status
date
slug
summary
tags
category
icon
password

对常见插值方法的python实现

众所周知,哈工大不能用Matlab,所以在上数值逼近实验课的时候没法直接copy学长的code,所以在此放出我写的python代码
notion image

Newton插值

先构造差商表,再插值
notion image
牛顿差商公式:
f[xi,xj] =( f(xj) – f(xi) )/( xj – xi )
f[xi,xj,xk] = (f[xj,xk] – f[xi,xj])/(xk – xi)
… >f[x0,x1,x2 … ,xn] = (f[x1,x2, … ,xn] – f[x0,x1, … ,xn-1])/(xn – x0)

分段线性插值

notion image
notion image

三次Hermite插值

notion image
notion image
notion image

三次样条插值

三弯矩构造方法

notion image
notion image
### 固支边界条件
notion image
notion image

周期边界条件

notion image
 

Loading...