init commit

This commit is contained in:
Avery Haas
2026-08-28 22:38:58 -04:00
commit 120e4f505f
324 changed files with 133476 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
#include "engine.h"
void Engine::step(double dt, double load_torque_nm) {
// TODO: replace with real combustion/friction torque model driven
// by throttle position and crank angle. For now: seek idle rpm
// and just track the applied load so downstream pieces have
// something to wire against.
m_rpm += (kIdleRpm - m_rpm) * dt;
m_torque_nm = -load_torque_nm;
}
double Engine::rpm() const {
return m_rpm;
}
double Engine::torque_nm() const {
return m_torque_nm;
}
void Engine::reset() {
m_rpm = 0;
}