这是一个创建于 2250 天前的主题,其中的信息可能已经有所发展或是发生改变。
from sympy import *
x=Symbol('x')
y=x**2
dx=diff(y,x)
上面这段程序求出了 y 关于 x 的导数:dx=2*x
如何求 x=2 时,导数的值 dx=2*2=4 呢?
这个要怎么代入呢?我的意思如何通过程序做。
|
|
1
metaquant 2018-08-13 11:02:12 +08:00
from sympy import * dx=2*x u = lambdify(x,dx) print(u(2))
|