【问题标题】:How to integrate a function of r that contains the first derivative of r in python?如何在python中集成包含r的一阶导数的r函数?
【发布时间】:2019-01-13 12:47:44
【问题描述】:

我必须对包含该变量的导数的变量进行函数积分。

我正在使用 jupyter,这是我的代码:

from sympy import *
m, p, g, a, t=symbols('m, p, g, a, t')
r=Function('r')
integrate((r*(p**2/(m**2*r**4)-2*a*g)-r(t).diff(t)**2*4*a**2*r)/(1+4*a**2*r**2),r)

r(t).diff(t) 是我尝试编写\dot{r} 的笨拙方式。

我收到以下错误:

TypeError:** 或 pow() 不支持的操作数类型:'UndefinedFunction' 和 'int'

任何帮助将不胜感激。

【问题讨论】:

    标签: python python-3.x jupyter-notebook sympy calculus


    【解决方案1】:

    您需要使用r(t) 而不是r。请尝试以下操作:integrate((r(t)*(p**2/(m**2*r(t)**4)-2*a*g)-r(t).diff(t)**2*4*a**2*r(t))/(1+4*a**2*r(t)**2), r(t))

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-06-27
      • 2020-10-10
      • 1970-01-01
      • 2017-06-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多