摘要:
import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D 模拟高程数据(假设数据已经过某种方式插值或生成) 这里我们创建一个简单的40x50网格,并填充随机高程值 x = np 阅读全文
摘要:
import numpy as np import matplotlib.pyplot as plt 定义x的范围 x = np.linspace(-10, 10, 400) 创建一个2行3列的子图布局 fig, axs = plt.subplots(2, 3, figsize=(12, 8)) 遍 阅读全文
摘要:
import numpy as np import matplotlib.pyplot as plt 定义x的范围 x = np.linspace(-10, 10, 400) 创建一个图形和坐标轴 plt.figure(figsize=(10, 6)) ax = plt.gca() 循环绘制每条曲线 阅读全文
摘要:
import numpy as np import matplotlib.pyplot as plt from scipy.integrate import quad def fun(t, x): return np.exp(-t) * (t ** (x - 1)) x = np.linspace( 阅读全文
摘要:
import numpy as np import matplotlib.pyplot as plt 定义 x 的范围 x = np.linspace(-5, 5, 400) 计算三个函数的值 y_cosh = np.cosh(x) y_sinh = np.sinh(x) y_half_exp = 阅读全文
摘要:
import numpy as np import matplotlib.pyplot as plt from scipy.optimize import curve_fit, leastsq, least_squares from scipy.constants import e def g(x, 阅读全文
摘要:
import numpy as np import pandas as pd import matplotlib.pyplot as plt from scipy.interpolate import interp1d, PchipInterpolator, CubicSpline from sci 阅读全文
摘要:
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 - x 阅读全文
摘要:
import numpy as np import scipy.interpolate as spi import scipy.integrate as spi_integrate def g(x): return ((3x**2 + 4x + 6) * np.sin(x)) / (x**2 + 8 阅读全文
摘要:
import matplotlib.pyplot as plt import numpy as np import cvxpy as cp x=cp.Variable(6,pos=True) obj=cp.Minimize(x[5]) a1=np.array([0.025, 0.015, 0.055 阅读全文