|
以下是一段解偏微分方程组的程序,谁能告诉我用的是什么方法解的,我怎么查了好多资料都看不出来啊,谢谢大家了!
; q- \3 @$ M5 D* Y0 P9 K0 J5 u; G$ R' v8 l
% % Programme pour leopard %
0 o9 d0 s# L7 T5 b6 D. cglobal d K F N
2 v B E, |$ C% Y/ y$ k' [: G$ E) [N = 64
% t; b. ]# K* `7 ^5 ?dx = 1/N; 9 K' Y. T# S# Q% N T
d=10 K=0.01 F=0.1
4 h3 B2 h) `6 l$ U! U dt=0.001;
! n, d0 K3 b" R4 O( H6 m6 s+ FU=rand(N); V=rand(N);
3 s9 h9 V3 Z) G# R) R- AFourU=fft2(U); FourV=fft2(V); 1 y0 u' Z8 d; G# w& S: p
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)/(1+(i0*i0+j0*j0)/8); FourV(i,j)=FourV(i,j)/(1+(i0*i0+j0*j0)/8); end end 7 }' L8 a ^: b* m
U=real(ifft2(FourU)); V=real(ifft2(FourV));
1 V; F. ^: @7 k) {7 @% Vcompteur=0;
( Z8 } M3 Z, S% f2 Y7 nfor t=0:dt:1, * B. P) V" d! T- u) h
format long max(max(U)) max(max(V)) min(min(V)) : I5 F3 E4 ?: O% j( d9 `7 o) k' G' @& M
FourU=fft2(U); FourV=fft2(V);
# A2 J4 n9 ]0 y0 wfor 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
( p* A- Y) |; L; CU=real(ifft2(FourU)); V=real(ifft2(FourV));
# Y/ `: \! H7 w0 gfor 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
! C, u+ s5 B* j9 X. o. zU = U + dt*P; V = V + dt*G;
' w6 W8 s* C: U2 }for i=1:N, for j=1:N, W(i,j)=V(i,j); M(i,j)=U(i,j); end end - u+ i) r. }* `, C" R6 m9 S( t2 D) K
if 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
2 G- P6 F& E {0 vcompteur = compteur +1;
6 S+ R3 E% z( m# `end %------------------------------------------
|