View Full Version : Solving for V?
sciwizeh
Sep7-09, 09:02 AM
first not homework... i need to solve and equation for a certain variable so that i can incorporate it into a game. I need to solve for V in this equation:
tan\theta=\frac{v^{2}\pm \sqrt{v^{4}-g(gR^{2}-2v^{2}h)}}{gR}
is it even possible?
Mentallic
Sep7-09, 09:35 AM
Sure it's possible :smile:
Does this form remind you of anything?
Hint: If we have the quadratic ax^2+bx+c=0 then x=\frac{-b\pm \sqrt{b^2-4ac}}{2a}
So this means you can compare all co-efficients, a,b,c and then convert back into the general quadratic form, then solve for v from there.
Sorry, I misread the diagram that you posted under the other thread. Usually one fixes the muzzle speed and changes the angle and I thought that was the case here too. For a fixed angle, the equation that gives the muzzle speed is
v=\sqrt{\frac{gR^{2}(tan\theta^{2}+1)}{2(Rtan\thet a \pm h)}}
Use the upper (+h) sign if the firing cannon is higher than the other one and -h if lower.
Let me know how it works.
Mentallic
Sep7-09, 10:04 AM
Well kuruman, you spoiled the fun :tongue2:
Not that it makes a difference, but it can be further simplified:
v=Rsec\theta \sqrt{\frac{g}{2(Rtan\theta\pm h)}}
since tan^2\theta+1=sec^2\theta
Sorry for spoiling the fun, Mentallic. This thread is a continuation of
http://www.physicsforums.com/showthread.php?t=334483
where I mistakenly posted the formula for the angle instead of the speed so I wanted to make amends.
Yes, the expression can be further simplified, but I think it does make a difference. The formula is intended for a computer algorithm in which the tangent function exists and will be easier to implement than the secant.
sciwizeh
Sep7-09, 06:55 PM
thanks for the help, I would not have thought to reverse the quadratic formula.
kuruman is correct, it is simpler to use tangent, for my application. thanks again.
Mentallic
Sep8-09, 04:58 AM
Sorry for spoiling the fun, Mentallic. This thread is a continuation of
http://www.physicsforums.com/showthread.php?t=334483
where I mistakenly posted the formula for the angle instead of the speed so I wanted to make amends.
Yes, the expression can be further simplified, but I think it does make a difference. The formula is intended for a computer algorithm in which the tangent function exists and will be easier to implement than the secant.
No problem :smile:
Aha I guess I didn't consider simplicity for a computer algorithm. Carry on.
thanks for the help, I would not have thought to reverse the quadratic formula.
kuruman is correct, it is simpler to use tangent, for my application. thanks again.
Reversing the quadratic isn't the conventional way to solve this problem, but does make it much easier if you realize the pattern it created.
i.e. the usual way would be to go about it like this:
tan\theta=\frac{v^{2}\pm \sqrt{v^{4}-g(gR^{2}-2v^{2}h)}}{gR}
gRtan\theta=v^{2}\pm \sqrt{v^{4}-g(gR^{2}-2v^{2}h)}
gRtan\theta-v^2=\pm \sqrt{v^{4}-g(gR^{2}-2v^{2}h)}
now square both sides, collect all terms with v on one side, factorize... etc.
-b=v^2
4ac=g(gR^{2}-2v^{2}h)
2a=gR
c=\frac{g(gR^{2}-2v^{2}h)}{2gR}=\frac{gR^{2}-2v^{2}h}{2R}
a(tan\theta)^2+b(tan\theta)+c=0
\frac{gR(tan\theta)^2}{2}-v^2(tan\theta)+\frac{gR^{2}-2v^{2}h}{2R}=0
Now, just solve for v :smile:
vBulletin® v3.8.7, Copyright ©2000-2012, vBulletin Solutions, Inc.