mirror of
https://github.com/TheAlgorithms/C.git
synced 2026-05-06 20:24:44 +00:00
update independent variable in the main loop
This commit is contained in:
@@ -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 */
|
||||
|
||||
|
||||
@@ -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 */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user