1

我有一组参数曲线和一条参考曲线,我想看看哪些与参考曲线相交。

例如,假设函数 1 是参数曲线,函数 2 是参考曲线。

function1[x_,a_]:=x^2+a
function2[x]:=1

我怎样才能知道哪个函数1“以干净的方式”与函数2相交。我尝试使用 FindRoot:

In:= FindRoot[function1[x, 1] == function2[x], {x, 1}]
Out= {x -> 1.}

它适用于这种情况,但如果它不起作用,Mathematica 会为我提供一个荒谬的值,并带有错误消息。

In[485]:= FindRoot[function1[x, 4] == function2[x], {x, 1}]

"During evaluation of In[485]:= FindRoot::lstol: The line search decreased the step size to
within tolerance specified by AccuracyGoal and PrecisionGoal but was unable to find a  
sufficient decrease in the merit function. You may need more than MachinePrecision
digits of working precision to meet these tolerances. >>"

Out[485]= {x -> 3.09187*10^-6}

我不想得到一个荒谬的值(如果它们不相交)或确切的值(如果它们相交),我想得到一个“真”或“假”的陈述。知道如何实现吗?

4

0 回答 0