Code covered by the BSD License  

Highlights from
Plasticine simulation

image thumbnail

Plasticine simulation

by

Maxim Vedenyov (view profile)

 

Plasticine circle by its own mass compressed on table. 2d

test1.m
tm=10;
dt=0.01;
ta=0:dt:tm;
Lta=length(ta);

d0=0.01; % distance of stability
ss=0.03; % square size
m=1e-3;
k=1;
fcr=2*sqrt(k/m); % critical friction coeffcient
f=2*fcr; % friction coeficent


r=zeros(2,0);
g=[0; -10]; % gravitation

R=0.1;
R2=R^2;
ph=-0.1; % plate level
% make circle:
for yt=-R:d0:R
    for xt=-R:d0:R
        if (xt^2+yt^2<=R2)
            r=[r [xt;yt]];
        end
    end
end
hr=plot(r(1,:),r(2,:),'k.');
hold on;
hpl=plot([-0.15 0.15],ph*[1 1],'r--');
axis equal;

v=zeros(size(r)); % velocity
N=size(r,2);
Na=1:N;

for tc=2:Lta
    t=ta(tc);
    for n=Na
        rt=r(:,n);
        ft=find((abs(rt(1)-r(1,:))<=ss)&(abs(rt(2)-r(2,:))<=ss)&(n~=Na)); % rest points in square
        
    end
end



Contact us