% model for ice flow, no collisions, implicit relaxation, no density % use for non-interacting particles function [pos,vel,t] = nod_icemodel(m,T,dt,x,u,alpha); % m = number of points % T = time length % dt = timestep size % x = initial ice positions % u = initial intrinsic ice velocity % alpha = relaxation coefficient tolr = exp(-25); % tolerance j = 1:m; % m-length vectors k = 1:m-1; spc = .001; % minimum spacing between blocks (block width) cbs = zeros(1,m); % on/off to mark blocks collided within timestep n = 1; t(n) = 0; pos(1,:)=x; vel(1,:)=u; while t(n) < T w = wv(x,t,j,n); x(j) = x(j) + u(j)*dt; u(j) = (u(j)+alpha*dt*w(j))/(1+alpha*dt); t(n+1) = t(n) + dt; n=n+1; pos(n,:)=x; vel(n,:)=u; end