mirror of
https://github.moeyy.xyz/https://github.com/TheAlgorithms/C.git
synced 2023-10-11 15:56:24 +08:00
update independent variable in the main loop
This commit is contained in:
parent
beade2db10
commit
63ea12bc3d
@ -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 */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user