Advertisement

power = force * velocity is giving me problems

Started by July 30, 2002 08:56 PM
6 comments, last by RolandofGilead 22 years, 6 months ago
I''m making a little space ship game and power is distributed amongst various systems, like propulsion. How can I relate power and force?
Power = Force*Distance / Time
Force = Mass * Distance/(Time2)

Edit:
quote:
Title
power = force * velocity is giving me problems

Like what?



[edited by - Null and Void on July 30, 2002 10:37:37 PM]
Advertisement
You need to setup a timer in your game... Something that will give you the delta time every frame...


Most of your functions regarding physics should then take in ''float deltaTime'', and regarding the variables above (by Null and Void), the values will be modified accordingly.

Check out my 2D Physics tutorial at my GL2D site.

~ Jesse

The gl2D Project
----------[Development Journal]
Seems like y''all got as far as I got.
You didn''t mention distance though.
The only distance that I can think of to make sense in those equations would be delta distance(similar to delta time).
What happens to that equation when delta distance is zero?
Take the limit as distance approaches zero?
For the above equations, if delta distance is zero, it doesn''t matter. Then, your force and power are both zero. If you were trying to divide by zero, you would take the limit, but since you''re not, then you just use the delta as is.


Looking for an honest video game publisher? Visit www.gamethoughts.com
Shameless plug: Game Thoughts
mtaber:
Power is a constant in this scenario since it''s always being supplied.

My goal here is to get to the point where Force = X * Power

That will arrange the equations so that I will be dividing by zero.
Advertisement
I would have been happy to find the limit as delta distance approaches zero, except that it doesn''t exist in this instance. We''re talking about an engine with a constant power input, if you use P = Fv, P is a constant, but v isn''t which means that F isn''t(if your velocity doesn''t change then you definitely need a new engine). Barring mechanical failure, if the input is constant, the output should be as well.

Long story short(the phone line is needed) I finally worked everything around until I got

Power = mass * time * acceleration * acceleration
and put that into something I could use quite easily in the program, which is the following:

((Power*time)/mass)^(1/2) = delta velocity

since square root is expensive, if you use the equation, just make sure that power(P), time(t), and mass(m) change as little as possible. For instance, once calculated, just check to see if the thruster or engine is active, if so, then apply the delta v.

Okay, it''s no unified theory, but I''m pretty happy. Of course now I feel stupid that I didn''t see it sooner. (I didn''t solve this earlier cause my brain apparently forgot all about the fact that acceleration is vector and I got way too hung up on finding force. All the things on the left are scalars, so how do we wind up with a vector? Power times time is energy. Energy is force through a distance. Force is a vector.)

----
I had debated on whether or not to put this in another thread or to reply to this one. Next time I''ll just go ahead and revive the old thread.
http://www.gamedev.net/community/forums/topic.asp?topic_id=108207
"so how do we wind up with a vector? Power times time is energy. Energy is force through a distance. Force is a vector"

Energy (well, technically, work, which is negative change in energy) is the dot product of force and displacement. Dot product takes two vectors and returns a scalar. Therefore, energy is scalar. Energy divided by time (=power), scalar divided by scalar, is a scalar. Alternatively, power = force (vector) dot proudct displacement (vector), which again, consistantly leaves a scalar for energ

This topic is closed to new replies.

Advertisement