数学建模例题7.3
摘要:`import numpy as np import pylab as plt from scipy.interpolate import lagrange yx = lambda x: 1/(1+x**2) def fun(n): x = np.linspace(-5, 5, n+1) p = l
阅读全文
posted @
2024-10-29 14:44
VVV1
阅读(42)
推荐(0)
数学建模例题7.4
摘要:`import numpy as np from scipy.interpolate import interp1d from scipy.interpolate import lagrange import pylab as plt a = np.loadtxt('data7_4.txt') x0
阅读全文
posted @
2024-10-29 14:46
VVV1
阅读(38)
推荐(0)
数学建模习题7.1
摘要:`import numpy as np import scipy.interpolate as spi import scipy.integrate as spi_integrate 定义函数 g(x) def g(x): return ((3x**2 + 4x + 6) * np.sin(x))
阅读全文
posted @
2024-11-17 13:16
VVV1
阅读(43)
推荐(0)
数学建模习题7.3
摘要:`import numpy as np import matplotlib.pyplot as plt from scipy.interpolate import interp1d, CubicSpline 已知的温度和对应的体积 T_known = np.array([700, 720, 740,
阅读全文
posted @
2024-11-17 13:32
VVV1
阅读(64)
推荐(0)
数学建模习题7.4
摘要:`import numpy as np import matplotlib.pyplot as plt from scipy.interpolate import griddata def f(x, y): x2 = x2 return (x2 - 2*x) * np.exp(-x2 - y2 -
阅读全文
posted @
2024-11-17 14:41
VVV1
阅读(29)
推荐(0)
数学建模习题7.7
摘要:`import numpy as np import matplotlib.pyplot as plt from scipy.optimize import curve_fit, leastsq, least_squares 定义函数 g(x, a, b) def g(x, a, b): retur
阅读全文
posted @
2024-11-17 14:49
VVV1
阅读(36)
推荐(0)
数学建模习题7.10
摘要:`import numpy as np import pandas as pd import matplotlib.pyplot as plt from scipy.interpolate import interp1d, PchipInterpolator, CubicSpline from sc
阅读全文
posted @
2024-11-17 14:57
VVV1
阅读(35)
推荐(0)