質問編集履歴
3
追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -219,3 +219,91 @@
|
|
219
219
|
ValueError: setting an array element with a sequence.
|
220
220
|
|
221
221
|
```
|
222
|
+
|
223
|
+
|
224
|
+
|
225
|
+
```python
|
226
|
+
|
227
|
+
from scipy.special import kv
|
228
|
+
|
229
|
+
import matplotlib.pyplot as plt
|
230
|
+
|
231
|
+
from scipy.integrate import quad
|
232
|
+
|
233
|
+
import numpy as np
|
234
|
+
|
235
|
+
import math
|
236
|
+
|
237
|
+
from math import gamma
|
238
|
+
|
239
|
+
|
240
|
+
|
241
|
+
xs = np.linspace(0, 50, 10000)
|
242
|
+
|
243
|
+
f = lambda z: kv(5/3,z)
|
244
|
+
|
245
|
+
F = [quad(f,x,np.inf)[0]*x for x in xs]
|
246
|
+
|
247
|
+
|
248
|
+
|
249
|
+
a = gamma(1/3)
|
250
|
+
|
251
|
+
G = [(4*math.pi/np.sqrt(3)/a)*(x/2)**(1/3) for x in xs]
|
252
|
+
|
253
|
+
H = [((math.pi/2)**(1/2))*(x**(1/2))*(math.exp(-x))for x in xs]
|
254
|
+
|
255
|
+
|
256
|
+
|
257
|
+
|
258
|
+
|
259
|
+
def A(x):
|
260
|
+
|
261
|
+
if x <= 5.0*1e-3:
|
262
|
+
|
263
|
+
return (4*math.pi/np.sqrt(3)/a)*(x/2)**(1/3)
|
264
|
+
|
265
|
+
elif 5.0*1-3 < x < 30:
|
266
|
+
|
267
|
+
return quad(f,x,np.inf)[0]*x
|
268
|
+
|
269
|
+
elif 30 <= x:
|
270
|
+
|
271
|
+
return ((math.pi/2)**(1/2))*(x**(1/2))*(math.exp(-x))
|
272
|
+
|
273
|
+
|
274
|
+
|
275
|
+
y = [A(i) for i in xs]
|
276
|
+
|
277
|
+
|
278
|
+
|
279
|
+
fig = plt.figure()
|
280
|
+
|
281
|
+
ax = fig.add_subplot(1,1,1)
|
282
|
+
|
283
|
+
ax.grid()
|
284
|
+
|
285
|
+
ax.plot(xs,y)
|
286
|
+
|
287
|
+
ax.set_xlim(1e-3, 5*1e1)
|
288
|
+
|
289
|
+
ax.set_ylim(1e-3, 1e0)
|
290
|
+
|
291
|
+
ax.set_yscale('log')
|
292
|
+
|
293
|
+
ax.set_xscale('log')
|
294
|
+
|
295
|
+
ax.set_title('log')
|
296
|
+
|
297
|
+
ax.set_xlabel('x')
|
298
|
+
|
299
|
+
ax.set_ylabel('')
|
300
|
+
|
301
|
+
plt.show()
|
302
|
+
|
303
|
+
```
|
304
|
+
|
305
|
+
|
306
|
+
|
307
|
+
のようにすると、![イメージ説明](d14ad5eb682a4ad8ec9ae9910c68f90f.png)
|
308
|
+
|
309
|
+
途中できれたものが出てくる
|
2
誤字
test
CHANGED
File without changes
|
test
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
条件によって変化するF(x)を
|
1
|
+
条件によって変化するF(x)をプロットしたいがエラーが出てしまう。
|
2
2
|
|
3
3
|
|
4
4
|
|
1
誤字修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
|
4
4
|
|
5
|
-
![イメージ説明](
|
5
|
+
![イメージ説明](83c159d3d0a407b91119b5e3a98b1a08.png)
|
6
6
|
|
7
7
|
|
8
8
|
|