🔒 Locked
Simulation/physics
Advertisement
Original Post
I'm trying to figure out how to calculate a lot of things for my mech (robot) game. I want it to be simulation. I've searched the web and a lot of the equations are too complex (i think). I need help calculating (approximating): 1) Fluid density (primarily of air, might end up going into water or outerspace in the game) 2) Fluid viscosity (primarily of air...) 3) Friction/drag 4) Terminal velocity (i have the equation but if density = 0 then terminal velocity = infity, which doesnt seem right :S, cuz mechs (robots) cud go into space and having no limit of velocity... doesnt seem right) 5) acceleration (which won't be constant because of friction...) 6) acceleration of gravity (i found an equation on wiki and cut out the part that factors in the latitude to simplify it but not sure if it's a good approximation: 9.7803 - 3.086 * 10 ^ -6 * h) 7) Drag coefficient Basically all these are to be used to calculate the maximum velocity of a mech (robot). I'm taking a high school physics class (which doesnt teach all this advanced stuff)
1, 2, 7: You pull these out of your butt, according to whichever approximation of drag you're using and however you want the numbers to turn out.
3: There's a couple of formulations of the drag equation, but they're all the same up to a constant. This one works fine.
4: That's correct. Other than time dilation effects which you probably don't have to worry about, velocity is not limited in space.
5. You know how to figure this out from your high school physics class.
6. Just use 9.8, or 10, like everyone else. If you want to compute it for orbital distances, use this. Don't bother with your latitude thing. Alternatively, you can use the same approach as for 1, 2, and 7.
3: There's a couple of formulations of the drag equation, but they're all the same up to a constant. This one works fine.
4: That's correct. Other than time dilation effects which you probably don't have to worry about, velocity is not limited in space.
5. You know how to figure this out from your high school physics class.
6. Just use 9.8, or 10, like everyone else. If you want to compute it for orbital distances, use this. Don't bother with your latitude thing. Alternatively, you can use the same approach as for 1, 2, and 7.
1, 2, 7: lol ok.
4: Then why does it take so long to reach other planets? :/ Unless object stops accelerating so that it has enough fuel to get back... or the gravity of other objects (planets/moon) in space...
5: I'm not sure how/what to do about this. What if I used a parabolic equation to get the velocity at that time? I have a graphing calculator, the acceleration is supposed to slow down as it approaches terminal velocity, should I use a y=x^2 function or a y=1/x function?
6: Thanks for the link.
4: Then why does it take so long to reach other planets? :/ Unless object stops accelerating so that it has enough fuel to get back... or the gravity of other objects (planets/moon) in space...
5: I'm not sure how/what to do about this. What if I used a parabolic equation to get the velocity at that time? I have a graphing calculator, the acceleration is supposed to slow down as it approaches terminal velocity, should I use a y=x^2 function or a y=1/x function?
6: Thanks for the link.
Quote:
Original post by biscuitz
4: Then why does it take so long to reach other planets? :/ Unless object stops accelerating so that it has enough fuel to get back... or the gravity of other objects (planets/moon) in space...
The former. Fuel takes up a lot of room if you want high accelerations, particularly because you need to carry extra fuel to boost your extra fuel. The weight sort of snowballs.
Quote:Don't. Trajectories only approximate a parabola; as height increases, they turn into ellipses. Not that that matters. Just use the general equation of force: F=ma. Calculate the sum of all forces, including drag and gravity, and divide by your mass, and you'll get the acceleration at that moment.
5: I'm not sure how/what to do about this. What if I used a parabolic equation to get the velocity at that time?
drag:
F = bv^2
For an object in free fall do this:
mg-bv^2 = 0
and solve for v to get the terminal velocity.
I think b is the product of the fluid density and cross sectional area of the object. Viscosity also might come into play, but could probably be considered negligible for game physics. Viscosity affects things like boundary layer(affects drag, I think) and Reynold's Number (which affects turbulence). For liquids, and air moving at less than Mach 0.3, you can usually assume it to be incompressible, and use Bernoulli's equation. Fluid dynamics is very complex. Approximations and shortcuts are the best way to go. If you really need fluid dynamics in your game, I would say Bernoulli's equation (Mach 0.3 at most), the Perfect Gas Law, and the drag equation that I spoke of above should be more than adequate (unless you want to work with extreme pressures, speeds, or temperatures).
Also be warned that supersonic stuff makes things very complex.
With no drag, such as in outer space, there is no terminal velocity. The mech will just keep accelerating. However, you can take gravity from nearby objects into account to add damping of some sort to your velocity.
My advice is to stick to approximations, you don't need to have 100% accurate physics to have a fun game.
F = bv^2
For an object in free fall do this:
mg-bv^2 = 0
and solve for v to get the terminal velocity.
I think b is the product of the fluid density and cross sectional area of the object. Viscosity also might come into play, but could probably be considered negligible for game physics. Viscosity affects things like boundary layer(affects drag, I think) and Reynold's Number (which affects turbulence). For liquids, and air moving at less than Mach 0.3, you can usually assume it to be incompressible, and use Bernoulli's equation. Fluid dynamics is very complex. Approximations and shortcuts are the best way to go. If you really need fluid dynamics in your game, I would say Bernoulli's equation (Mach 0.3 at most), the Perfect Gas Law, and the drag equation that I spoke of above should be more than adequate (unless you want to work with extreme pressures, speeds, or temperatures).
Also be warned that supersonic stuff makes things very complex.
With no drag, such as in outer space, there is no terminal velocity. The mech will just keep accelerating. However, you can take gravity from nearby objects into account to add damping of some sort to your velocity.
My advice is to stick to approximations, you don't need to have 100% accurate physics to have a fun game.
The mechs will most definately go beyond mach 0.3 lol (it's based in the future so they have to go pretty fast). What would I use if it's more than mach 0.3?
Hmm... what if I added a G-force factor? So in outerspace you're mech can't go faster than a certain G-force (or pilot will die)
Hmm... what if I added a G-force factor? So in outerspace you're mech can't go faster than a certain G-force (or pilot will die)
Quote:
Original post by biscuitz
Hmm... what if I added a G-force factor? So in outerspace you're mech can't go faster than a certain G-force (or pilot will die)
you'll need a cockpit full of incompressible liquid as a cushion for the pilot
as well as surgically placed orifices to fill pilot's thoracic cavity with similarly dense liquid
won't be comforatble, but it will let you tolerate very large accelerations...
Quote:
Original post by biscuitz
Hmm... what if I added a G-force factor? So in outerspace you're mech can't go faster than a certain G-force (or pilot will die)
You could add a "G-force factor" and even though it isn't real, that shouldn't stop you (it doesn't stop screenwriters).
"G-force" is a measure of acceleration and is not the same as velocity. Imagine that you are in a race car and the driver steps on the gas. You will feel the "G-force" immediately even though the car has barely started moving.
As for a maximum velocity in space -- there is none (barring the speed of light). Why would there be a maximum? Imagine for a moment that you are in a spacecraft going at the "maximum" speed. What would happen if you fired a missile? Wouldn't it be going faster than the spacecraft and thus be going faster than the "maximum"?
Quote:
Original post by Sneftel
4: That's correct. Other than time dilation effects which you probably don't have to worry about, velocity is not limited in space.
That's not true in the real Universe. Velocity IS limited due to the fact that it requires an infinite amount of energy to accelerate an object with non-zero rest mass up to the speed of light. I'm not going to bore you with the maths, but essentially C, being the maximum massless particle velocity, is an upper limit on all velocities. The Newtonian approximation to the Universe is only true for velocities close to zero (relatively speaking) and breaks down for velocities greater than about 1/5th of C.
So, IF you want to assume that your Universe is Newtonian, then you will have to deal with the inevitability of infinite velocities. If you want bounded velocities, you *could* incorporate relativistic effects, or you could create your own physics model. Do whichever feels right for you.
Quote:
Original post by Sneftel
Listen to Erkokite, and use approximations. If you don't know what happens to bodies travelling near the speed of sound, what makes you think your players will?
And why should he care? If he is doing this for learning purpose, he should do it in a way he want.
If they don't fine, if they will know it, it would be fine as well. They will need something like a computer assistance for flying anyway.
biscuitz
Don't forget on heat, as heat is the most limiting factor in current ramjets.
Quote:
Original post by Timkin Quote:
Original post by Sneftel
4: That's correct. Other than time dilation effects which you probably don't have to worry about, velocity is not limited in space.
That's not true in the real Universe. Velocity IS limited due to the fact that it requires an infinite amount of energy to accelerate an object with non-zero rest mass up to the speed of light. I'm not going to bore you with the maths, but essentially C, being the maximum massless particle velocity, is an upper limit on all velocities. The Newtonian approximation to the Universe is only true for velocities close to zero (relatively speaking) and breaks down for velocities greater than about 1/5th of C.
Right. Time dilation.
Actualy, velocity is always relative.
No matter how fast that you imagine that you are going it is indistinguishable from stationary. It only becomes difficult when the try to juggle multiple reference frames.
Seeing as this is for a spaceship game then the reference frame is always going to be the players ship, so its a single frame of reference.
1G of acceleration upon yourself will always appear like 1G of acceleration, regardless of how fast you imagine that you are going.
No matter how fast that you imagine that you are going it is indistinguishable from stationary. It only becomes difficult when the try to juggle multiple reference frames.
Seeing as this is for a spaceship game then the reference frame is always going to be the players ship, so its a single frame of reference.
1G of acceleration upon yourself will always appear like 1G of acceleration, regardless of how fast you imagine that you are going.
Quote:
Original post by Raghar
Timkin if you'd post what you posted on the phys.relativity you'd be on the way to be called kook.
Considering you implied an absolute frame of reference, definition of FTL is just behind the corner, and you defeated yourself in your conclusion.
No, what he posted would already be common knowledge to everyone on phys.relativity. I think you need to do more research on the difference between rest mass and apparent mass.
i'm surprised more people replied.
Ye i am doing this to learn but also cuz i want to know how accurate/inaccurate it will be.
i'm thinkin bout scrapping the "g-force" idea. I understand that there is no maximum limit of velocity in space (except for speed of light?) but then I don't want the players running around extremely fast. Idk maybe players running around extremely fast won't be a problem...
umm by ramjet are u refering to a rocket (like nasa)? ok in the beggining the mechs will be using rocket-propulsion but later on they will be using more advanced technology (which i wont mention or people will start posting how crazy and "physics defying" it is) I'm not exactly sure what you mean by heat (from booster, from atmosphere...)
Also can anyone tell me how to calculate the velocity after a certain time of accelerating, this is complicated due to resistance. The resistance formula gives a non-linear acceleration which means I can't use acceleration. For example Force = 100 (i'm ommitting units) mass = 10, acceleration = 10. Well that might give me the acceleration at *that point in time* but the acceleration changes with every point in time while accelerating to the maximum velocity so I cant use F/M*t to calculate the velocity at which the object should be moving at (if I use F/M*t I'll get different answers if/since time intervals may be different due to the computer, like it may lag out for 3 seconds and basically won't be accelerating the same at more frequent time intervals) So far I created an y=x^2 equation where it levels off (in seconds) at the square root of the maximum velocity but it's not really "physics" proven; it curves up to the maximum tho, it's probably wrong since I'm using what I learned from wikipedia.
[Edited by - biscuitz on February 24, 2007 5:43:02 PM]
Quote:
And why should he care? If he is doing this for learning purpose, he should do it in a way he want.
Ye i am doing this to learn but also cuz i want to know how accurate/inaccurate it will be.
i'm thinkin bout scrapping the "g-force" idea. I understand that there is no maximum limit of velocity in space (except for speed of light?) but then I don't want the players running around extremely fast. Idk maybe players running around extremely fast won't be a problem...
Quote:
Don't forget on heat, as heat is the most limiting factor in current ramjets.
umm by ramjet are u refering to a rocket (like nasa)? ok in the beggining the mechs will be using rocket-propulsion but later on they will be using more advanced technology (which i wont mention or people will start posting how crazy and "physics defying" it is) I'm not exactly sure what you mean by heat (from booster, from atmosphere...)
Also can anyone tell me how to calculate the velocity after a certain time of accelerating, this is complicated due to resistance. The resistance formula gives a non-linear acceleration which means I can't use acceleration. For example Force = 100 (i'm ommitting units) mass = 10, acceleration = 10. Well that might give me the acceleration at *that point in time* but the acceleration changes with every point in time while accelerating to the maximum velocity so I cant use F/M*t to calculate the velocity at which the object should be moving at (if I use F/M*t I'll get different answers if/since time intervals may be different due to the computer, like it may lag out for 3 seconds and basically won't be accelerating the same at more frequent time intervals) So far I created an y=x^2 equation where it levels off (in seconds) at the square root of the maximum velocity but it's not really "physics" proven; it curves up to the maximum tho, it's probably wrong since I'm using what I learned from wikipedia.
[Edited by - biscuitz on February 24, 2007 5:43:02 PM]
Don't use abbreviations, and try to use capital letters at the start of sentences. Your post would be more readable.
When some object would go fast through the atmosphere it compresses the air in front, thus the air will heat itself, thus it will transfer heat into the object. If it will go sufficiently fast it will melt. If its shape isn't well aerodynamic, it will create vertexes that would cause even higher drag.
Ramjet is a type of engine that uses atmospheric heating and drag. If you'd look at images, you'd get quite a nice idea what would affect the mecha in high speed.
If it will go in the water, the limit of speed is aprox 60 nm/h, for well shaped torpedo. If you need something faster, you must use supercavitation, or insane amount of energy that would kill whales at 20 nm from that flying thing.
As to you question about inaccuracy, the biggest inacurracy would be most likely caused by exponencial propagation of errors in the computation. ^_^
What for do you need it? You need to compute a velocity in the next frame anyway, so you could compute it gradually.
Otherwise you might look at a mathematical integration.
When some object would go fast through the atmosphere it compresses the air in front, thus the air will heat itself, thus it will transfer heat into the object. If it will go sufficiently fast it will melt. If its shape isn't well aerodynamic, it will create vertexes that would cause even higher drag.
Ramjet is a type of engine that uses atmospheric heating and drag. If you'd look at images, you'd get quite a nice idea what would affect the mecha in high speed.
If it will go in the water, the limit of speed is aprox 60 nm/h, for well shaped torpedo. If you need something faster, you must use supercavitation, or insane amount of energy that would kill whales at 20 nm from that flying thing.
As to you question about inaccuracy, the biggest inacurracy would be most likely caused by exponencial propagation of errors in the computation. ^_^
Quote:
Also can anyone tell me how to calculate the velocity after a certain time of accelerating
What for do you need it? You need to compute a velocity in the next frame anyway, so you could compute it gradually.
Otherwise you might look at a mathematical integration.
Quote:
Original post by Sneftel
Right. Time dilation.
Strictly speaking, time dilation is a result, not a cause.
Quote:
Original post by Raghar
Timkin if you'd post what you posted on the phys.relativity you'd be on the way to be called kook.
Considering you implied an absolute frame of reference, definition of FTL is just behind the corner, and you defeated yourself in your conclusion.
Sheesh. I *wish* we could having ratings drop below zero... I wonder how many people have rated this idiot down since he's hit zero!?
Quote:
Original post by Sneftel Quote:
Original post by Raghar
Timkin if you'd post what you posted on the phys.relativity you'd be on the way to be called kook.
Considering you implied an absolute frame of reference, definition of FTL is just behind the corner, and you defeated yourself in your conclusion.
No, what he posted would already be common knowledge to everyone on phys.relativity. I think you need to do more research on the difference between rest mass and apparent mass.
Timkin did seem to imply an absolute reference frame.
What he said only indicated that he had cursory knowledge on the subject. Velocity is a *relative* concept, not an *absolute* one. There is no maximum absolute velocity, only a maximum apparent velocity. This even trips up graduate students.
No matter how fast that you imagine that you are going, you can accelerate at a fixed rate within your reference frame.
There is no relative velocity at which a spacecraft which produces 1G of acceleration will become less efficient. Even after years. Relativity doesnt factor into single reference frames. Observers in ANOTHER reference frame might observe the engine becoming less efficient (or more efficient, depending), but the observers on the ship would not.
If this were not so, there would be spooky actions-at-a-distance things going on which WOULD violate C, a catch-22.
Suggesting otherwise most certainly would have that newsgroup calling you a kook.
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement