当前位置:网站首页>多项式插值拟合(三)
多项式插值拟合(三)
2022-07-17 00:17:00 【HySmiley】
三阶多项式插值(立方插值):
fx=ax^3+bx^2+cx+d
interp1d(x,y,kind='cubic') 'cubic'立方插值
import numpy as np
from scipy.interpolate import interp1d,interp2d
import pylab as pl
x=np.array([1,2,3,4,5])
y=np.array([1,4,2,4,1]) #Y=x^3+x^2+x+1
fc=interp1d(x,y,kind='cubic')
xint=np.linspace(x.min(),x.max(),20)
print(xint)
print(fc(xint))
pl.scatter(xint,fc(xint),c='r',marker='o')
pl.plot(xint,fc(xint),color='blue',label='Cubic-10')
pl.show()
插值点:
xint [1. 1.21052632 1.42105263 1.63157895 1.84210526 2.05263158
2.26315789 2.47368421 2.68421053 2.89473684 3.10526316 3.31578947
3.52631579 3.73684211 3.94736842 4.15789474 4.36842105 4.57894737
4.78947368 5. ]
y: [1. 2.71628517 3.73859163 4.19288526 4.20513194 3.90129757
3.40734801 2.84924916 2.3529669 2.04446712 2.04446712 2.3529669
2.84924916 3.40734801 3.90129757 4.20513194 4.19288526 3.73859163
2.71628517 1. ]
边栏推荐
- Let's learn about awk~
- 10. System safety and Application
- Graduation thesis word skills Collection
- [solution] the local Group Policy Editor (gpedit.msc) in Win 11 cannot be opened
- Understand JVM garbage collection in one article
- 當你在Linux系統中編譯安裝MySQL數據庫卡住了怎麼辦?
- RHCE8学习指南 第7章 服务管理
- 第一篇博客------自我介绍
- Comprehensive experiment of static routing
- Rip comprehensive experiment
猜你喜欢
随机推荐
Rsync remote synchronization (incremental backup)
学习网络基础
HCIA summary
Lamp platform deployment and Application
mysqldump: [Warning] Using a password on the command line interface can be insecure.
DHCP principle and configuration
Redis' simple dynamic string SDS
Detailed explanation of dynamic compression and static compression of gzip
rsync—远程同步
Oracle获取最后一条,第一条数据(按时间获取第一条和最后一条数据)
yolov5 ncnn 推理
Mysql优化之索引
Firewall firewall
Brief introduction of Feature Engineering and its implementation of sklearn
【MySQL】数据查询操作(select语句)
Squid agent service deployment
MySQL存储引擎详解
时间复杂度和空间复杂度分析技巧
Win10 下OneDrive 失效重装
Rhce8 Study Guide Chapter 6 archiving and compression








![[solution] the local Group Policy Editor (gpedit.msc) in Win 11 cannot be opened](/img/8c/705d5f03ca12eef740957c7c80a9f7.png)
