diff --git a/numerical_methods/ode_forward_euler.c b/numerical_methods/ode_forward_euler.c index 9d98255e..5df0067b 100644 --- a/numerical_methods/ode_forward_euler.c +++ b/numerical_methods/ode_forward_euler.c @@ -116,6 +116,7 @@ int main(int argc, char *argv[]) { fprintf(fp, "%.4g,%.4g,%.4g\n", x, y[0], y[1]); // write to file forward_euler(dx, &x, y, dy); // perform integration + x += dx; // update step } while (x <= X_MAX); // till upper limit of independent variable /* end of integration */ diff --git a/numerical_methods/ode_midpoint_euler.c b/numerical_methods/ode_midpoint_euler.c index 6c408751..5be3c090 100644 --- a/numerical_methods/ode_midpoint_euler.c +++ b/numerical_methods/ode_midpoint_euler.c @@ -124,6 +124,7 @@ int main(int argc, char *argv[]) { fprintf(fp, "%.4g,%.4g,%.4g\n", x, y[0], y[1]); // write to file midpoint_euler(dx, &x, y, dy); // perform integration + x += dx; // update step } while (x <= X_MAX); // till upper limit of independent variable /* end of integration */