2.2

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(0, 10, 100) # x 的范围
y = [quad(fun, 0, np.inf, args=i)[0] for i in x] # 计算积分

plt.plot(x, y)
plt.xlabel('x')

2023310143007

posted @ 2024-11-18 17:55  2839663913  阅读(41)  评论(0)    收藏  举报