LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Am I right? (https://www.linuxquestions.org/questions/programming-9/am-i-right-66023/)

XxAndyxX 06-16-2003 05:51 PM

Am I right?
 
I made a simple PHP program that calculates if you get a bigger tire for your car how much the speedometer would be off... But it seemed almost too simple. *after a bunch of canceling out* it seemed to be that dividing the tire sizes then multiplying by the speed does it. The actual page is: http://xxandyxx.cjb.net/form.html

The php code is:
<html>
<head>
<title>Speed Evalutation</title>
</head>
<body bgcolor="#000000" text="#FF0000">
<?php $newspeed=$speed * ($new / $origin); ?>
<?php $difference=$newspeed-$speed; ?>
<div align="center">
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>
<br>
<font color="#FFFFFF">Your speedometer says that you're going</font> <?php print $speed ?><br><br>
<font color="#FFFFFF">You are actually going</font> <?php print $newspeed; ?>
<font color="#FFFFFF">MPH </font> <br><br>
<font color="#FFFFFF">The difference in speed is</font> <?php print $difference; ?>
<font color="#FFFFFF">MPH </font> </p>
</div>
</body>
</html>

...So do you think this calculation is right? If not can you help me out?

Thanks
-Andy

zmedico 06-16-2003 09:46 PM

looks good to me because circumference=pi*diameter

no wait, if you put on bigger tires then the axles will spin slower (holding the ground speed constant) so the speedometer reading should decrease as tire size increases. $newspeedometer=$originspeedometer * ($origin / $new)

You could hold the axle speed constant instead, then your original calculation is correct, but those calculations pertain to a change in ground speed rather than a change in axle speed (rotational velocity).

XxAndyxX 06-16-2003 10:08 PM

The car doesn't know you put bigger tires on the axle; thus, lets say you had 30" tires... That would travel apx. 94.25" now if you got 33" tires, that would mean your car would travel about 103.7" making the new tires go 9.45" further than the car 'thinks' it's going. So when in the same time the car thinks it's going 94.25" it's actually going 103.7". So the bigger tires would make the car go faster than the speedometer reads. Also I changed the <?php print $difference; ?> to <?php print abs($difference); ?> because this code also works for if you want to see how much difference it would make if you made the tires smaller and the difference needs to be an absolute value. Please correct me if I'm wrong...

zmedico 06-16-2003 10:15 PM

You have to decide whether you want to calculate a difference in ground speed (holding angular velocity constant) or a difference in speedometer readings (holding ground speed constant).

XxAndyxX 06-16-2003 10:45 PM

Well the little program I made was designed around seeing how much the speedometer was off so I guess it's right *I havn't taken physics yet in highschool; I have no clue what 'angular velocity' is*

zmedico 06-16-2003 11:30 PM

Quote:

Originally posted by XxAndyxX
I have no clue what 'angular velocity' is*
It's just how fast something is spinning (like the tire). It can be measured in rpms (revolutions per minute). I was assuming that the speedometer reading depends on how fast the axles are spinning, which is related to the ground speed by the circumference of the tires.

LandRoverMan 06-18-2003 12:32 PM

Empirical evidence!!
 
I actually put bigger tyres on my Land Rover Defender 90 (not just to answer this question ;) though) and the Speedo reads LOWER.

Each turn of the wheel gest you further over the ground, but the axle has still turned round once, and the gearing in the gear box and differentials to cause that to happen has still gone through the same motion required to make the axle turn round once.

When I first did this I had a few small adventures by going into some tight corners too fast (I thought I was going at say 40 mph when I was really doing about 45 mph).

In the end I got a helper to driver their car steady at 30 mph, 40 mph, 50 mph etc and I drove behind them noting the speed my speedo said. It turned out to be (roughly) about 10% low.

LandRoverMan 06-18-2003 12:34 PM

One more thing - ony my vehicle at least the speedo takes its readings from the gearbox, not the axles.

zmedico 06-18-2003 12:51 PM

Quote:

Originally posted by LandRoverMan
One more thing - ony my vehicle at least the speedo takes its readings from the gearbox, not the axles.
The important thing is to realize that the speedometer reading is directly proportional to the rotation of the tires, axles, gearbox, or whatever.

speedometerReading = constant * rotationSpeed

The constant just factors out and cancels out so it's all equivalent.


All times are GMT -5. The time now is 03:22 PM.