File:Stability region for BDF1.svg
来自testwiki
跳转到导航
跳转到搜索
此SVG文件的PNG预览的大小:720 × 540像素。 其他分辨率:320 × 240像素 | 640 × 480像素 | 1,024 × 768像素 | 1,280 × 960像素 | 2,560 × 1,920像素。
原始文件 (SVG文件,尺寸为720 × 540像素,文件大小:88 KB)
本文件来自维基共享资源并可能被其他项目使用。 其文件描述页上的描述显示在下面。
摘要
| 描述Stability region for BDF1.svg |
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 | |
| 源代码 InfoField | Python codeimport 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()
|
许可协议
我,本作品著作权人,特此采用以下许可协议发表本作品:
| 本作品采用知识共享CC0 1.0 通用公有领域贡献许可协议授权。 | |
| 采用本宣告发表本作品的人,已在法律允许的范围内,通过在全世界放弃其对本作品拥有的著作权法规定的所有权利(包括所有相关权利),将本作品贡献至公有领域。您可以复制、修改、传播和表演本作品,将其用于商业目的,无需要求授权。
http://creativecommons.org/publicdomain/zero/1.0/deed.enCC0Creative Commons Zero, Public Domain Dedicationfalsefalse |
说明
添加一行文字以描述该文件所表现的内容
此文件中描述的项目
描繪內容
某些值没有维基数据项目
20 3 2012
文件历史
点击某个日期/时间查看对应时刻的文件。
| 日期/时间 | 缩略图 | 大小 | 用户 | 备注 | |
|---|---|---|---|---|---|
| 当前 | 2012年3月20日 (二) 16:37 | 720 × 540(88 KB) | wikimediacommons>Jitse Niesen |
文件用途
以下页面使用本文件: