一维椭圆方程数值计算

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

x1IŸþŊ’6¶µ.²9ÆÒµ20140806201¯Kµéu˜‘ý §§du2dx2=f(x);8x2(a;b)u(a)=u(b)=0ùpÀ(a;b)(0;1)éuT§§æ^k ©{%CŒ±‚ªu(i+1)2u(i)+u(i1)=h2f(x(i)):ÁíT‚ª§¿‰ÑdÙ/¤“ꐧ|§¿?˜Ú^Gaussž{¦)L§íò(0;1)N©§Úh=1N:!::xi=ih(0iN)x0=0;xN=1:u00(xi)u0(xi+x2)u0(xix2)xu(xi+x)u(xi)[u(xi)u(xix)](x)2=u(xi+x)2u(xi)+u(xix)](x)2(1)x=hž§ku00(xi)=u(xi+1)2u(xi)+u(xi1)h2Ù¥1iN1.nþªŒµu(xi+1)2u(xi)+u(xi1)=u00(xi)h2=f(xi)h2zÝ/ª=µ10BBBBB@21121.........121CCCCCA0BBBBB@u(x1)u(x2)...u(xN1)1CCCCCA=0BBBBBBB@f(x1)h2f(x2)h2f(x3)h2...f(xN1)h21CCCCCCCA(2)Ù¥u(x0)=u(xN)=0:eu(x)=x(1x);f(x)=u00(x)=2gaussž{9“èfunctionx=Gausss1(A,b)%x=Gausss1(A,b);%Ax=b;n=length(b);A=[A,b];fork=1:(n1)A((k+1):n,(k+1):(n+1))=A((k+1):n,(k+1):(n+1))A((k+1):n,k)/A(k,k)A(k,(k+1):(n+1));A((k+1):n,k)=zeros(nk,1);endx=zeros(n,1);x(n)=A(n,n+1)/A(n,n);fork=n1:1:1x(k,:)=(A(k,n+1)A(k,(k+1):n)x((k+1):n))/A(k,k);endN=500;A=zeros(N1,N1);fori=1:N2A(i,i)=2;A(i,i+1)=1;A(i+1,i)=1;endb=ones(N1,1);forj=1:N1b(j,1)=2/N^2;end2u1=Gausss1(A,b)x1=1/N:1/N:11/N;plot(x1,u1,'g')holdon;u=(x1x1.^2);plot(x1,u,'r')legend('u(xi)êŠ)','u(x)');ã1u(x)†êŠ)é'3ã2u(x)†êŠ)é'£˜Œ100¤ddwÑpdž{[܇©§)JéÐ4

1 / 4
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功