求解二维运动微分方程

发布于 2024-09-28 02:18:58 字数 493 浏览 1 评论 0原文

我正在尝试解决一个非常简单的问题,即在力 {k1+k2 * y, k3*t} 下查找物体位置。这是我在 Mathematica 7 中输入的内容:

DSolve[{
  x''[t]*m == k1 + k2*y[t],
  y''[t]*m == k3*t,
  y'[0] == 0,
  y[0] == 0,
  x'[0] == 0,
  x[0] == 0
}, {x[t], y[t]}, t]

我收到此错误:

DSolve::deqn: Equation or list ofequations Expected instead of True in the first argument {-C m (x^[Prime])[t ]^2==k1+k2 y[t],m (y^[素数][素数])[t]==k3 t,真,y[0]==0,真,x[0]== 0}.

Mathematica 似乎对边界条件 x'[0] == 0 不满意。为什么呢?

I'm trying to solve a really simple problem of finding object position under force {k1+k2 * y, k3*t}. Here's what I'm entering into Mathematica 7:

DSolve[{
  x''[t]*m == k1 + k2*y[t],
  y''[t]*m == k3*t,
  y'[0] == 0,
  y[0] == 0,
  x'[0] == 0,
  x[0] == 0
}, {x[t], y[t]}, t]

and I get this error:

DSolve::deqn: Equation or list of equations expected instead of True in the first argument {-C m (x^[Prime])[t]^2==k1+k2 y[t],m (y^[Prime][Prime])[t]==k3 t,True,y[0]==0,True,x[0]==0}.

It seems that Mathematica is unhappy about boundary conditions x'[0] == 0. Why is that?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

一影成城 2024-10-05 02:18:58

它在您输入时起作用...尝试在新笔记本中执行此操作

alt text

It worked as you typed it ... try to do it in a fresh notebook

alt text

苏璃陌 2024-10-05 02:18:58

当我剪切并粘贴您发布到 M'ma 7.0.1 的代码并进行评估时,我得到了结果

{{x[t] -> (60*k1*m*t^2 + k2*k3*t^5)/(120*m^2), 
     y[t] -> (k3*t^3)/(6*m)}}

Your M'ma 错误消息告诉我您实际上在 x 上只有一个素数(即 x'[t ]) 在您实际的 M'ma 输入中。它引用的方程 -C m (x^[Prime])[t]^2==k1+k2 y[t] 与上面代码的第一行不匹配。

怀疑 x'[0] 和 y'[0] 之前已被赋值为零,这导致 x'[0]==0, ..., y' [0]==0 都折叠为 True。最好的测试方法:杀死你的内核并重新评估上面的输入(修复拼写错误后)。

When I cut and paste the code you've posted into M'ma 7.0.1 and evaluate, I get the result

{{x[t] -> (60*k1*m*t^2 + k2*k3*t^5)/(120*m^2), 
     y[t] -> (k3*t^3)/(6*m)}}

Your M'ma error message tells me you actually have only one prime on x (i.e. x'[t]) in your actual M'ma input. The equation it cites, -C m (x^[Prime])[t]^2==k1+k2 y[t], does not match the first line of your code above.

I also suspect that x'[0] and y'[0] have been assigned to zero previously, which is causing x'[0]==0, ..., y'[0]==0 to both collapse to True. Best way to test: kill your kernel and re-evaluate the input above (after fixing typos).

烟织青萝梦 2024-10-05 02:18:58

贝利撒留和埃里克·塔尔斯都建议终止内核并重新评估。他们很可能是正确的,因为某些东西有预先的定义。您可以通过检查这是否属实。

?<variable name>

作为终止内核的替代方法,我建议通过清除它们的值

Clear[x, y, k1, k2, k3, m]

,或者,如果您确实想删除变量的任何定义,请使用Remove。这样,您就不必重新计算当前会话中的任何其他内容。

Both, belisarius and Eric Towers have suggested killing the kernel and re-evaluating. They're most likely correct in that something has a prior definition. You can check if that is true via

?<variable name>

As an alternative to killing the kernel, I'd suggest clearing their values via

Clear[x, y, k1, k2, k3, m]

Or, if you really want to rid yourself of any definition of a variable there's Remove. This way, you won't have to recalculate anything else from your current session.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文