-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Understand differences between IDL and C++ codes #40
Comments
Since merging #43, differences seem to be limited to only the first 10 s, with very good agreement (<0.1%) everywhere else. |
After the modifications for area expansion in the IDL code, I've found that the differences are once again significant, even with no expansion and only a coronal loop length. As an example, here is a plot of ebtel++ (dashed), HYDRAD (solid), and EBTEL IDL (dotted). Note the differences between the IDL code and ebtel++, If instead I set As such, the differences here must be down to how |
Another update: After the fix to where the last panel represents the relative difference between the two. It is still unclear to me why the two diverge so much at both a)the initial rise phase and b) the late cooling and draining phase. It's possible that this is down to the solver that's being used. In the IDL code, it's just a simple first order Euler method. In the C++ case, I'm using a Cash-Karp method which in principle should be more accurate. |
Note that for doing exact comparisons, should probably be using the same solver. In Boost, you can use a 1st order Euler method, typedef boost::numeric::odeint::euler< state_type > euler_stepper_type;
// Constant timestep integration
num_steps = boost::numeric::odeint::integrate_const(euler_stepper_type(),
loop->CalculateDerivatives,
state,
loop->parameters.tau,
loop->parameters.total_time,
loop->parameters.tau,
obs->Observe); But even for small timesteps, this still doesn't fully solve the problem, In fact, things look worse at the end. |
Now that #39 has been merged, there are some tests for comparing against the IDL implementation by using the single-fluid option in ebtel++. However, this test is currently marked as an expected failure because there small differences that I do not quite understand.
These differences occur mostly within 10 s of the start of the heating event and are very short-lived though there are also some minor differences in the late cooling stage as well. Except for the very early heating-stage differences, which can be up to ~20%, all differences are a order ~1% or less.
These differences become larger when using a non-zero He abundance.
The text was updated successfully, but these errors were encountered: