I am trying to solve $M\ddot{u}=-Ku+F_\text{ext}$ for a 2D linear elastic model with $M$ be the mass matrix,$K$ the stiffness matrix and $F_\text{ext}$ the external load vector coming from a uniformly distributed load acting on one edge of the model.(Note: $F_\text{ext}$ is not time-dependent). An explicit time-scheme is used and more specific Forward-Euler scheme. The steps that I follow are:
- Initial conditions $\dot{u}_0=0$ $u_0=0$
- Solve $M\ddot{u}_n=-Ku_n+F_\text{ext}$ using an iterative solver
- Update $u_\text{n+1}=u_n+dt\dot{u}_n$
- Update $\dot{u}_\text{n+1}=\dot{u}_n+dt\ddot{u}_n$
- Go back to 2 for next time step
Based on this implementation I noticed that the output values (valocity,displacment,acceleration) go to infinity.What is the main issue that can cause this problematic behaviour?I want to note that the used time-step is small $10^{-6}$ so I don't think is a stability issue. Here is the main routine:
for(int i=0;i<2*NN;i++){
RHS[i]=0;;
}
for(int i=0;i<2*NN;i++){
double sum=0;
for(int j=0;j<2*NN;j++){
sum+=K_global[i][j]*displ[j];
}
RHS[i]=Fext[i]-sum;
}
BoundaryCondForRHS(NN,NEy,dbc,RHS);//rows connected with BC are set to zero
ConjugateGradient(2*NN,M_global,RHS,accel);//find acceleration at t->n
/*update*/
for(int i=0;i<2*NN;i++){
displ[i]=dt*veloc[i]+displ[i]; //displ at t->n+1
veloc[i]=dt*accel[i]+veloc[i]; //veloc at t->n+1
}