回答編集履歴

3

d

2020/01/09 09:30

投稿

tiitoi
tiitoi

スコア21956

test CHANGED
@@ -99,3 +99,47 @@
99
99
 
100
100
 
101
101
  ![イメージ説明](df41e272a1b1a6bc3b72d3d4f38cda06.png)
102
+
103
+
104
+
105
+ ## 追記
106
+
107
+
108
+
109
+ ```python
110
+
111
+ import matplotlib.pyplot as plt
112
+
113
+ import numpy as np
114
+
115
+ import math
116
+
117
+
118
+
119
+ fig, ax = plt.subplots(figsize=(12, 6))
120
+
121
+ params = [10 ** (-12), 10 ** (-11), 10 ** (-10), 10 ** (-9), 10 ** (-8)]
122
+
123
+
124
+
125
+ for f in params:
126
+
127
+ Mx = np.logspace(1, 10, 100, base=10)
128
+
129
+ t = (16 * np.pi * Mx) / (f ** 2 * np.sqrt(1 - 64 / Mx ** 2))
130
+
131
+ ax.scatter(Mx, t, label=f"f = {f}")
132
+
133
+
134
+
135
+ ax.set_xscale("log")
136
+
137
+ ax.set_yscale("log")
138
+
139
+ ax.legend()
140
+
141
+
142
+
143
+ plt.show()
144
+
145
+ ```

2

d

2020/01/09 09:30

投稿

tiitoi
tiitoi

スコア21956

test CHANGED
@@ -47,3 +47,55 @@
47
47
 
48
48
 
49
49
  ![イメージ説明](111d83b1492139fe98bcc572f71e92d6.png)
50
+
51
+
52
+
53
+ > また、この後Mxの値を 10e4 10e6 10e8 10e10
54
+
55
+ に変えた5つの散布図を作り同じグラフ上に表示させたいのですが、調べてもよくわからず合わせてご教授いただけませんでしょうか。
56
+
57
+
58
+
59
+ ```python
60
+
61
+ import matplotlib.pyplot as plt
62
+
63
+ import numpy as np
64
+
65
+ import math
66
+
67
+
68
+
69
+ fig, ax = plt.subplots(figsize=(12, 6))
70
+
71
+ params = [10e2, 10e4, 10e6, 10e8, 10e10]
72
+
73
+
74
+
75
+ for Mx in params:
76
+
77
+ f = np.logspace(-20, -1, 100, base=10)
78
+
79
+ t = (16 * math.pi * Mx) / (f ** 2 * math.sqrt(1 - 64 / Mx ** 2))
80
+
81
+
82
+
83
+ ax.scatter(f, t, label=f"Mx = {Mx:.0e}")
84
+
85
+ ax.set_xscale("log")
86
+
87
+ ax.set_yscale("log")
88
+
89
+ ax.set_xticks(np.logspace(-20, -1, 20, base=10))
90
+
91
+
92
+
93
+ ax.legend()
94
+
95
+ plt.show()
96
+
97
+ ```
98
+
99
+
100
+
101
+ ![イメージ説明](df41e272a1b1a6bc3b72d3d4f38cda06.png)

1

d

2020/01/09 08:36

投稿

tiitoi
tiitoi

スコア21956

test CHANGED
@@ -20,9 +20,9 @@
20
20
 
21
21
  Mx = 10 ** 2
22
22
 
23
- f = np.arange(10 ** (-20), 1,)
23
+ f = np.logspace(-20, -1, 100, base=10)
24
24
 
25
- t = (f ** 2 * math.sqrt(1 - 64 / Mx ** 2)) / (16 * math.pi * Mx)
25
+ t = (16 * math.pi * Mx)/(f ** 2 * math.sqrt(1 - 64 / Mx ** 2))
26
26
 
27
27
 
28
28