LoginSignup
1
0

More than 5 years have passed since last update.

sympyで「積分(integrate)」をやってみた

Posted at

(参考)台形則(数値積分)
https://qiita.com/omu58n/items/55699bd127ed74d6b73f

fullscript.py
from sympy import *
var("x a b s")
f=(1-x**2)**(1/2)
a=0
b=1
s=integrate(f, (x, a, b))
print('s   =',s)
print('s   =',simplify(s))
print('s   =',0.443113462726379*sqrt(float(pi)))
print('pi/4=',float(pi/4))
# s   = 1.0*hyper((-0.5, 1/2), (3/2,), exp_polar(2*I*pi))
# s   = 0.443113462726379*sqrt(pi)
# s   = 0.785398163397448
# pi/4= 0.7853981633974483

hyperの日本語版を見つけた。
(参考)チュートリアルを読む>これは知らん。
https://showa-yojyo.github.io/notebook/python-sympy/tutorial.html
exp_polarの日本語版を見つけた。
(参考)常微分方程式
https://showa-yojyo.github.io/notebook/python-sympy/ode.html

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0