以下是一段解偏微分方程组的程序,谁能告诉我用的是什么方法解的,我怎么查了好多资料都看不出来啊,谢谢大家了!
) v" @1 o0 D! u( k0 [, A# d- P5 D0 o8 D2 C- m$ o
% % Programme pour leopard %
9 ]; E# f2 i: F) T r) x) cglobal d K F N , G3 u1 _, C4 G6 A, f& q
N = 64
6 J9 x( g& O l9 t8 Wdx = 1/N;
, c) v; g7 {8 o; ad=10 K=0.01 F=0.1 / ^) [7 Z; ?3 N/ f/ `, `
dt=0.001; + j8 w: J1 @# S: N$ {
U=rand(N); V=rand(N);
" m/ H, U$ t: j+ m1 U; |FourU=fft2(U); FourV=fft2(V);
. q; k" V, s1 B e0 m( Cfor i=1:N, for j=1:N, i0=i-1; j0=j-1; if i0 > N/2 i0=1+N-i; end if j0 > N/2 j0=1+N-j; end FourU(i,j)=FourU(i,j)/(1+(i0*i0+j0*j0)/8); FourV(i,j)=FourV(i,j)/(1+(i0*i0+j0*j0)/8); end end 6 Q4 J/ y8 u! P7 ]# t' M8 w( e. d3 Q
U=real(ifft2(FourU)); V=real(ifft2(FourV)); - q1 T. n$ w2 X/ I6 W) H/ Q1 w
compteur=0; ' T9 x4 \8 K$ ?6 l) d, O- H4 o
for t=0:dt:1, , {) g! U3 ~% U
format long max(max(U)) max(max(V)) min(min(V)) . ~! k3 ~6 g- ]1 q0 l0 R' N
FourU=fft2(U); FourV=fft2(V);
; S7 I u- {4 K6 M: ^for i=1:N, for j=1:N, i0=i-1; j0=j-1; if i0 > N/2 i0=1+N-i; end if j0 > N/2 j0=1+N-j; end FourU(i,j)=FourU(i,j)*exp(-dt*(i0*i0+j0*j0)/10); FourV(i,j)=FourV(i,j)*exp(-d*dt*(i0*i0+j0*j0)/10); end end 4 c6 j: c1 f8 C1 y, Y5 J
U=real(ifft2(FourU)); V=real(ifft2(FourV));
4 _; c+ M' H, w8 h! ?! L( zfor i=1:N, for j=1:N, P(i,j)=-U(i,j)*V(i,j)^2+F*(1-U(i,j)); G(i,j)=U(i,j)*V(i,j)^2-(F+K)*V(i,j); end end
% Y1 |' @9 y: u$ C+ O7 IU = U + dt*P; V = V + dt*G;
1 ~ j9 L0 X4 M$ M$ G2 L5 I' @& E0 @for i=1:N, for j=1:N, W(i,j)=V(i,j); M(i,j)=U(i,j); end end
6 m4 Q7 Q) t, W4 H* cif rem(compteur,10) == 0 clf; if W>0.6 image(100*W-60); else image(100*W) end if M>0.6 image(100*M-60); else image(100*M); end drawnow; end
: y, B6 M R0 ?compteur = compteur +1; 4 C$ a E. f- X7 W! ^
end %------------------------------------------
|