2024年11月17日
摘要: `import numpy as np import matplotlib.pyplot as plt from scipy.integrate import solve_ivp 定义微分方程模型 def model(t, y): f, df_dm, d2f_dm2, T, dT_dm = y d3 阅读全文
posted @ 2024-11-17 15:08 VVV1 阅读(1) 评论(0) 推荐(0) 编辑
摘要: `import numpy as np import matplotlib.pyplot as plt from scipy.integrate import solve_ivp 定义微分方程系统 def system(t, state): x, y = state dxdt = -x - y dy 阅读全文
posted @ 2024-11-17 15:03 VVV1 阅读(4) 评论(0) 推荐(0) 编辑
摘要: `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 阅读(2) 评论(0) 推荐(0) 编辑
摘要: `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 阅读(1) 评论(0) 推荐(0) 编辑
摘要: `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 阅读(2) 评论(0) 推荐(0) 编辑
摘要: `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 阅读(3) 评论(0) 推荐(0) 编辑
摘要: `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 阅读(3) 评论(0) 推荐(0) 编辑
  2024年10月29日
摘要: `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 阅读(3) 评论(0) 推荐(0) 编辑
摘要: `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 阅读(2) 评论(0) 推荐(0) 编辑
  2024年10月28日
摘要: `import pylab as plt import numpy as np ax=plt.axes(projection='3d') X = np.arange(-6, 6, 0.25) Y = np.arange(-6, 6, 0.25) X, Y = np.meshgrid(X, Y) Z 阅读全文
posted @ 2024-10-28 12:22 VVV1 阅读(1) 评论(0) 推荐(0) 编辑