Hi Trainguy,
I hope you find the following answer satisfactory. If you have any
questions, or problems opening files or interpreting notation, please
let me know before rating and I will do my best to resolve any
difficulties you are having.
I have the equation for you uploaded as a bitmap file. Because I
realize this may not be easily viewable for you, I will also embed the
image in an excel document.
Here is the bitmap:
http://68.15.21.151/uploads/researchers/bla.bmp
And here is the excel file:
http://68.15.21.151/uploads/researchers/formula.xls
In this equation, I used the following notation:
Cd = Coefficient of Drag
fa = Frontal area
ap = air pressure
Cr = Coefficient of rolling resistance
w = weight
G = gravity
t = angle
P = total power
Note that there is a negative sign at the very front of the formula,
which might be easy to miss in the image. Also note that variables
with a space between them are being multiplied.
Here is how I solved the problem:
Using Mathematica computer algebra software, I asked the program to
solve the original equation for the variable V:
Solve[P ==
(Cd * (fa/2) * ap * V^3) + (Cr * V * w * G) + (Sin[t] * G * w * V), V]
Mathematica gave me three solutions, but two of those involved
imaginary numbers, and were discarded. The third solution, simplified
somewhat using Mathematica's Simplify[] function, is the one provided
in the files above.
Mathematica is an extremely powerful piece of software that can
perform an incredible number of complicated symbolic mathematical
functions. I'd highly recommend it if you are going to be coming
across a lot of these types of problem. Other software, such as Maple,
have similar capabilities. Programs of this sort are known as
"Computer Algebra Systems".
Suggested google searches:
Mathematica
Maple computer algebra
computer algebra systems
Mathematica is published by Wolfram Research, www.wolfram.com
Maple is published by Maplesoft, www.maplesoft.com
For more information about solving cubics and other polynomials, do a
google search for:
polynomial solving
polynomial factoring
cubic solving
cubic factoring
I hope you find this answer satisfactory. Once again, do not hesitate
to ask for a request for clarification if you are having problems with
the formula.
Thanks,
smudgy. 
Clarification of Answer by
smudgyga
on
19 Jun 2004 19:56 PDT
Hi again trainguy,
Mathtalk makes a good point in his comment about Newtonian iteration.
This can very rapidly (and somewhat more simply than the equation I
provided) give us a very good approximation of the correct value of V,
and in your application it may be a feasible alternative to simply
using a big collection of variables to get an exact value of V.
I will provide more information about implementing Newtonian iteration
shortly, hopefully by the end of the day tomorrow. Meanwhile if you
have the opportunity, feel free to let me know if the formula seems to
meet your needs (I'm of course happy to provide both methods even if
you decide the formula already given suffices).
Thanks,
smudgy.

Request for Answer Clarification by
trainguyga
on
19 Jun 2004 21:22 PDT
Hi smudgy,
Unfortunately, I'm away from my computer that has my main spreadsheet
on it, so I'm unable to check out your answer until Monday morning my
time (North American Pacific Daylight). It looks like quite the
formula, but until I can insert sme representative numbers, I can't be
sure if it's going to work, although i assume it will.
I would certainly be interested in mathguy's appraoch, if you think it
has merit. You are correct in assuming I'm not looking for incredible
accuracy. In the units I'm using, V should resolve to km/hr, and
single or at most double decimal accuracy is probably fine for my
purposes.
That said, you're in line for a good tip on this one, I think you're
doing a huge amount of work for my measly $25. Many thanks.

Clarification of Answer by
smudgyga
on
20 Jun 2004 03:49 PDT
Hi again Trainguy,
In order to get the most out of the Newtonian iteration method, the
following information would be helpful: Are Pa, Pr, Ps, or indeed any
particular ones of the variables likely to be negative in your
computations? This will not stop the iteration method from working,
but it may change the approach we take to automate the procedure.
Thanks,
smudgy.

Request for Answer Clarification by
trainguyga
on
21 Jun 2004 07:31 PDT
Hi again smudgy,
Yes, indeed, Ps is negative in some situations (downhill slopes).
Specifically, it's the Sin(angle) ((Sin(t) in your notation)that has a
negative value. All the other variables should have positve values

Clarification of Answer by
smudgyga
on
21 Jun 2004 13:37 PDT
Hi again Trainguy,
The Newtonian iteration method works like this:
Define a function f(V) = V^3 + aV  b
where a = (2(Cr+sin(t))*(w*G))/((Cd*fa*ap)
and b = 2P/(Cd*fa*ap)
When this function equals zero, it is equivalent to having solved for
V in our original equation,
P=Cd*(fa/2)*ap*V^3 + Cr*w*G*V + sin(t)*G*w*V
So our goal is now to find for what value of V does f(V) equal zero.
We do this with an iterative procedure. Given a "guess" as to where
f(V) might equal zero, we can use derivatives and tangent lines to get
a guess that is considerably closer to the actual value where f(V) is
zero. We will then use the procedure again on our new guess. Lather,
rinse, repeat, until f(V) is as close to zero as we want (we can plug
our guess for V into f(V) to see how close to zero we are getting).
Here is how we start guessing. Let a and b be defined as above.
Then f(V) = V^3 + aV  b
Our initial "guess" for V (call it V_0) will be
V_0 = squareroot(a) + cuberoot(b)
This number is chosen in such a way to ensure that we close in on the
correct (positive) root of the cubic equation. It may be quite far off
from the actual answer, but the iterative procedure will close in on
the correct answer very quickly.
Now, we will generate a new "guess" for V by plugging V_0 into the
following equation:
V_1 = V_0  f(V_0)/(3(V_0)^2 + a)
This guess V_1 will be considerably closer to the correct value of V
than our original V_0 was.
Now, repeat the process above, using V_1 as the input (instead of V_0)
and calling the output V_2. This will yield an even closer
approximation of the correct value of V. We can repeat this as often
as we want, each time generating a new guess V_n and checking how
close we are to the correct answer by seeing how close f(V_n) gets to
zero. When f(V_n) <= 0.00000001, for example, our guess for V is
exceedingly close to the correct answer.
Here is a visual basic script, courtesy of mathtalkga, that performs
the process. Note that the code is given in terms of variables a and
b.
 Begin mathtalk's code 
Function custNewton(a As Double, b As Double) As Double
Dim v, f As Double
v = ((Abs(a) ^ (1/2)) + ((Abs(b) ^ (1/3))
f = v * (v * v + a)  b
Do While Abs(f) > 0.00000001
v = v  f / (3 * v * v + a)
f = v * (v * v + a)  b
Loop
custNewton = v
End Function
 end mathtalk's code 
We can change the precision of our approximation by making the number
0.00000001 bigger or smallerthe smaller the decimal (i.e., the more
zeroes) the more accurate our solution will be.
I can explain to you in more detail why this process works, if you
want, or you can read more about it by searching for "Newton's
Method." Some derivative calculus is involved. Or, for a visual
example of what's going on with the process, check out the nice java
applet at
http://www.math.umn.edu/~garrett/qy/Newton.html
Many thanks to Mathtalk for his extensive help with the approximation
process and code.
Once again, if you are having any problems with this, please don't
hesitate to request a further clarification.
Good luck,
smudgy.
