The online racing simulator
Car info: power-weight conversion, metric to imperial [fixed-P9]
This one bugged me some time ago when I made a table of all the stats of each car in S1 using imperial values. On every single car, the power to weight ratio I was calculating was different from what LFS showed. However, when I calculated the power to weight ratio with metric values, I always got the same numbers as LFS.

Today, I think I finally figured it out. As it is currently programmed, LFS seems to do the following (for the sake of ease of explanation, consider that W/kg = kW/metric ton):

-divide power in kW by mass in metric tons to get kW/metric ton
-convert this value to HP to get HP per imperial ton (note the lack of a mass conversion)

This really jumped out at me when I selected the XF GTi and put the driver in the car in the garage. What you end up with is a car that weighs 1010 kg with a power output of 90 kW, and thus a power to weight ratio of 89 kW/metric ton. What you also get is a car that weighs 2226 lbs and makes 120 HP. Then you look at the imperial power to weight and it says 121 HP/imperial ton. Oops.

Clearly 2226 lbs is not an imperial ton, and as you can see, both ratios have approximately the same value as the power output of the car. This lead me to my aforementioned conclusion that the imperial ratio is found by simply applying a kW to HP conversion to to the kW/metric ton value and calling it HP/imperial ton, when it is really HP/metric ton.

Not a huge bug but certainly one that has bothered me for a while. Hopefully it should be a pretty quick fix.
I've noticed a few conversion bugs in there myself. Whenever I convert from Nm to lb ft i just can't get the same number as LFS does. Always out by about 1%. I've double checked my conversion constant from different sources as well. There seems to be a bar/atm mix up too.
Quote from Forbin :...a car that weighs 2226 lbs and makes 120 HP. Then you look at the imperial power to weight and it says 121 HP/imperial ton. Oops.

Clearly 2226 lbs is not an imperial ton

It uses imperial ton (2240 lbs) which is quite close to a metric tonne (2205 lbs). I guess you are expecting an american ton (2000 lbs).

The only solution i can see would be to have all the different versions :

bhp per tonne (metric)
bhp per ton (us)
bhp per ton (imperial)

Only the imperial one is there at the moment... and i don't really want to add the others, if possible!

OT : I find that spelling "tonne" for the metric version, a bit annoying. If the word is pronounced the same, why did they make up a silly spelling for it?
Quote from Bob Smith :I've noticed a few conversion bugs in there myself. Whenever I convert from Nm to lb ft i just can't get the same number as LFS does. Always out by about 1%. I've double checked my conversion constant from different sources as well. There seems to be a bar/atm mix up too.

Seems that my Newton-metres per foot-pound constant was a bit wrong.

I've now changed it from 1.359 (not sure where i got that from) to a value that seems to be generally accepted : 1.35582.

Apparently that result comes from assuming a Newton is equal to 0.22481 lbf. Though this is slightly different from the value you get when you take lb per kg (2.204623) and divide by g (9.81) which gives a result of 0.22473. Hmm actually that's does seem to be quite close...

About pressures - what problem have you experienced?

I've got :

NM2_per_PSI = 6897.1126
PSI_PER_NM2 = 0.000144988
PSI_PER_BAR = 14.7

atmospheric pressure = NM2_PER_PSI * PSI_PER_BAR
Quote from Scawen :The only solution i can see would be to have all the different versions :

bhp per tonne (metric)
bhp per ton (us)
bhp per ton (imperial)

Only the imperial one is there at the moment... and i don't really want to add the others, if possible!

if im not mistaken it already shows hp/ton (or is it hp/kg ? but i guess everybody whos able to read numbers knows how to shift a comma to the left)

Quote :OT : I find that spelling "tonne" for the metric version, a bit annoying. If the word is pronounced the same, why did they make up a silly spelling for it?

its german ... or at least the german word for ton is spelled tonne ... i always assumed ton meant 1000 kg / 1 Mg though

i suggest you just get rid of al the silly units in lfs and eliminate everything but the metric ones
(maybe with the exception of hp and the metric but annoying to calculate with kmh)
-
(thisnameistaken) DELETED by thisnameistaken
Instead of removing everything but metric values like Shotglass suggested "just" add an option for choosing between metric/imperial (i have no idea if there even is something called imperial, it's just an example).
Quote from Scawen :It uses imperial ton (2240 lbs) which is quite close to a metric tonne (2205 lbs). I guess you are expecting an american ton (2000 lbs).

:doh:

I've often heard our (the US's) system of measurement refered to as the imperial system and was not aware that there was any difference from what we use and what Brits use (disregarding some units like stones, which I'd only ever heard of after talking to a Brit ). So yes, you are right, I was expecting it to be an American ton of 2000 lbs. Sorry for the misunderstanding.
Even worse, is the US gallon vs Imperial gallon.

In both cases, they are 8 pints.

But in the UK, one pint is 20 fluid ounces (1.25 pounds of water).
In the US, one pint is 16 fluid ounces (1 pound of water).

So our gallons are 1.25 times the size of your gallons!

I think that's right anyway... i don't really want to check!
Quote from Scawen :About pressures - what problem have you experienced?

I've got :

NM2_per_PSI = 6897.1126
PSI_PER_NM2 = 0.000144988
PSI_PER_BAR = 14.7

atmospheric pressure = NM2_PER_PSI * PSI_PER_BAR

I don't know exactly what problem Bob has seen but you're assuming that atmospheric pressure is 1 bar (100000 N/m2). The accepted atmospheric pressure at sea level is 101325 N/m2 (1.01325 bar). Your numbers put 1 bar at 101387.5552 N/m2 which is wrong.
ConvertIt.com gives the following values for the conversions:

(N/m2)/psi = 6894.75729316836
psi/bar = 14.5037737730209

Which gives 1 bar = 99999.99998 N/m2 (almost exact!)
Ooookaaaayyyy......

That's very interesting that a bar is defined as 100000 N/m2... and that seems to be very widely accepted, according to a search on google.

I was using 1 bar = 1 atmosphere, because i've always assumed that bar is an old unit of pressure, that originated before the metric system, and that it was a coincidence that 1 bar was only about 1% away from 100000 N/m2. A quick search doesn't give me any info on the history of the bar... i've got too much to do today, so can't go on searching though i would definitely like to know... maybe it's one of those old units that has now been redefined in terms of the metric system (like the inch : redefined as exactly 25.4 mm).

If that's true then LFS is currently using an old pre-metric bar but should now switch to the new redefined metric bar. Or maybe it's not true at all, there never was an old bar, and it was invented after the N/m2...?
In the International System of unit the units of measure of the pressure is Newton to the square meter (N/m2) defined pascal (Pa). For convention the atmosphere is defined the practised pressure to sea level from one high mercury column 760 milimeter (1 atm = 101 325 Pa).
Source: http://www.themeter.net/pressioni_e.htm (quick google result)

But I Bar is 0.9869233 Standard Atmosphere's: 0.9869233 * 101325 = 100000.0034 N/m2

(Just another way of getting there). This program helps in a lot of cases, very useful converter, and you can add your own conversations too, in a manner of speaking...
Attached files
Convert.zip - 167.3 KB - 253 views
Quote from Scawen :I was using 1 bar = 1 atmosphere

Oops, yeah, forgot about this thread... that was my problem. You're definition of the bar was my definition of the atm.

If it's all cleared up, then yeah, no niggling issues.
imo
main unit:
pascal; 1Pa = 1N/m2
other valid utits:
bar; 1bar = 100 000 Pa
mm of mercury (0°C); 1 mm Hg = 133,322 Pa

not valid (not SI (Systeme International d'Unités)) units:

libra / inch2; 1 psi = 6 894,76 Pa
kilopond /m2; 1 kp/m2 = 9,806 65 Pa
mm of water (4°C) ; 1 mm H2O = 9,806 Pa
standard atmosphere; 1 atm = 101 325 Pa
technic atmosphere (kp/cm2); 1 at = 98 066,5 Pa
torr; 1 torr = 133,3224 Pa
760 torr = 1 atm
barye; 1 ba = 0,1 Pa

pieze; 1 pz = 1000 Pa
Quote from Bob Smith :If it's all cleared up, then yeah, no niggling issues.

None except... i'd still like to know which came first, the Pa (aka N/m2) or the bar.

If the bar came first then presumably it used to mean 1 atm, and got redefined (adjusted) later as 100,000 Pa.

If the Pa came first then 1 bar has always been 100,000 Pa and never equalled an atm.
I think the former - it sounds more plausible, but my reasons are no more scientific than that.
hard evidence is what is needed... pure guesses don't get us any closer to the truth at this point.

btw - this may seem irrelevant but it annoys me to use things i don't understand - and you can't fully understand things like this that people invented, unless you understand the history of them. when we know the history then it can wrap up the matter without any loose ends...
Pascal
The pascal (symbol: Pa) is the SI unit of pressure. It is equivalent to one newton per square metre. The same unit is also used for stress, Young's modulus, and tensile strength.

The unit is named after Blaise Pascal, the eminent French mathematician, physicist, and philosopher.

Blaise Pascal (June 19, 1623–August 19, 1662) was a French mathematician, physicist, and religious philosopher. Pascal was a child prodigy, who was educated by his father. Pascal's earliest work was in the natural and applied sciences, where he made important contributions to the construction of mechanical calculators and the study of fluids, and clarified the concepts of pressure and vacuum by expanding the work of Evangelista Torricelli. Pascal also wrote powerfully in defence of the scientific method.

He was a mathematician of the first order. In mathematics, Pascal helped create two major new areas of research. He wrote a significant treatise on the subject of projective geometry at the age of sixteen and corresponded with Pierre de Fermat from 1654 on probability theory, strongly influencing the development of modern economics and social science.

Following a mystical experience in late 1654, he left mathematics and physics and devoted himself to reflection and writing about philosophy and theology. His two most famous works date from this period: the Lettres provinciales and the Pensées. However, he had suffered from ill-health throughout his life and his new interests were ended by his early death two months after his 39th birthday.

Bar
A bar (symbol bar) is a unit of pressure. It is not an SI unit. It is accepted (although discouraged) for use with the SI. The bar is still widely used in descriptions of pressure because it is about the same as atmospheric pressure.

The word bar finds its origin in the Greek word báros, meaning weight. Its official symbol is "bar"; the earlier "b" is now deprecated, but still often seen especially as "mb" rather than the proper "mbar" for millibars.

Discussion

Atmospheric air pressure is often given in millibars where "standard" sea level pressure is defined as 1013.25 mbar (hPa), equal to (1.01325 bar). The millibar is also not an SI unit of measure; however, it is still used locally in meteorology when describing atmospheric pressure. The SI unit is the pascal (Pa), with 1 mbar = 100 Pa = 1 hPa = 0.1 kPa. Meteorologists worldwide have long measured air pressure in millibars. After the introduction of SI units, many preferred to preserve the customary pressure figures. Therefore, some continue to use millibars under their own name, while others use hPa (which are equivalent to millibars) so they could stick to the same numeric scale. Similar pressures are given in kilopascals in practically all other fields where the hecto prefix is hardly ever used. In Canadian weather reports, the normal is kPa.

(source: http://en.wikipedia.org)

Based on this I think the bar has it's foundations in pre Pascal measurement of pressure, when it wasn't widely understood or examined. Pascal changed that, and derived a more accurate figure for 'Atmospheric Pressure', which is what is in use today.
Quote from Scawen :OT : I find that spelling "tonne" for the metric version, a bit annoying. If the word is pronounced the same, why did they make up a silly spelling for it?

OT: That's our English for you... words such as invalid are interesting though. Work mate needed to explain in a report that the client was an invalid. Very is easy to misread; "... which is difficult for Mr X as he is an invalid person"... "I'm a invalid, not invalid!!".

For the confused non-native English speakers:

invalid (in val'id) = not valid, null or void
invalid (in'və lid) = one who is chronically ill or disabled.

... and it looks like one won the race. He went to the bar for two drinks, his mate is coming along too. Should I sell my cell phone? We went there to steel their clothes. For Sale, one four year old who is at the fore of his class. ... and Rots finished a second behind second place!

It's all silly... and then theirs those parts of the world that have their own versions of English.

Sorry for OT and digging up the past

FGED GREDG RDFGDR GSFDG