Fix issues with limited numerical precision and artifacts with big N.
This commit is contained in:
@@ -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();
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user