我有一张图表,我需要获得它下面的区域。可能通过整合。但我没有这个函数的等式。我想知道如何获得它下面的区域,我该怎么做?
mass=[ 0.25877 0.26667 0.26667 0.27488 0.27488 0.28341 0.28341 0.29228
0.29228 0.30149 0.30149 0.31103 0.31103 0.32089 0.32089 0.33104
0.33104 0.34163 0.34163 0.35279 0.35279 0.36453 0.36453 0.37687
0.37687 0.38979 0.38979 0.40321 0.40321 0.41709 0.41709 0.43138
0.43138 0.44612 0.44612 0.46156 0.46156 0.47767 0.47767 0.49445
0.49445 0.51206 0.51206 0.53047 0.53047 0.54963 0.54963 0.56964
0.56964 0.59042 0.59042 0.61177 0.61177 0.63411 0.63411 0.65756
0.65756 0.68194 0.68194 0.70721 0.70721 0.7332 0.7332 0.75966
0.75966 0.78817 0.78817 0.81905 0.81905 0.85287 0.85287 0.88918
0.88918 0.92732 0.92732 0.96587 0.96587 1.0048 1.0048 1.0438
1.0438 1.0826 1.0826 1.1212 1.1212 1.1636 1.1636 1.2186
1.2186 1.2744 1.2744 1.3422 1.3422 1.3565 1.3565 1.3659
1.3659 1.3734 1.3734 1.3798 ]
Ni=[ 0.99628 0.99628 0.99628 0.99628 0.99628 0.99628 0.99628
0.99628 0.99628 0.99628 0.99628 0.99628 0.99628 0.99628
0.99628 0.99628 0.99628 0.99628 0.99628 0.99628 0.99628
0.99628 0.99628 0.99628 0.988156 0.988156 0.98628 0.98628
0.98628 0.98628 0.98628 0.98628 0.98628 0.98628 0.98628
0.98628 0.98628 0.98628 0.98628 0.98628 0.98628 0.98628
0.98628 0.98628 0.98628 0.98628 0.98628 0.98628 0.98628
0.98628 0.98628 0.98628 0.93918 0.93918 0.93628 0.93628
0.891223 0.891223 0.88228 0.88228 0.871528 0.871528 0.86728
0.86728 0.476344 0.476344 0.335726 0.335726 0.11728 0.11728
0.11728 0.11728 0.11728 0.11728 0.11728 0.11728 0.11728
0.11728 0.11728 0.11728 0.012725 0.012725 0. 0. 0.
0. 0. 0. 0. 0. 0. 0. 0.
0. 0. 0. 0. 0. 0. 0. ]
print mass
print Ni
plt.plot(mass,Ni)
答案 0 :(得分:1)
假设mass
和Ni
是列表,我可以建议scipy
模块集成:
import scipy.integrate as integ
由于您使用的功能是由步骤定义的,因此您不能使用Simpson集成算法。基本的梯形算法必须有效:
res = integ.trapz(Ni, mass)
我使用您的数据找到0.532721
。