111
This commit is contained in:
6
120-3.py
6
120-3.py
@@ -1,4 +1,4 @@
|
||||
|
||||
#把范围与原函数换成题干的############
|
||||
x1, x2 = 3, 6
|
||||
|
||||
def fx(x):
|
||||
@@ -25,8 +25,8 @@ def CompositeNewtonCotes(n, type):
|
||||
|
||||
if __name__ == "__main__":
|
||||
# 复合梯形公式,点数为n+1
|
||||
print("复合梯形公式\n", CompositeNewtonCotes(8, 1)) #8等分,1代表是梯形公式
|
||||
print("复合梯形公式\n", CompositeNewtonCotes(8, 1)) #8等分,1代表是梯形公式####################
|
||||
# 复合辛普生公式,点数为2n+1
|
||||
print("复合辛普生公式\n", CompositeNewtonCotes(4, 2)) #4等分,2代表是辛普生公式
|
||||
print("复合辛普生公式\n", CompositeNewtonCotes(4, 2)) #4等分,2代表是辛普生公式###############
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user