2012-09-24 41 views
3

我现在的问题是试图使用FunctionInterpolation []在复杂的功能,最简单的,看看这可能是当你比较的区别:提高数学FunctionInterpolation精度/域

FunctionInterpolation[Sin[t], {t, 0, 30}] 
Plot[%[t], {t, 0, 30}] 

FunctionInterpolation[Sin[t], {t, 0, 1000}] 
Plot[%[t], {t, 0, 30}] 

通过增加函数的域,插值变得非常不准确,我正在寻找一种创建FunctionInterpolation []的方法,该函数对于任意长的域具有任意高的准确度。对于短域来说似乎是可能的,但是我迄今还没有找到两者的解决方案。

如果这是不可能的,为什么不呢? InterpolationFunction的形式有什么特别之处,我不知道?

+0

你知道你的功能是周期性的吗? –

回答

3

可以尝试包括衍生物以及:

FunctionInterpolation[{Sin[t], Cos[t], -Sin[t], -Cos[t]}, {t, 0, 1000}] 
Plot[%[t], {t, 0, 100}] 

plot

+0

啊,谢谢你,这是非常有用的...在试图找到你显示的语法信息(这不是在函数的解释文档),我发现了一个可能的等价方法,似乎允许任意精度: FunctionInterpolation [ {Sin [t]},{t,0,1000}, InterpolationOrder - > 30] – user1694253

+1

@ user1694253是的,请查看范围部分下的示例。 –

+2

为了将来的参考,本文档似乎也主要针对functioniterpolate。 http://reference.wolfram.com/mathematica/ref/Interpolation.html – user1694253

2

可以显然通过使用无证语法的功能范围增加底层采样频率:

FunctionInterpolation[Sin[t], {t, 0, 1000, 20}] 

Plot[%[t], {t, 0, 30}] 

Mathematica graphics

+0

有趣的是,即使在当前版本的Mathematica 10.3.0.0中,语法突出显示器也会将此“红色”着色为错误,即使它有效。 –

+0

@JessRiedel值得向他们发送关于这个问题的建议/报告:报告越多,它在下一个版本中修复的可能性就越高。 –

2

尝试无证选项InterpolationOrder->n用大n喜欢,说50

With[{func = FunctionInterpolation[Sin[t], {t, 0, 1000}]}, 
    Plot[func[x], {x, 150, 160}] 
] 

enter image description here

With[{func = FunctionInterpolation[Sin[t], {t, 0, 1000}, InterpolationOrder -> 50]}, 
    Plot[func[x], {x, 150, 160}] 
] 

enter image description here

您也可以尝试无证InterpolationPoints

With[{func = FunctionInterpolation[Sin[t], {t, 0, 1000}, InterpolationPoints -> 50]}, 
    Plot[func[x], {x, 150, 160}] 
] 

enter image description here

+2

进一步阅读有关未记录的'FunctionInterpolation'选项:http://mathematica.stackexchange。com/a/85103/280 –

+0

一个很好的链接。非常感谢Alexey。 –

+0

感谢,请注意'InterpolationPoints'显然表现为'Plot'的'PlotPoints'选项,根据需要生成更多的点。如果函数不那么流畅,我会提醒'InterpolationOrder'方法可能效果不佳。 – agentp