ex3: task 4
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user