b=a^(-1); c=zeros(135,1); for i=121:135
c(i,1)=25;end d=b*c; s=zeros(11,17); for i=2:16
s(11,i)=100; end for i=1:9 for j=1:15; s(i+1,j+1)=d(15*(i-1)+j,1); end end
subplot(1,2,1),mesh(s) axis([0,17,0,11,0,100]) subplot(1,2,2),contour(s,32)
8
11
10
100
9
80
8
60
7
40
6
20
5
4 0
10
3
15
5
2 10
5 00
1
5
10
15
整理版课件
9
2.5 应用实例
南加州一次未来大地震的强地面运动的数值模拟
整理版课件
24
一般差分格式
1/2
Forward-Time Central-Space method Backward -Time Central -Space method Crank-Nicolson 隐式差分格式
整理版课件
25
一种隐式差分格式的程序实现
1
2
3
4
பைடு நூலகம்
5
6
求解区域:
边界条件:
初始条件:
整理版课件
26
内部节点:
A = sparse(nx,nx); for i=2:nx-1 A(i,i-1) = -s; A(i,i ) = (1+2*s); A(i,i+1) = -s; end