Ballistics computer, Help required for making
12 posts • Page 1 of 1
Ballistics computer, Help required for making
Hello all, I would like to make a balistics computer for my rocket launcher that uses condrumner's rockets, modified by me
I have looked at several balistics computer scenes, and just can't figure out how they work!
So if anybody is willing to help me out on this one, it will be appreciated
heres the rocket launcher
I have looked at several balistics computer scenes, and just can't figure out how they work!
So if anybody is willing to help me out on this one, it will be appreciated
heres the rocket launcher
Ive been with phun sience the begining, i got algodoo 1-2 months ago, im dabbling in code and sequenced things
- imaweasal
- Posts: 12
- Joined: Tue Nov 24, 2009 10:09 pm
Re: Ballistics computer, Help required for making
I'm actually working on a ballistics script at the moment. If all goes according to plan I'll be done with it this week. Once it's done maybe I can help you apply it to this.
-

standardtoaster - Posts: 606
- Joined: Mon Aug 31, 2009 7:57 pm
Re: Ballistics computer, Help required for making
you'll need first those values for calculations
Angle on which gun is pointing at(or range you want to, but then you'll need to decice wether the gun is in low/high angle)
Speed of projectile(i don't think rockets will be easy to calculate)
and Gravity strength(default = 9.8).
for now, i'll give an example. in this case, a gun firing a bullet in a 100 m/s velocity, 30 degrees angle of launch, and a 10 m/s² gravity acceleration(making it easier for you to understand).
you'll need to determine the range on which the projectile will land on.
sin(30 degrees)*100 = 50 m/s Y velocity at launch.
cos(30 degrees)*100 = 50*(3^0.5) x velocity at launch.
next step is calculating flight time. in this case, (Y velocity / Gravity)*2(because your projectile will fall down too). with the specified conditions, this equals to a 10 second flight time.
now, multiplying the X velocity by the flight time, you get a 500(3^0.5) meter flight distance*
*=Eliminating other factors, like air friction, and making sure the ground is flat.
you'll need lots of math to do that... good luck
Angle on which gun is pointing at(or range you want to, but then you'll need to decice wether the gun is in low/high angle)
Speed of projectile(i don't think rockets will be easy to calculate)
and Gravity strength(default = 9.8).
for now, i'll give an example. in this case, a gun firing a bullet in a 100 m/s velocity, 30 degrees angle of launch, and a 10 m/s² gravity acceleration(making it easier for you to understand).
you'll need to determine the range on which the projectile will land on.
sin(30 degrees)*100 = 50 m/s Y velocity at launch.
cos(30 degrees)*100 = 50*(3^0.5) x velocity at launch.
next step is calculating flight time. in this case, (Y velocity / Gravity)*2(because your projectile will fall down too). with the specified conditions, this equals to a 10 second flight time.
now, multiplying the X velocity by the flight time, you get a 500(3^0.5) meter flight distance*
*=Eliminating other factors, like air friction, and making sure the ground is flat.
you'll need lots of math to do that... good luck
Jrv wrote:TC42 wrote:Quite honestly, I didn't think anyone on 4chan has that good a use of grammar, spelling, usage, mechanics, ect.
But I've never been there, so I may be wrong.
GTFO newfgt
-

RA2lover - Posts: 607
- Joined: Mon Aug 31, 2009 8:43 pm
- Location: Brazil
Re: Ballistics computer, Help required for making
Calculating ipact point for rocket that actually accelerates is really hard.
I used a different solution for my rockets. Script computes where rocket will hit if free falling (relatively easy to compute). When computed value equals specified target, engine turns off and rocket enters free fall.
I use symbols:
x,y - position of rocket
vx,vy - x and y velocity.
hitpoint - x position of impact (I assume that y position = 0 - target is on earth surface)
t -time
g-gravity acceleration (9.81 m/s2)
dx,dy - x and y distance travelled.
Here are calculations:
dx = x+vx*t; (current position + xvelocity*time)
dy = y+vy*t - g*t^2/2; (current position + yvelocity*time - g*time^2/2 (falling))
rocket hits earth when y=0 so:
0 = -(g/2)*t^2 + vy*t + y
It's equation of parabola
delta = vy^2 + 2*g*y
We have two solutions:
t1 = -vy-sqrt(delta)/g
t2 = -vy+sqrt(delta)/g
one of them is starting time, the second one is impact time.
Impact time is likely to be positive, and starting point is 0 (may be a bit negative if we start from some height). We use the positive solution. (t2)
We know that dx=vx*t+x; (x distance = horizontal velocity*time+current position);
So:
hitpoint = x + vx*(-vy+sqrt(vy^2+2gy)) (current position + x velocity * time to impact)
All You need to do now is defining target position and shutting down rocket engine when hitpoint>=target position.
I used a different solution for my rockets. Script computes where rocket will hit if free falling (relatively easy to compute). When computed value equals specified target, engine turns off and rocket enters free fall.
I use symbols:
x,y - position of rocket
vx,vy - x and y velocity.
hitpoint - x position of impact (I assume that y position = 0 - target is on earth surface)
t -time
g-gravity acceleration (9.81 m/s2)
dx,dy - x and y distance travelled.
Here are calculations:
dx = x+vx*t; (current position + xvelocity*time)
dy = y+vy*t - g*t^2/2; (current position + yvelocity*time - g*time^2/2 (falling))
rocket hits earth when y=0 so:
0 = -(g/2)*t^2 + vy*t + y
It's equation of parabola
delta = vy^2 + 2*g*y
We have two solutions:
t1 = -vy-sqrt(delta)/g
t2 = -vy+sqrt(delta)/g
one of them is starting time, the second one is impact time.
Impact time is likely to be positive, and starting point is 0 (may be a bit negative if we start from some height). We use the positive solution. (t2)
We know that dx=vx*t+x; (x distance = horizontal velocity*time+current position);
So:
hitpoint = x + vx*(-vy+sqrt(vy^2+2gy)) (current position + x velocity * time to impact)
All You need to do now is defining target position and shutting down rocket engine when hitpoint>=target position.
Phundamentalist
-

davidz40 - Posts: 438
- Joined: Sun Sep 06, 2009 10:30 am
Re: Ballistics computer, Help required for making
but conundrumer's rockets need air friction to be stable in the air so you won't have the exact values with a parabola. i don't know how much air friction affects the rockets but if it's too high or the rocket trajectory is too big the calculated impact position will be too imprecise.
i'm working on an algorithm that includes air friction but it needs more time and it's A LOT of maths (because you can't solve the equations with algebraic methods). i also had to develop a few math functions in algodoo just to make it possible. my first test with it was a success. i will write again when the formulas and algorithms are ready to go and if you don't have good results with parabolas.
i hope you won't have problems with the precision of the parabolas because it's very very easy and not much calculation compared to the method with air friction. i'm on it for a month now or so and i wish it would be easier
you can see the difference between a trajectory without air friction (the black parabola) and the trajectory with air friction in algodoo (the blue logarithmic one). (the green one is with quadratic air friction but normally that's disabled in algodoo)

i'm working on an algorithm that includes air friction but it needs more time and it's A LOT of maths (because you can't solve the equations with algebraic methods). i also had to develop a few math functions in algodoo just to make it possible. my first test with it was a success. i will write again when the formulas and algorithms are ready to go and if you don't have good results with parabolas.
i hope you won't have problems with the precision of the parabolas because it's very very easy and not much calculation compared to the method with air friction. i'm on it for a month now or so and i wish it would be easier
you can see the difference between a trajectory without air friction (the black parabola) and the trajectory with air friction in algodoo (the blue logarithmic one). (the green one is with quadratic air friction but normally that's disabled in algodoo)


-

KarateBrot - Posts: 825
- Joined: Mon Aug 31, 2009 7:32 pm
- Location: Germany
Re: Ballistics computer, Help required for making
In my newest rocket i use small engine burns during whole flight to keep rocket on desired parabola.
And good luck in creating formula with air friction.
And good luck in creating formula with air friction.
Phundamentalist
-

davidz40 - Posts: 438
- Joined: Sun Sep 06, 2009 10:30 am
Re: Ballistics computer, Help required for making
Thanks for all the help people, Toaster, ill keep an eye on your account for when you release that script, also, i have a new version up, but i built in algodoo this time rather than in phun so it acts kinda wierd, ill go upload it now
Ive been with phun sience the begining, i got algodoo 1-2 months ago, im dabbling in code and sequenced things
- imaweasal
- Posts: 12
- Joined: Tue Nov 24, 2009 10:09 pm
Re: Ballistics computer, Help required for making
OH, and to answer an answer, the launcher would probably be high-angle, the newest version has huge range potential
new version
EDIT: and i have noticed that the rockets, once leaving the barrel, don't accleerate much, if at all
Im going to run some tests, and try to get a chart for the new version's data, maybe tonight, probably monday-ish
new version
EDIT: and i have noticed that the rockets, once leaving the barrel, don't accleerate much, if at all
Im going to run some tests, and try to get a chart for the new version's data, maybe tonight, probably monday-ish
Ive been with phun sience the begining, i got algodoo 1-2 months ago, im dabbling in code and sequenced things
- imaweasal
- Posts: 12
- Joined: Tue Nov 24, 2009 10:09 pm
Re: Ballistics computer, Help required for making
Actually, you can wait a bit on my progress. :C It won't be done for a bit. When I'm done with it I'll make a topic for it.
-

standardtoaster - Posts: 606
- Joined: Mon Aug 31, 2009 7:57 pm
Re: Ballistics computer, Help required for making
ok then, have you tried the new version?? the explosion is funny in algodoo
Ive been with phun sience the begining, i got algodoo 1-2 months ago, im dabbling in code and sequenced things
- imaweasal
- Posts: 12
- Joined: Tue Nov 24, 2009 10:09 pm
Re: Ballistics computer, Help required for making
No I have not. I will download it later. I'm busy now. BTW if you want to continue this discussion with me I suggest we move this to PM.
-

standardtoaster - Posts: 606
- Joined: Mon Aug 31, 2009 7:57 pm
Re: Ballistics computer, Help required for making
Registered: 2008-10-16


-

Ivanlul - Posts: 763
- Joined: Mon Aug 31, 2009 11:19 pm
- Location: US
12 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 2 guests




