Using the analytical solution(attached), compute the solution for grid spacings of dx/L = (2^-5, 2^-7, 2^-9).(i.e. 33, 129 and 513 points). Choose your time-step such that the stability criteria is met for each grid spacing. Run your numerical solution for 2 cycles (t = 2T, where T is the period for one wave cycle of the 5th mode) and present a plot of the displacement at times, t = 0.5T; 1T; 1.5T; 2T. Each plot should compare the three grid spacings to the analytical solution. Comment on the accuracy of your numerical stencil. When presenting your results you should use at least n = 1000 points for your analytical solution so that the curve appears continuous.
c = 340 L = 0.09
I have attached my code to solve this question, it seems to give 4 graphs which all look the same? According to the qn, they should be different. Please clarify where the mistake is thanks!