types: Fix worst case initial magnet temp calculation

Signed-off-by: Hector Martin <marcan@marcan.st>
This commit is contained in:
Hector Martin 2023-10-12 16:51:37 +09:00
parent 14c3ef0b7e
commit 6cb6c45083

View file

@ -254,8 +254,9 @@ impl Speaker {
// Worst case startup assumption
s.t_coil = (new_speaker.t_limit - new_speaker.t_headroom) as f64;
s.t_magnet = s.t_coil
* (new_speaker.tr_magnet / (new_speaker.tr_magnet + new_speaker.tr_coil)) as f64;
s.t_magnet = globals.t_ambient as f64
+ (s.t_coil - globals.t_ambient as f64)
* (new_speaker.tr_magnet / (new_speaker.tr_magnet + new_speaker.tr_coil)) as f64;
// s.t_coil = globals.t_ambient as f64;
// s.t_magnet = globals.t_ambient as f64;