Hi Nur,
By carefully observing the code, it appears that the calculation of indices and plotting logic is correct. If you are still seeing only a single point, it's possible that the data in “v_values” and “u_values” isn't being updated as expected due to an issue within the FTCS scheme implementation.
To avoid the single point issue:
- Double-check the FTCS implementation for any logical errors that could cause the data to not update correctly over time.
- Verify that the boundary and initial conditions are applied correctly.
- Ensure that the stability condition for the FTCS scheme is satisfied to prevent numerical instability. I hope this gives you an idea on how to rectify the FTCS dot issue.
You can refer to the following documentation to read about how FTCS heat equation is implemented: https://www.mathworks.com/matlabcentral/fileexchange/54617-ftcs-heat-equation.