转换 dsolve 输出以求解 sympy 中的值
我
import sympy as sm
x = sm.symbols('x', cls=sm.Function)
t = sm.symbols('t')
expr = x(t).diff(t) + 0.05*x(t)
sol = sm.dsolve(expr,x(t), ics = {x(0):25})
现在有了关系平等的解决方案。现在我想求解 t 得到 x = 1。我做不到 s = sm.Eq(x,-1)
执行 sm.solve(s,t)
,因为 s
返回 False< /代码>
I have
import sympy as sm
x = sm.symbols('x', cls=sm.Function)
t = sm.symbols('t')
expr = x(t).diff(t) + 0.05*x(t)
sol = sm.dsolve(expr,x(t), ics = {x(0):25})
Now i have the solution as an relational equality. Now i want to solve t for x = 1. I can't dos = sm.Eq(x,-1)
to do sm.solve(s,t)
as s
returns False
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
想通了。这很简单。 x.rhs 可用于创建方程以求解 t。
给出结果 t ~ 64.38
figured it out. It's simply easy. x.rhs can be used to create an equation to use solve for t.
gives the result t ~ 64.38