Python-sympy科学计算与数据处理(方程,微分,微分方程,积分)

方程

https://img2018.cnblogs.com/blog/1322499/201907/1322499-20190713144608421-340230861.png

 

 https://img2018.cnblogs.com/blog/1322499/201907/1322499-20190713144631831-856426723.png

a,b,c,x = symbols("a b c x")

my_eq = Eq(a*x**2+b*x+c,0)

solve(my_eq,x)

Out[12]: [(-b + sqrt(-4*a*c + b**2))/(2*a), -(b + sqrt(-4*a*c + b**2))/(2*a)]

https://img2018.cnblogs.com/blog/1322499/201907/1322499-20190713144834363-1012564963.png

 

微分

https://img2018.cnblogs.com/blog/1322499/201907/1322499-20190713145009457-1453354605.png

t=Derivative(sin(x),x) #t=sin(x)

print(t)

t.doit() #求导

Derivative(sin(x), x)

Out[13]: cos(x)

https://img2018.cnblogs.com/blog/1322499/201907/1322499-20190713145201641-927480833.png

diff(sin(2*x),x)

Out[18]: 2*cos(2*x)

 

sin(2*x).diff(x)

Out[19]: 2*cos(2*x)

 

diff(sin(2*x),x,2)  #2阶导

Out[20]: -4*sin(2*x)

 

diff(sin(2*x),x,3)   #3阶导

Out[21]: -8*cos(2*x)

https://img2018.cnblogs.com/blog/1322499/201907/1322499-20190713145501829-2053729630.png

https://img2018.cnblogs.com/blog/1322499/201907/1322499-20190713145543809-1230537275.png

diff(sin(x*y), x,2,y,3)

Out[22]: x*(x**2*y**2*cos(x*y) + 6*x*y*sin(x*y) - 6*cos(x*y))

 

微分方程

https://img2018.cnblogs.com/blog/1322499/201907/1322499-20190713145701156-1804129262.png

 https://img2018.cnblogs.com/blog/1322499/201907/1322499-20190713145719606-859776866.png

https://img2018.cnblogs.com/blog/1322499/201907/1322499-20190713145737031-1334113338.png

 

积分

https://img2018.cnblogs.com/blog/1322499/201907/1322499-20190713150503093-1839710978.png

https://img2018.cnblogs.com/blog/1322499/201907/1322499-20190713150525978-822387320.png

https://img2018.cnblogs.com/blog/1322499/201907/1322499-20190713150544310-454330389.png

https://img2018.cnblogs.com/blog/1322499/201907/1322499-20190713150621548-867848257.png

https://img2018.cnblogs.com/blog/1322499/201907/1322499-20190713150638852-679892926.png

 

 

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

蔡军帅

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值