Skip to content

Commit

Permalink
Add twitter link that explains use of dot product
Browse files Browse the repository at this point in the history
  • Loading branch information
DanCard committed Apr 22, 2024
1 parent 5133dfc commit 1b4fe49
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions logger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ namespace sew {
else log_line << (w->was_energy_dissipated_since_last_logged_to_screen ? " <E" : " ");
}
if (dv_logging) {
// https://twitter.com/akshay_pachaar/status/1782387821493584011
log_line << " d⋅v " << std::setw( 4) << std::fixed << std::setprecision(1)
<< w->dist_vel_dot_prod // -1 = approaching, 1 = leaving
<< std::scientific;
Expand Down
2 changes: 1 addition & 1 deletion particle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ void Particle::ConsiderLoggingToFile(int count) {
new_dt = a_->long_dt + ((a_->short_dt - kLongDt) * inverse_exponential);
percent_energy_dissipated = 0;
was_energy_dissipated = false;
// Dissipate energy when heading away.
// Dissipate energy when heading away. https://twitter.com/akshay_pachaar/status/1782387805597164016
if (dist_vel_dot_prod >= 0
&& orig_vel_dot_prod >= 0
&& dist_mag_closest > (kCloseToTrouble*16)) {
Expand Down
3 changes: 2 additions & 1 deletion particle.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,10 @@ class Particle {
SFloat fast_fraction = 0; // Percent we are between long dt and short dt.

SFloat orig_vel_dot_prod; // Positive = moving away from origin. Negative = moving towards origin.
// https://twitter.com/akshay_pachaar/status/1782387821493584011
// Determine if electron is coming or going relative to closest proton.
// For proton indicates if coming or going relative to center.
SFloat dist_vel_dot_prod;
SFloat dist_vel_dot_prod; // -1 = approaching, 1 = leaving
// Due to energy gain problem, sometimes dissipate energy when moving away from center of atom.
bool was_energy_dissipated = false;
bool was_energy_dissipated_since_last_logged_to_screen = false;
Expand Down

0 comments on commit 1b4fe49

Please sign in to comment.