python Romber求积

python Romber求积

import numpy as np # 被积因变量 def fun(x): f = pow(x, 1.5) return f # 求梯形值 def T2n(a, b, n, Tn): h = (b - a) / n # 步长 sum = 0. for k in range(n): sum += fun(a + (k + 0.5) * h)...