2012-09-24 46 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