摘要: import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D 定义参数u和v u = np.linspace(-2, 2, 400) v = np.linspace(0, 2 * 阅读全文
posted @ 2024-10-27 21:04 唐锦珅 阅读(1) 评论(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-10-27 21:03 唐锦珅 阅读(1) 评论(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-10-27 21:02 唐锦珅 阅读(1) 评论(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-10-27 20:57 唐锦珅 阅读(1) 评论(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-10-27 20:55 唐锦珅 阅读(2) 评论(0) 推荐(0) 编辑
摘要: import numpy as np import pandas as pd import sympy as sp sp.init_printing(use_unicode=True) import matplotlib.pyplot as plt plt.rcParams['font.sans-s 阅读全文
posted @ 2024-10-15 13:31 唐锦珅 阅读(0) 评论(0) 推荐(0) 编辑
摘要: import numpy as np import pandas as pd import sympy as sp sp.init_printing(use_unicode=True) import matplotlib.pyplot as plt plt.rcParams['font.sans-s 阅读全文
posted @ 2024-10-15 13:29 唐锦珅 阅读(0) 评论(0) 推荐(0) 编辑
摘要: from scipy.optimize import linprog c=[0,0,3,2] A=[[-1,-1,0,0],[0,0,-1,-1],[3,0,2,0],[0,3,0,2],[100,90,80,70]] b=[[-30],[-30],[120],[48],[10000]] LB=[0 阅读全文
posted @ 2024-10-15 11:47 唐锦珅 阅读(0) 评论(0) 推荐(0) 编辑
摘要: import numpy as np import math from scipy.optimize import minimize, Bounds def func(x): return sum(math.sqrt(x[i]) for i in range(100)) def con(x): re 阅读全文
posted @ 2024-10-15 11:45 唐锦珅 阅读(0) 评论(0) 推荐(0) 编辑