python求方程解析解和数值解

解一元方程:

1
2
3
from sympy import *
x, a, b, c = symbols('x a b c')
solve(a * x**2 + b * x + c, x)

解多元方程:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from sympy import *
x, y, z = symbols('x y z')
solve([y + x - 1, 3 * x + 2 * y - 5], [x, y])
limit(sin(x) / x, x, 0)
simplify(sin(x)**2 + cos(x)**2)
expand((x + 1)**2)
factor(x**2 + 2*x + 1)
collect(x*y + x - 3 + 2*x**2 - z*x**2 + x**3, x)
trigsimp(cosh(x)**2 + sinh(x)**2)
expand_trig(sin(x + y)) 
 
x, y = symbols('x y', positive=True)
n = symbols('n', real=True)
expand_log(log(x*y))
logcombine(n*log(x))
 
E**(I*pi)+1
expand(exp(I*x), complex=True)
 
tmp = series(exp(I*x), x, 0, 10)
pprint(tmp)
re(tmp)
series(sinh(x), x, 0, 10)
 
integrate(x*sin(x), x)
integrate(x*sin(x), (x, 0, 2*pi))
diff(x**2)
 
r = symbols('r', positive=True)
circle_area = 2 * integrate(sqrt(r**2-x**2), (x, -r, r))
circle_area.subs(r, x)

求数值解

1
2
3
s = solve(a * x**2 + b * x + c, x)
val = s.evalf(subs = {a:1, b:2, c:1})
print(str(val))

Fourier,

from sympy import *
from sympy.abc import x
s = fourier_series(x**2, (x, -pi, pi))
s.truncate(4)

refer to:
https://blog.csdn.net/shuangguo121/article/details/86611948
https://www.cnblogs.com/coshaho/p/9653460.html
https://baike.baidu.com/item/%E5%8F%8C%E6%9B%B2%E5%87%BD%E6%95%B0/8704306?fr=aladdin
https://www.cnblogs.com/FrostyForest/p/16660154.html

如何生成后缀名为264的文件

方法一:

ffmpeg.exe -i E:\video\8998.mp3 aa.264

方法二(推荐):

安装MediaCoder软件,运行后,在“容器”设置中,选择Raw Stream,再转换视频,就会生成后缀名为264的文件。

Source Insight Memo

Options -> Preferences -> Display -> Trim long path names with ellipses

Options -> File Type Options -> Auto Indenting -> Auto Indent Type

手机听VOA美国之音的方法

在网上找相应的APP找了很久,现在都没APP可直接听美国之音的了,是版权问题?

其实只要知道传输原理,就可很方便地用手机听到美国之音了。

再播放这个地址:VOA

先下个能播放网络音频流的APP,比如VLC,到http://www.videolan.org/有下,有安卓版的。
VideoLan不能播放,可以媒体协议变了。

现在测得只能电脑chrome中点击链接播放,安卓类chrome浏览器中点击都不能播放。