Solving linear wave equation for time marching solution with explicit scheme and examining the effect of grid refinement on the stability of the solution
Note : Apart from the four plots as u requested , I have also plotted for 100 and 120 grid points to show the gradual effect of fluctuations ( effect of dx ) .For the 160 grid points there is higher degree of fluctuations observed .
Explanation for the plots : From the plot it is evident that the effect of grid refinement has a huge and adverse effect over the stability of the solutions .As we can see from the explicit scheme equation , the term c*dt/dx plays a vital role in provding the stable solution for the updated quantities .For an explicit scheme,to maintain the stability , this term should be maintained less than 1 .So to maintain the same , if dx is reduced , then dt also should be reduced .Here we are only reducing the dx ( by the factor 1/2 , 1/4 and 1/8 from the original) but we are not changing the dt accordingly .This leads the Courant condition >1 i.e c*dt/dx turns out be greater than 1 .This condition leads to the instability in the solutions .This tells us that for steady state simulations , explicit is non preferrable .This fluctuations is due to gibbs phenomena..
Link for matlab files:::
https://drive.google.com/open?id=1fTJLiGKwJmbF7JhP4IqPv4264bAHFU6F