Closed ghost closed 4 years ago
Hi Lars,
The fuel consumption conversion to L/100km in "/units/fuel_consumption.py" is also not finished
Right. My function for conversion doesn't support inverse linear relationships (i.e., more L/100km result in less km/L), so I have to rewrite that part to add such conversions. Unfortunately, I don't have much time for that now :-/
PS ↔ hp ↔ kW
and Nm ↔ ft-lb
conversions seem to be non-inverse linear, right? So more PS/hp/kW always results in more kW/PS/hp?
Since you already have km/L, wouldnt the conversion to L/100km just be like this? 5 km/L = 100/5 = 20 L/100km?
The conversion of power/torque is done by multiplying. More X results in more Y, with power and torque.
Since you already have km/L, wouldnt the conversion to L/100km just be like this? 5 km/L = 100/5 = 20 L/100km?
Right, but the function that does the conversion expects only one number, which it multiplies then with another number predefined. But in this case, the number should be divided and not multiplied. So I have to change that behavior, so it supports both multiplication and division.
The conversion of power/torque is done by multiplying. More X results in more Y, with power and torque.
Perfect! Then I think this week I'll be able to add these conversions.
Right, but the function that does the conversion expects only one number, which it multiplies then with another number predefined. But in this case, the number should be divided and not multiplied. So I have to change that behavior, so it supports both multiplication and division.
Ah right. I just checked in a python shell and "print 100/10.2" does exactly what i expect. Google confirms.
Perfect! Then I think this week I'll be able to add these conversions.
Thank you for your time!
Done:
> 1 hp to PS
1.014 PS
> 1 ft-lb to n m
1.356 N-m
Since Nm
name was already reserved for nanometers I changed it to N-m
.
For fuel conversion, I opened a new PR #2.
Hello!
i just found your bot and really liked it. Very handy. This bot does not accept power or torque requests and it kindly asks me to ask you to teach the bot. ft-lb/Nm, hp/kW/PSare not supported. The fuel consumption conversion to L/100km in "/units/fuel_consumption.py" is also not finished. I have seen a few examples online and it seems doable. Though i am no developer nor mathematician. Below are the numbers necessary for conversion of torque and power:
1 Nm is 0.74 ft-lb 1 ft-lb is 1.36 Nm
Thank you for your attention.