Shingrace的个人博客分享 http://blog.sciencenet.cn/u/Shingrace

博文

python-符号运算(求导等)

已有 10537 次阅读 2016-12-15 17:29 |个人分类:python|系统分类:科研笔记| 求导, sympy


cmd 命令下 pip install sympy


#求导

from sympy import *

y = Symbol('x')

diff(y**2,y)

#2*x


diff(f, *symbols, **kwargs)

   Differentiate f with respect to symbols.

   

   This is just a wrapper to unify .diff() and the Derivative class; its

   interface is similar to that of integrate().  You can use the same

   shortcuts for multiple variables as with Derivative.  For example,

   diff(f(x), x, x, x) and diff(f(x), x, 3) both return the third derivative

   of f(x).






https://wap.sciencenet.cn/blog-669638-1020954.html

上一篇:python 统计方法-分布检验
下一篇:python-拟合(一元线性)
收藏 IP: 159.226.234.*| 热度|

0

该博文允许注册用户评论 请点击登录 评论 (0 个评论)

数据加载中...

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-11-1 07:30

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部