Ballistics computer, Help required for making

Discuss scenes and videos made with Algodoo.

Ballistics computer, Help required for making

Postby imaweasal » Tue Nov 24, 2009 10:17 pm

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

Rating: rated 5
Filesize: 116.37 kB
Comments: 0
Ratings: 1
download
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

Postby standardtoaster » Tue Nov 24, 2009 10:22 pm

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.
User avatar
standardtoaster
 
Posts: 606
Joined: Mon Aug 31, 2009 7:57 pm

Re: Ballistics computer, Help required for making

Postby RA2lover » Wed Nov 25, 2009 1:34 am

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 :lol:
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
User avatar
RA2lover
 
Posts: 607
Joined: Mon Aug 31, 2009 8:43 pm
Location: Brazil

Re: Ballistics computer, Help required for making

Postby davidz40 » Wed Nov 25, 2009 5:26 pm

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.
Phundamentalist
User avatar
davidz40
 
Posts: 438
Joined: Sun Sep 06, 2009 10:30 am

Re: Ballistics computer, Help required for making

Postby KarateBrot » Fri Nov 27, 2009 4:59 pm

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 :D

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)
Image
Image
User avatar
KarateBrot
 
Posts: 825
Joined: Mon Aug 31, 2009 7:32 pm
Location: Germany

Re: Ballistics computer, Help required for making

Postby davidz40 » Fri Nov 27, 2009 7:51 pm

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.
Phundamentalist
User avatar
davidz40
 
Posts: 438
Joined: Sun Sep 06, 2009 10:30 am

Re: Ballistics computer, Help required for making

Postby imaweasal » Sat Nov 28, 2009 12:42 am

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

Postby imaweasal » Sat Nov 28, 2009 12:52 am

OH, and to answer an answer, the launcher would probably be high-angle, the newest version has huge range potential

new version

Rating: rated 5
Filesize: 115.3 kB
Comments: 1
Ratings: 1
download



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

Postby standardtoaster » Sat Nov 28, 2009 1:50 am

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.
User avatar
standardtoaster
 
Posts: 606
Joined: Mon Aug 31, 2009 7:57 pm

Re: Ballistics computer, Help required for making

Postby imaweasal » Sat Nov 28, 2009 3:14 am

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

Postby standardtoaster » Sat Nov 28, 2009 3:58 am

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.
User avatar
standardtoaster
 
Posts: 606
Joined: Mon Aug 31, 2009 7:57 pm

Re: Ballistics computer, Help required for making

Postby Ivanlul » Sat Nov 28, 2009 5:54 am

Registered: 2008-10-16
Image
User avatar
Ivanlul
 
Posts: 763
Joined: Mon Aug 31, 2009 11:19 pm
Location: US


Return to Scenes

Who is online

Users browsing this forum: No registered users and 2 guests