|
以下是一段解偏微分方程组的程序,谁能告诉我用的是什么方法解的,我怎么查了好多资料都看不出来啊,谢谢大家了!
8 B# s% v7 q6 _3 S& N% ]; l7 i1 Z% M& q! o
% % Programme pour leopard %
, B1 L7 Y N* l$ i8 ?' _3 G# ~global d K F N
2 Z- }- A( b- H# j& l. cN = 64 8 h+ T. Y0 C3 M* w
dx = 1/N;
8 t1 y- J( z2 t, Nd=10 K=0.01 F=0.1
4 G: V2 E: h4 S9 E dt=0.001; 0 N7 e% e# M% Z* f0 j. c0 M' Y
U=rand(N); V=rand(N); 5 u# S5 a6 `# H$ O
FourU=fft2(U); FourV=fft2(V);
o' X/ O4 r" f. A$ n$ a# Ofor 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
& G/ S( v, Z" a+ E8 m4 {U=real(ifft2(FourU)); V=real(ifft2(FourV));
( y4 O9 u7 F+ {7 M, a$ Ncompteur=0; " _, l( d$ k" t
for t=0:dt:1,
& V% L5 M( u0 @! _format long max(max(U)) max(max(V)) min(min(V)) 9 z2 Z5 W# p/ c8 x
FourU=fft2(U); FourV=fft2(V); . w+ x4 U# S; W
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
; Y! K& U/ V e# i( iU=real(ifft2(FourU)); V=real(ifft2(FourV)); ; R! w7 Q( V; {. B( \
for 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 0 t: Y" {; {( \6 |7 J/ ~
U = U + dt*P; V = V + dt*G;
5 m2 E; o2 r8 i5 s" `1 J m8 R( \for i=1:N, for j=1:N, W(i,j)=V(i,j); M(i,j)=U(i,j); end end
[& u/ X/ I# H4 L& Xif 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 & M7 K3 g+ D# S' M- [$ x" ]* C
compteur = compteur +1;
+ @2 S1 x I) ?end %------------------------------------------
|