본문 바로가기
Python/Python Examples

[Python Examples] 효소 활성화 반응 (Enzyme-activated Reaction): matplotlib, for loop, array

by Henry Cho 2023. 9. 15.
728x90

효소 활성화 반응 (Enzyme-activated Reaction): matplotlib, for loop, array

포스트 난이도: HOO_Junior


# Example codes

이번 예제코드는 효소 활성화 반응을 산출하는 파이썬 코드이다. Matplotlib, for loop, array을 사용하고 있기에 해당 functions들에 대한 복습을 하는데 괜찮은 코드이다. for loop과 array를 통해서 시간대별 변화하는 효소 반응을 산출하고 있으며, 산출된 결과값들을 기반으로 배열에 저장된 데이터를 그래프로 표현할 때에 matplotlib을 사용하고 있는 걸 확인할 수 있다.

# v= Vmax[s]/Km+[s]
#[s]=0 to 80
#Km=10
#Vmax=0.10^(-1)
#ear is a enzyme-activated reaction

import matplotlib.pyplot as plt
v_max=10
km=10
s_values = []
ear_values = []
s = 0

for x in range(81):

    ear = (v_max*s)/(km+s)
    print(f"s={s}, ear={ear}")
    s_values.append(s)
    ear_values.append(ear)
    s = s + 1
print ("Finished! Coded by Younghoo")

plt.plot(s_values, ear_values)
plt.xlabel('Time (minutes)')
plt.ylabel('Enzyme-activated Reaction')
plt.title('Enzyme-activated Reaction Over Time')
plt.grid(True)
plt.show()

s=0, ear=0.0
s=1, ear=0.9090909090909091
s=2, ear=1.6666666666666667
s=3, ear=2.3076923076923075
s=4, ear=2.857142857142857
s=5, ear=3.3333333333333335
s=6, ear=3.75
s=7, ear=4.117647058823529
s=8, ear=4.444444444444445
s=9, ear=4.7368421052631575
s=10, ear=5.0
s=11, ear=5.238095238095238
s=12, ear=5.454545454545454
s=13, ear=5.6521739130434785
s=14, ear=5.833333333333333
s=15, ear=6.0
s=16, ear=6.153846153846154
s=17, ear=6.296296296296297
s=18, ear=6.428571428571429
s=19, ear=6.551724137931035
s=20, ear=6.666666666666667
s=21, ear=6.774193548387097
s=22, ear=6.875
s=23, ear=6.96969696969697
s=24, ear=7.0588235294117645
s=25, ear=7.142857142857143
s=26, ear=7.222222222222222
s=27, ear=7.297297297297297
s=28, ear=7.368421052631579
s=29, ear=7.435897435897436
s=30, ear=7.5
s=31, ear=7.560975609756097
s=32, ear=7.619047619047619
s=33, ear=7.674418604651163
s=34, ear=7.7272727272727275
s=35, ear=7.777777777777778
s=36, ear=7.826086956521739
s=37, ear=7.872340425531915
s=38, ear=7.916666666666667
s=39, ear=7.959183673469388
s=40, ear=8.0
s=41, ear=8.03921568627451
s=42, ear=8.076923076923077
s=43, ear=8.11320754716981
s=44, ear=8.148148148148149
s=45, ear=8.181818181818182
s=46, ear=8.214285714285714
s=47, ear=8.24561403508772
s=48, ear=8.275862068965518
s=49, ear=8.305084745762711
s=50, ear=8.333333333333334
s=51, ear=8.360655737704919
s=52, ear=8.387096774193548
s=53, ear=8.412698412698413
s=54, ear=8.4375
s=55, ear=8.461538461538462
s=56, ear=8.484848484848484
s=57, ear=8.507462686567164
s=58, ear=8.529411764705882
s=59, ear=8.55072463768116
s=60, ear=8.571428571428571
s=61, ear=8.591549295774648
s=62, ear=8.61111111111111
s=63, ear=8.63013698630137
s=64, ear=8.64864864864865
s=65, ear=8.666666666666666
s=66, ear=8.68421052631579
s=67, ear=8.7012987012987
s=68, ear=8.717948717948717
s=69, ear=8.734177215189874
s=70, ear=8.75
s=71, ear=8.765432098765432
s=72, ear=8.78048780487805
s=73, ear=8.795180722891565
s=74, ear=8.80952380952381
s=75, ear=8.823529411764707
s=76, ear=8.837209302325581
s=77, ear=8.850574712643677
s=78, ear=8.863636363636363
s=79, ear=8.876404494382022
s=80, ear=8.88888888888889
Finished! Coded by HOO.


# github link

https://github.com/WhoisHOO/HOOAI/blob/main/Python%20Examples/enzyme-activated%20reaction


 

728x90

댓글