ex3: task 4

This commit is contained in:
2025-09-22 18:38:38 +02:00
parent ad41c944b3
commit 7fa9edd59f

View File

@@ -96,7 +96,7 @@ void move_buffer_window(void) {
// Derive step t+1 from steps t and t-1.
void time_step(void) {
// BEGIN: T4
for (int_t i = 0; i < N; i++) {
for (int_t i = 0; i < n; i++) {
U_nxt(i) = -U_prv(i) + 2.0 * U(i) + (dt * dt * c * c) / (dx * dx) * (U(i - 1) + U(i + 1) - 2.0 * U(i));
}
// END: T4