欧拉公式Euler‘s formula

import matplotlib.pyplot as plt
import numpy as np
x=0
y=1
X=np.zeros(100)
Y=np.zeros(100)
h=0.1
for i in range(1,100):
    y=1.1*y-0.2*x/y
    x=x+h
    X[i]=x
    Y[i]=y
    print(x,y)

plt.plot(X,Y)
plt.scatter(X,Y)
plt.show()
0.1 1.1
0.2 1.191818181818182
0.30000000000000004 1.277437833714722
0.4 1.35821259956029
0.5 1.4351329186577972
0.6 1.5089662535663324
0.7 1.580338237655218
0.7999999999999999 1.6497834310477122
0.8999999999999999 1.717779347860088
0.9999999999999999 1.7847708324979834
1.0999999999999999 1.8511887110822296
1.2 1.917465025144291
1.3 1.984046272046332
1.4000000000000001 2.0514055684725467
1.5000000000000002 2.1200543441219546
1.6000000000000003 2.190553971934533
1.7000000000000004 2.2635275998130764
1.8000000000000005 2.339672339345207
1.9000000000000006 2.419771873967288
2.0000000000000004 2.504709464330856
2.1000000000000005 2.595481249764899
2.2000000000000006 2.6932096736597324
2.3000000000000007 2.7991568033689833
2.400000000000001 2.914737281245499
2.500000000000001 3.0415306441486285
2.600000000000001 3.181292795402083
2.700000000000001 3.335966513495211
2.800000000000001 3.507691036387956
2.9000000000000012 3.6988109593575618
3.0000000000000013 3.9118849066249957
3.1000000000000014 4.149694651664416
3.2000000000000015 4.415255533297773
3.3000000000000016 4.711829113820219
3.4000000000000017 5.042939033576937
3.5000000000000018 5.412390933993009
3.600000000000002 5.824297167194873
3.700000000000002 6.283106817950801
3.800000000000002 6.793641370604512
3.900000000000002 7.36113619361956
4.000000000000002 7.991287909888882
4.100000000000001 8.690307681027537
4.200000000000001 9.464980455133118
4.300000000000001 10.322730298367317
4.4 11.271692036022365
4.5 12.320789553742157
4.6 13.479821242455882
4.699999999999999 14.759553203479546
4.799999999999999 16.1718209590997
4.899999999999999 17.72964053779977
4.999999999999998 19.447329923268757
5.099999999999998 21.340641974831755
5.1999999999999975 23.42691004691238
5.299999999999997 25.725207659648923
5.399999999999997 28.256523704780307
5.4999999999999964 31.04395481310721
5.599999999999996 34.11291666469445
5.699999999999996 37.491376192797986
5.799999999999995 41.21010681943666
5.899999999999995 45.30296906669943
5.999999999999995 49.80721911541924
6.099999999999994 54.76384813397673
6.199999999999994 60.217955477080224
6.299999999999994 66.21915915995032
6.399999999999993 72.82204735019371
6.499999999999993 80.08667499082237
6.5999999999999925 88.07911007670793
6.699999999999992 96.87203455693935
6.799999999999992 106.54540533113622
6.8999999999999915 117.18718135323435
6.999999999999991 128.89412345653736
7.099999999999991 141.77267417434913
7.19999999999999 155.93992555725364
7.29999999999999 171.52468378767807
7.39999999999999 188.66864027201905
7.499999999999989 207.52765985831195
7.599999999999989 228.2731978919703
7.699999999999989 251.0938589931828
7.799999999999988 276.19711172777073
7.899999999999988 303.8111747603836
7.999999999999988 334.18709163772365
8.099999999999987 367.60101306420745
8.199999999999987 404.3567074186819
8.299999999999986 444.7883223356561
8.399999999999986 489.26342245685134
8.499999999999986 538.1863309694535
8.599999999999985 592.0018053091021
8.699999999999985 651.199080443467
8.799999999999985 716.3163164938686
8.899999999999984 787.9454911281639
8.999999999999984 866.7377812014655
9.099999999999984 953.4094825689436
9.199999999999983 1048.748521887409
9.299999999999983 1153.6216196040705
9.399999999999983 1268.982169250727
9.499999999999982 1395.878904673502
9.599999999999982 1535.4654339912613
9.699999999999982 1689.0107269552052
9.799999999999981 1857.9106510493766
9.89999999999998 2043.7006612058437

欧拉公式Euler‘s formula_第1张图片

你可能感兴趣的:(python,机器学习)