Fix issues with limited numerical precision and artifacts with big N.

This commit is contained in:
2025-09-04 08:56:55 +02:00
parent dc5fba552e
commit e62c42bb2c
5 changed files with 94 additions and 32 deletions
+4 -4
View File
@@ -43,11 +43,11 @@ int main(int argc, char* argv[]){
// Output the solution
string filename = "numerical_solution_" + to_string(N) + ".csv";
ofstream ofs(filename);
ofs << "x,u(x)" << endl;
ofs << "x,v(x),u(x)" << endl;
for (int i = 0; i <= N; i++) {
ofs << fixed << setprecision(decimal_places) << scientific << x[i] << "," << solution[i] << endl;
}
ofs.close();
ofs << fixed << setprecision(decimal_places) << scientific << x[i] << "," << solution[i] << "," << u[i] << endl;
}
ofs.close();
}