跳至內容

File:Stability region for BDF1.svg

頁面內容不支援其他語言。
這個檔案來自維基共享資源
維基百科,自由的百科全書

原始檔案(SVG 檔案,表面大小:720 × 540 像素,檔案大小:88 KB)


摘要

描述
English: Region of absolute stability for the backward Euler = BDF1 method. See below for Python source. Compare with page 350 of Süli, Endre; Mayers, David (2003), An Introduction to Numerical Analysis, Cambridge University Press, ISBN 0521007941.
日期
來源 自己的作品
作者 Jitse Niesen
SVG開發
InfoField
 
SVG檔案的原始碼通過W3C驗證
 
向量圖形使用Matplotlib創作。
原始碼
InfoField

Python code

import numpy
from matplotlib import pyplot

BFDcoeffs = { 1: {'alpha': [1, -1], 'beta': 1},
              2: { 'alpha': [3, -4, 1], 'beta': 2 },
              3: { 'alpha': [11, -18, 9, -2], 'beta': 6 },
              4: { 'alpha': [25, -48, 36, -16, 3], 'beta': 12 },
              5: { 'alpha': [137, -300, 300, -200, 75, -12], 'beta': 60 },
              6: { 'alpha': [147, -360, 450, -400, 225, -72], 'beta': 60 } }

plotWindow = { 1: { 'realPart': [-2, 3], 'imagPart': [-2, 2] },
               2: { 'realPart': [-2, 5], 'imagPart': [-3, 3] },
               3: { 'realPart': [-4, 8], 'imagPart': [-5, 5] },
               4: { 'realPart': [-4, 14], 'imagPart': [-8, 8] },
               5: { 'realPart': [-10, 25], 'imagPart': [-15, 15] },
               6: { 'realPart': [-20, 40], 'imagPart': [-30, 30] } }

# Returns > 1 if argument is not in region of absolute stability
def stabilityFunction(hTimesLambda, s):
    stabPolyCoeffs = list(BFDcoeffs[s]['alpha'])
    stabPolyCoeffs[0] -= hTimesLambda * BFDcoeffs[s]['beta']
    return max(abs(numpy.roots(stabPolyCoeffs)))

# Main program
for s in range(1,7):
    x = numpy.linspace(*plotWindow[s]['realPart'], num=400)
    y = numpy.linspace(*plotWindow[s]['imagPart'], num=400)
    [X,Y] = numpy.meshgrid(x,y)
    Z = numpy.zeros(X.shape)
    for m in range(X.shape[0]):
        for n in range(X.shape[1]):
            Z[m,n] = stabilityFunction(X[m,n] + 1j * Y[m,n], s)
    pyplot.contour(X, Y, Z, [1], colors='k')
    pyplot.contourf(X, Y, Z, [0,1], colors=[[1, 0.5, 0.8]])
    pyplot.plot(plotWindow[s]['realPart'], [0, 0], 'k--')
    pyplot.plot([0, 0], plotWindow[s]['imagPart'], 'k--')
    pyplot.gca().tick_params(labelsize = 20)
    pyplot.savefig('Stability_region_for_BDF%d.svg' % s)
    pyplot.clf()

授權條款

我,本作品的著作權持有者,決定用以下授權條款發佈本作品:
Creative Commons CC-Zero 此檔案在創用CC CC0 1.0 通用公有領域貢獻宣告之下分發。
在此宣告之下分發本作品者,已依據各國著作權法,在全世界放棄其對本作品所擁有的著作權及所有相關相似的法律權利,從而將本作品貢獻至公有領域。您可以複製、修改、分發和演示該作品,用於任何商業用途,所有這些都不需要請求授權。

說明

添加單行說明來描述出檔案所代表的內容

在此檔案描寫的項目

描繪內容

創作作者 Chinese (Hong Kong) (已轉換拼寫)

沒有維基數據項目的某些值

作者姓名字串 繁體中文 (已轉換拼寫):​Jitse Niesen
維基媒體使用者名稱 繁體中文 (已轉換拼寫):​Jitse Niesen

著作權狀態 繁體中文 (已轉換拼寫)

檔案來源 Chinese (Taiwan) (已轉換拼寫)

上傳者的原創作品 繁體中文 (已轉換拼寫)

檔案歷史

點選日期/時間以檢視該時間的檔案版本。

日期/時間縮⁠圖尺寸用戶備⁠註
目前2012年3月20日 (二) 15:37於 2012年3月20日 (二) 15:37 版本的縮圖720 × 540(88 KB)Jitse Niesen

下列頁面有用到此檔案:

全域檔案使用狀況

以下其他 wiki 使用了這個檔案: