上一页 1 ··· 5 6 7 8 9 10 下一页
  2024年10月14日
摘要: 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-10-14 23:41 VVV1 阅读(9) 评论(0) 推荐(0)
摘要: total_demand = sum(demands) dp = np.full((4, total_demand + 1), float('inf')) dp[0][0] = 0 prev_production = np.full((4, total_demand + 1), -1) for i 阅读全文
posted @ 2024-10-14 23:37 VVV1 阅读(14) 评论(0) 推荐(0)
摘要: import numpy as np from scipy.optimize import minimize def objective(x): return 2x[0] + 3x[0]2 + 3*x[1] + x[1]2 + x[2] def constraint1(x): return 10 - 阅读全文
posted @ 2024-10-14 23:35 VVV1 阅读(15) 评论(0) 推荐(0)
摘要: import numpy as np from scipy.optimize import minimize def objective(x): return -np.sum(np.sqrt(x) * np.arange(1, 101)) def constraint1(x): return x[1 阅读全文
posted @ 2024-10-14 23:33 VVV1 阅读(14) 评论(0) 推荐(0)
摘要: `MAX_B = 24 MAX_DEBUG = 5 products = [ {"name": "Ⅰ", "A_hours": 1, "B_hours": 6, "debug_hours": 1, "profit": 2}, # 假设产品Ⅰ至少使用1小时设备A {"name": "Ⅱ", "A_ho 阅读全文
posted @ 2024-10-14 23:28 VVV1 阅读(11) 评论(0) 推荐(0)
摘要: import numpy as np from scipy.sparse.linalg import eigs import pylab as plt w = np.array([[0, 1, 0, 1, 1, 1], [0, 0, 0, 1, 1, 1], [1, 1, 0, 1, 0, 0], 阅读全文
posted @ 2024-10-14 23:03 VVV1 阅读(18) 评论(0) 推荐(0)
摘要: def X(n): # 差分方程的解 return 2 * (-1)**(n + 1) n_values = [0, 1, 2, 3, 4, 5] for n in n_values: print(f"X({n}) = {X(n)}") print("学号:202331014 3005") 阅读全文
posted @ 2024-10-14 23:01 VVV1 阅读(12) 评论(0) 推荐(0)
摘要: import numpy as np def f(x): return (abs(x + 1) - abs(x - 1)) / 2 + np.sin(x) def g(x): return (abs(x + 3) - abs(x - 3)) / 2 + np.cos(x) 假设我们有一些初始猜测值( 阅读全文
posted @ 2024-10-14 22:39 VVV1 阅读(28) 评论(0) 推荐(0)
摘要: import numpy as np from scipy.linalg import eig 定义矩阵 A = np.array([[-1, 1, 0], [-4, 3, 0], [1, 0, 2]]) 计算特征值和特征向量 eigenvalues, eigenvectors = eig(A) 打 阅读全文
posted @ 2024-10-14 22:38 VVV1 阅读(15) 评论(0) 推荐(0)
摘要: import numpy as np def f(x): return (abs(x + 1) - abs(x - 1)) / 2 + np.sin(x) def g(x): return (abs(x + 3) - abs(x - 3)) / 2 + np.cos(x) from scipy.op 阅读全文
posted @ 2024-10-14 22:38 VVV1 阅读(27) 评论(0) 推荐(0)
上一页 1 ··· 5 6 7 8 9 10 下一页