%
% calculating initial conditions
%
% v0 = initial velocity
% a0 = initial accelaration
%

nrnod=size(coord,1);
nrdof=size(dof,1)*2;

w=10000*2*pi/60;
dotvn=0;

v0=zeros(nrdof,1);
a0=zeros(nrdof,1);
for nod=1:nrnod

  x=coord(nod,1);
  y=coord(nod,2);
  r=sqrt(x^2+y^2);
  
  if r>0
  vst=r*w;               % tangential velocity
  v0(nod*2-1)=y/r*vst;
  v0(nod*2)=-x/r*vst;
  asn=vst^2/r*0;           % normal acc
  ast=dotvn*r;           % tangential acc
%  as=sqrt(asn^2+ast^2);
  a0(nod*2-1)=y/r*ast-x/r*asn;
  a0(nod*2)=-x/r*ast-y/r*asn;
  end

end

% for the energy conserving algorithm we also need
% the starting condition

fn=M*a0;
