fork download
  1. # your code goes here# 예제 2.6 0~90도, 1° 간격
  2. # 결과: CSV 표 +
  3. import math
  4.  
  5. T = 1.0 # 그래프
  6.  
  7. print("theta_deg,Mo_over_T_m")
  8. mot_max = -1.0; th_at_max = 0
  9.  
  10. for th in range(0, 91, 1): # 1° 간격
  11. r = math.radians(th)
  12. mot = 0.2*math.cos(r) / math.sqrt(0.41 - 0.4*math.sin(r)) # Mo/T (m)
  13. print(f"{th},{mot:.9f}")
  14. if mot > mot_max:
  15. mot_max = mot; th_at_max = th
  16.  
  17. print(f"\nMAX: theta={th_at_max} deg, Mo/T={mot_max:.9f} m")
  18.  
Success #stdin #stdout 0.08s 14312KB
stdin
Standard input is empty
stdout
theta_deg,Mo_over_T_m
0,0.312347524
1,0.314993118
2,0.317611134
3,0.320201215
4,0.322762996
5,0.325296106
6,0.327800165
7,0.330274784
8,0.332719568
9,0.335134109
10,0.337517988
11,0.339870778
12,0.342192034
13,0.344481302
14,0.346738110
15,0.348961972
16,0.351152381
17,0.353308814
18,0.355430726
19,0.357517549
20,0.359568691
21,0.361583532
22,0.363561424
23,0.365501685
24,0.367403601
25,0.369266417
26,0.371089338
27,0.372871523
28,0.374612081
29,0.376310066
30,0.377964473
31,0.379574230
32,0.381138192
33,0.382655137
34,0.384123753
35,0.385542631
36,0.386910257
37,0.388224997
38,0.389485087
39,0.390688618
40,0.391833520
41,0.392917543
42,0.393938239
43,0.394892937
44,0.395778717
45,0.396592384
46,0.397330430
47,0.397988997
48,0.398563835
49,0.399050253
50,0.399443059
51,0.399736499
52,0.399924176
53,0.399998972
54,0.399952941
55,0.399777200
56,0.399461792
57,0.398995534
58,0.398365838
59,0.397558503
60,0.396557474
61,0.395344559
62,0.393899103
63,0.392197606
64,0.390213275
65,0.387915511
66,0.385269309
67,0.382234560
68,0.378765265
69,0.374808617
70,0.370303984
71,0.365181776
72,0.359362214
73,0.352754047
74,0.345253288
75,0.336742090
76,0.327087953
77,0.316143566
78,0.303747696
79,0.289727709
80,0.273904449
81,0.256100342
82,0.236151570
83,0.213924916
84,0.189339222
85,0.162390191
86,0.133175556
87,0.101915741
88,0.068963832
89,0.034798973
90,0.000000000

MAX: theta=53 deg, Mo/T=0.399998972 m