摘要:
import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D 模拟高程数据(假设数据已经过某种方式插值或生成) 这里我们创建一个简单的40x50网格,并填充随机高程值 x = np 阅读全文
posted @ 2024-11-18 17:57
2839663913
阅读(19)
评论(0)
推荐(0)
摘要:
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)) 遍 阅读全文
posted @ 2024-11-18 17:56
2839663913
阅读(47)
评论(0)
推荐(0)
摘要:
import numpy as np import matplotlib.pyplot as plt 定义x的范围 x = np.linspace(-10, 10, 400) 创建一个图形和坐标轴 plt.figure(figsize=(10, 6)) ax = plt.gca() 循环绘制每条曲线 阅读全文
posted @ 2024-11-18 17:56
2839663913
阅读(22)
评论(0)
推荐(0)
摘要:
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( 阅读全文
posted @ 2024-11-18 17:55
2839663913
阅读(44)
评论(0)
推荐(0)
摘要:
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 = 阅读全文
posted @ 2024-11-18 17:54
2839663913
阅读(27)
评论(0)
推荐(0)
摘要:
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, 阅读全文
posted @ 2024-11-18 17:50
2839663913
阅读(12)
评论(0)
推荐(0)
摘要:
import numpy as np import pandas as pd import matplotlib.pyplot as plt from scipy.interpolate import interp1d, PchipInterpolator, CubicSpline from sci 阅读全文
posted @ 2024-11-18 17:49
2839663913
阅读(38)
评论(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 - x 阅读全文
posted @ 2024-11-18 17:48
2839663913
阅读(38)
评论(0)
推荐(0)
摘要:
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 阅读全文
posted @ 2024-11-18 17:47
2839663913
阅读(32)
评论(0)
推荐(0)
摘要:
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 阅读全文
posted @ 2024-11-18 17:46
2839663913
阅读(32)
评论(0)
推荐(0)
摘要:
edges = [ ("Pe", "T", 13), ("Pe", "N", 68), ("Pe", "M", 78), ("Pe", "L", 51), ("Pe", "Pa", 51), ("T", "N", 68), ("T", "M", 70), ("T", "L", 6 阅读全文
posted @ 2024-11-18 17:45
2839663913
阅读(32)
评论(0)
推荐(0)
摘要:
import heapq def prim(graph, start): num_nodes = len(graph) visited = [False] * num_nodes min_heap = [(0, start, -1)] mst_cost = 0 mst_edges = [] whil 阅读全文
posted @ 2024-11-18 17:44
2839663913
阅读(47)
评论(0)
推荐(0)
摘要:
initial_costs = [2.5, 2.6, 2.8, 3.1] salvage_values = [2.0, 1.6, 1.3, 1.1] maintenance_costs = [0.3, 0.8, 1.5, 2.0] dp = [[float('inf')] * 2 for _ in 阅读全文
posted @ 2024-11-18 17:43
2839663913
阅读(11)
评论(0)
推荐(0)
摘要:
from scipy.integrate import odeint import numpy as np import pylab as plt mu = 1/82.45; lamda= 1-mu dz = lambda z, t: [z[1], 2z[3]+z[0]-lamda(z[0]+mu) 阅读全文
posted @ 2024-11-18 17:28
2839663913
阅读(12)
评论(0)
推荐(0)
摘要:
from scipy.integrate import odeint import numpy as np import pylab as plt yx = lambda y,x: [y[1], np.sqrt(1+y[1]**2)/5/(1-x)] x0 = np.arange(0, 1, 0.0 阅读全文
posted @ 2024-11-18 17:28
2839663913
阅读(19)
评论(0)
推荐(0)
摘要:
import numpy as np from scipy.interpolate import interp1d, interp2d, UnivariateSpline, griddata import matplotlib.pyplot as plt np.random.seed(114514) 阅读全文
posted @ 2024-11-18 17:27
2839663913
阅读(14)
评论(0)
推荐(0)
摘要:
from scipy.integrate import odeint import numpy as np import pylab as plt np.random.seed(2) #为了进行一致性比较,每次运行取相同随机数 sigma=10; rho=28; beta=8/3; g=lambda 阅读全文
posted @ 2024-11-18 17:26
2839663913
阅读(29)
评论(0)
推荐(0)
摘要:
import numpy as np import pandas as pd import sympy as sp sp.init_printing(use_latex=True) from scipy.integrate import odeint import matplotlib.pyplot 阅读全文
posted @ 2024-11-18 17:25
2839663913
阅读(23)
评论(0)
推荐(0)
摘要:
import numpy as np from scipy.interpolate import interp1d, interp2d, UnivariateSpline, griddata import matplotlib.pyplot as plt t0 = np.linspace(700, 阅读全文
posted @ 2024-11-18 17:24
2839663913
阅读(19)
评论(0)
推荐(0)
浙公网安备 33010602011771号