[StarSqueak] plugin ideas
Baveco, Hans
J.M.Baveco at Alterra.wag-ur.nl
Mon Mar 18 13:11:21 UTC 2002
Hi
I would be interested in having 2D FFT and inverse 2D FFT plugins!. It would
allow us to simulate what ecologists call 'dispersal kernels' (e.g.
diffusion or movement equations) describing how concentrations or densities
change in discrete time and in continuous space. The route via FFT and back
seems to be an efficient one, at least that is what I learned at a course
(http://www.math.usu.edu/~powell/wauclass/labs.html). The mathematical
formalism is called Integro-difference equation: a combination of difference
equation(s) (describing e.g. how a local population grows) and an integral
equation (describing how it spreads in the next stage). Such models are
relatively easy to deal with in MATLAB.
It is not that I understand the approach completely, but I think it would be
nice to be able to handle these models in Squeak! The 1D FFT plugin is
already there; a 2D version could be useful!
Hans Baveco
The MATLAB code for a diffusive dispersal step looks like this
%
% Dispersal 2D
%
% a Matlab M-file which models diffusion-based dispersal
%
pold = pnew; % define initial condition, this step --
% USER MUST DEFINE THE FIRST pnew
% BEFORE RUNNING THIS PROGRAM
K2D=1/(4*pi*D*t)*exp(-(X.^2+Y.^2)./(4*D*t));
% define dispersal kernel
K2D=K2D/trapz(trapz(dx*dy*K2D));
% this normalizes the probability kernel (probably
not required)
fK2D=dx*dy*fft2(K2D); % Take FFT of dispersal kernel, multiplying by dx
and dy to save
% that step later
fpnew = fK2D.*fft2(pold);
% FFT of new dispersed population
pnew = real(fftshift(ifft2(fpnew)));
% new dispersed population
hold on, pcolor(X,Y,pnew), shading flat, hold off
% plot results on current figure
____________________________________________________________________________
_____________
Message: 2
From: John.Maloney at disney.com
Date: Sat, 16 Mar 2002 10:31:50 -0800
To: squeak-dev at lists.squeakfoundation.org
Subject: Re: [StarSqueakPlugin][VM][Windows] Plugin not loaded!
Reply-To: squeak-dev at lists.squeakfoundation.org
Helge,
Any thoughts on StarSqueak primitives that could be added to speed
up your StarSqueakLife simulation? Perhaps a primitive to sum up
some numeric property of the 8 adjacent cells? (I haven't looked at
your code, but I can imagine how it must work...)
-- John
More information about the Squeak-dev
mailing list
|