【问题标题】:Mathematica is unable to solve the system using coefficientsMathematica 无法使用系数求解系统
【发布时间】:2018-06-07 05:12:32
【问题描述】:

我正在尝试求解给定输入值的方程,以便 Mathematica 可以处理答案并产生结果。但是,当我尝试这样做时,它不喜欢我给出的等式:

Solve[(Exp[2 h] - 1 - 2 h)/(5 h^2) == 0.1, h]

Solve was unable to solve the system with inexact coefficients or the system obtained by direct rationalization of inexact numbers present in the system. Since many of the methods used by Solve require exact input, providing Solve with an exact version of the system may help.

Solve[(-1 + E^(2 h) - 2 h)/(5 h^2) == 0.1, h]

如果未能提供解决方案,则会显示错误 "Solve::inex",其中显示了上面的文本。我不确定我是否必须对我的输入参数更加明确。我正在尝试将 h 设置为 0.1(以及其他值,例如 002、-0:0001、-0:00002)并获取十进制值。使用 NSolve 也不会产生结果。

【问题讨论】:

    标签: input wolfram-mathematica solver


    【解决方案1】:

    Solve 通常更擅长于多项式问题,而不擅长于超越问题。 Reduce 通常更擅长先验问题,但它也声称它无法解决这个问题。所以接下来我要做的是

    Plot[{(Exp[2 h] - 1 - 2 h)/(5 h^2), 0.1 },{h,-5,3}]
    

    这告诉我你的函数表现良好并且在 -3 附近有一个解决方案。

    FindRoot 在寻找根时通常非常激进,如果给定一个表现良好的问题和一个好的初始猜测。因此

    h/.FindRoot[(Exp[2 h] - 1 - 2 h)/(5 h^2) == 0.1 ,{h,-3}]
    

    几乎立即告诉我唯一的(真正的)根在 -3.41498 附近

    这种技术应该同样适用于等式右侧的其他正值,即使只对 h 的值进行非常粗略的估计也是如此。对于右侧的负值,我怀疑您可能还有其他问题。在尝试使用 FindRoot 之前,您可以使用 Plot 进行调查

    【讨论】:

    • 这似乎是对的。我将您的技术用于正数,并且有效。感谢那。但是,当我尝试使用负值时,它会抛出“FindRoot::lstol, MachinePrecision”错误。有没有其他方法可以数值计算表达式?我需要使用为我的代码列出的最后两个值来实现其目的。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-04-03
    • 2013-09-14
    相关资源
    最近更新 更多