[Current Forum ] [Archive 2003 - 2005]
[Register]  [Profile]  [Preferences]  [Search]
[Private messages]  [Memberslist]  [FAQ]  [Login]
Subsim Radio Room Forum Index » » Sub Command » » Ballistic missile mod works - theoretically HELP NEEDED
Goto page ( 1 | 2 Next Page )
Author Ballistic missile mod works - theoretically HELP NEEDED
ferenci


Joined: Apr 03, 2002
Posts: 283
From: Budapest, Hungary
Posted: 2002-07-05 04:02   
So the Ballistic missile is nearly ready.
The follownig doctrine models the flight of a ballistic missile with fixed parameters (45 deg startangle and course 000), in other words there is no targeting (see later). But there is a problem: the missile decelerates too slow: the speed values plotted in the debugout stream are perfect, but the missile's speed _in reality_ is faster than it is supposed to be as the deceleration is slow. Thomasew or anybody else: can you suggest a work-around aor something like that??? Please help!

Regarding the targeting. It should calculate two things: starting course (that's easy, it should be the same as the tgt's brg) and starting angle (that needs a lot of calculations, but possible to write). The problem in both case is the same: the missile must know his own coordinates (that's OK: ownx; owny) and the targets'. the problem is here: there is a reserved variable called DestX and Desty (SLMM doctrine uses them), but if I read out these two variables they'll always contain zero! Could you help me doctrine experts??

Thanks: ferenci
_________________
"There are only two kinds of warships: submarines and targets."



  View Profile of ferenci   Email ferenci   ICQ status       Edit/Delete This Post   Reply with quote
ferenci


Joined: Apr 03, 2002
Posts: 283
From: Budapest, Hungary
Posted: 2002-07-05 04:04   
Ah, the doctrine is here:

;Ballistic missile mod
;by ferenci, ferenci@fazekas.hu

var v
var vx
var vty
var vtyo
var start_angle
var angle
var start_time
var current_time
var t


if Init then {

start_time = time
start_angle = 0.7854
; that is 45 deg
setpitch 90
setspd maxspd
setcrs 0
vx = ( maxspd * ( 1 - ( start_angle * start_angle / 2 ) + ( start_angle
* start_angle * start_angle * start_angle / 24 ) ) )
vtyo = ( maxspd * ( start_angle - ( start_angle * start_angle *
start_angle / 6 ) + ( start_angle * start_angle * start_angle * start_angle * start_angle / 120 ) ) )
v = sqrt ( ( vx * vx ) + ( vtyo * vtyo ) )
} else {
current_time = time
t = ( current_time - start_time )
if ( t > 15 ) then {
vty = ( vtyo - ( 10 * ( t ) ) )
v = sqrt ( ( vx * vx ) + ( vty * vty ) )
setspd v
angle = ( vty / vx * 180 / 3.1415 )
setpitch angle
} endif

} endif
_________________


[ This Message was edited by: ferenci on 2002-07-05 04:05 ]

[ This Message was edited by: ferenci on 2002-07-05 04:06 ]


  View Profile of ferenci   Email ferenci   ICQ status       Edit/Delete This Post   Reply with quote
ferenci


Joined: Apr 03, 2002
Posts: 283
From: Budapest, Hungary
Posted: 2002-07-08 14:04   
Well, targeting solved.
The ballistic missile will have to be a "flying SLMM" (not TLAM as it has four waypoints and a BM should only have a targetWPT and SLMM is exaclty like that). After making the "flying SLMM" Destx and Desty works, so targeting is nearly ready (although I sometimes get strange numbers in the dest things).
However deceleartion is still not solved, so if tehere is any idea please... please...

Thanks: ferenci
_________________
"There are only two kinds of warships: submarines and targets."



  View Profile of ferenci   Email ferenci   ICQ status       Edit/Delete This Post   Reply with quote
XabbaRus


Joined: Feb 28, 2002
Posts: 2792
Posted: 2002-07-08 14:11   
Don't you mean acceleration being too fast ferenci?

Anyway glad it is on its way.

Do they actually destroy things?

AI launched TLAMS don't kill anything.

Oh does your e-mail work, I get a lot of can't send to that address messages for you.
_________________

Project 971


  View Profile of XabbaRus   Goto the website of XabbaRus   ICQ status       Edit/Delete This Post   Reply with quote
ferenci


Joined: Apr 03, 2002
Posts: 283
From: Budapest, Hungary
Posted: 2002-07-08 14:13   
Yes it can destroy things.

The problem is that the missile should decelerate on the ballisitc trajectory, but it decelerates too slowly. The result: the missile is too fast on the apex (but still the speed values printed in the debug stream are perfect).

I had some problems with my e-mail but now it is perfec (I hope at least)
_________________
"There are only two kinds of warships: submarines and targets."



  View Profile of ferenci   Email ferenci   ICQ status       Edit/Delete This Post   Reply with quote
Torpex


Joined: Jul 06, 2002
Posts: 112
From: Turkiye - Istanbul
Posted: 2002-07-08 14:17   
Is there a blast radius for that thing?
That is I will set up some buildings in a circular form with a mile radius and will launch SLBM to the center, does it take all those buildings down?


  View Profile of Torpex   Email Torpex   Goto the website of Torpex   ICQ status       Edit/Delete This Post   Reply with quote
XabbaRus


Joined: Feb 28, 2002
Posts: 2792
Posted: 2002-07-08 14:43   
Is the doctrine as written here the latest one or not.

ferenci could u send it to me?
_________________

Project 971


  View Profile of XabbaRus   Goto the website of XabbaRus   ICQ status       Edit/Delete This Post   Reply with quote
ferenci


Joined: Apr 03, 2002
Posts: 283
From: Budapest, Hungary
Posted: 2002-07-08 15:53   
I haven't thought too much about destroying, I'm concentrating on it to work that's the primray goal. After it can be launched, it can targeted I'll think of hitting the targets.

Xabba, I've newer one (with targeting) but that doesn't function, i'm still debugging it. The one here is perfect - without targeting.

_________________


[ This Message was edited by: ferenci on 2002-07-08 15:57 ]


  View Profile of ferenci   Email ferenci   ICQ status       Edit/Delete This Post   Reply with quote
ferenci


Joined: Apr 03, 2002
Posts: 283
From: Budapest, Hungary
Posted: 2002-07-09 13:39   
I discovered that THERE IS an arcus tangent in the doctrine, the nickname of it: xybrg. Using it the trajectory is PERFECT!!!!
I still have problems with targeting as it is difficult to calculate due to the ignition phase (when the BM flies straight up).

But the biggest problem is still the deceleration... No idea guys? A workaround perhaps?

So the newest version is here:

;Ballistic missile mod
;by ferenci, ferenci@fazekas.hu

var v
var vx
var vty
var vtyo
var start_angle
var angle
var start_time
var current_time
var t
var reached_alt
var rec_t
var t_min
var destx
var desty
var rng
var spd
var brg
var brg_set

if Init then {

start_time = time
setpitch 90
setcrs 0
setspd maxspd
reached_alt = false
rec_t = true
brg_set = false

} else {

current_time = time
t = ( current_time - start_time )

if ( brg_set == false ) and ( t > 7 ) then {
brg = xybrg ( DestX - OwnX ) ( DestY - OwnY )
setcrs brg
brg_set = true
} endif

if ( ownalt > 20000 ) or ( reached_alt == true ) then {
reached_alt = true

if ( rec_t == true ) then {
t_min = t
rec_t = false
rng = xyrng ( destx - ownx ) ( desty - owny )
rng = ( rng * 0.9144 )
spd = ( maxspd * 0.5144 )
start_angle = ( rng * 10 / spd / spd / 2 )
vx = ( maxspd * ( 1 - ( start_angle * start_angle / 2 ) + ( start_angle * start_angle * start_angle * start_angle / 24 ) ) )
vtyo = ( maxspd * ( start_angle - ( start_angle * start_angle * start_angle / 6 ) + ( start_angle * start_angle * start_angle * start_angle * start_angle / 120 ) ) )
start_angle = ( start_angle * 180 / 3.1415 )
} endif

vty = ( vtyo - ( 10 * ( t - t_min ) ) )
v = sqrt ( ( vx * vx ) + ( vty * vty ) )
setspd v
angle = xybrg vty vx
if ( angle > 90 ) then {
angle = ( angle - 360 )
} endif
setpitch angle

if ( ownalt < 1000 ) then {
detonate
} endif

} endif

} endif

_________________


[ This Message was edited by: ferenci on 2002-07-09 13:43 ]


  View Profile of ferenci   Email ferenci   ICQ status       Edit/Delete This Post   Reply with quote
jsteed


Joined: Apr 08, 2002
Posts: 253
Posted: 2002-07-11 17:17   
It sounds like gravity is not modelled in the program. Have you tried putting in a negative acceleration term? Another possibility is that the rocket motor is firing during the entire flight so the vertical velocity component never reaches zero. Is it possible to start the rocket off with a fast, instantaneous velocity, like a bullet, and not use a rocket motor? That way if gravity exists, it should slow down.
Just a few ideas...
Cheers, jsteed


  View Profile of jsteed      Edit/Delete This Post   Reply with quote
XabbaRus


Joined: Feb 28, 2002
Posts: 2792
Posted: 2002-07-12 02:42   
Cool ferenci.

Your e-mail still doesn't work for me...

Just had a thought, what a bout a mirv targetting doctrine, multiple war heads he he.

Just kidding would be a pain in the arse to do...

Cheers
_________________

Project 971


  View Profile of XabbaRus   Goto the website of XabbaRus   ICQ status       Edit/Delete This Post   Reply with quote
ferenci


Joined: Apr 03, 2002
Posts: 283
From: Budapest, Hungary
Posted: 2002-07-12 03:18   
There IS NO gravity in SC world jsteed. Try assigning a missile a doctrine that consists only of a 'setspd 0' line. After the missile is fired from the aircraft it'll slow down and stop. Actually it'll float in the air!!! That's why I must manually do everything instead of gravity. I've already tried to use bullet, i'll try it once more, but I afraid i won't be able to write the doctrine as I ran out of ideas (see the PS at my USNI photo post)
By the way MIRV would be a child's play if we had a ballistic missile, because you only have to add some launcher to the bm to lauch the warheads. (that would be a MARV actually).

My e-mail is really dead, so I'll change e-mail adress today to one which is 100%.
_________________
"There are only two kinds of warships: submarines and targets."



  View Profile of ferenci   Email ferenci   ICQ status       Edit/Delete This Post   Reply with quote
jsteed


Joined: Apr 08, 2002
Posts: 253
Posted: 2002-07-12 10:35   
Hi Ferenci,
Could you edit the post of your doctrine and write comments about what each variable represents? Some are obvious but some are not. I'll take a look at it and try to come up with a solution.

Cheers, jsteed


  View Profile of jsteed      Edit/Delete This Post   Reply with quote
ferenci


Joined: Apr 03, 2002
Posts: 283
From: Budapest, Hungary
Posted: 2002-07-12 11:36   
Thanks jsteed, YOU ARE MY LAST HOPE!!!

Here is a commented version:

;Ballistic missile mod
;by ferenci, ferenci@fazekas.hu

;speed
var v
;horizontal speed
var vx
;vertical speed
var vty
;vertical speed at the end of ignition phase
var vtyo
;angle at the end of the ignition phase
var start_angle
;current angle
var angle
;these are for time calculation
var start_time
var current_time
var t
;has the missile reached the alt when the ignition finishes (and ballistic trajectory begins)?
var reached_alt
;should we record the t_min variable?
var rec_t
;the time that is spent until the ignition if finished (and ball traj began)
var t_min
;these are default vars
var destx
var desty
;range to dest
var rng
;current spd
var spd
;brg to dest
var brg
;have we set the brg?
var brg_set


if Init then {

start_time = time
;ignition
setpitch 90
setcrs 0
setspd maxspd
;set booleans
reached_alt = false
rec_t = true
brg_set = false

} else {

;measuring time
current_time = time
t = ( current_time - start_time )

if ( brg_set == false ) and ( t > 7 ) then {
;after 7 sec record the brg (7 sec is necessary until the flight is stabilised)
brg = xybrg ( DestX - OwnX ) ( DestY - OwnY )
setcrs brg
brg_set = true
} endif

if ( ownalt > 20000 ) or ( reached_alt == true ) then {
;ballistic trajectory begins
reached_alt = true

if ( rec_t == true ) then {
;record the time here (neces for the ball traj calculation)
t_min = t
rec_t = false
;record rng; spd and converse them to SI
rng = xyrng ( destx - ownx ) ( desty - owny )
rng = ( rng * 0.9144 )
spd = ( maxspd * 0.5144 )
;calculate start_angle (not perfect because it doesn't calculate the 20000 feet of ignition)
start_angle = ( rng * 10 / spd / spd / 2 )
;calc the starting peeds
vx = ( maxspd * ( 1 - ( start_angle * start_angle / 2 ) + ( start_angle * start_angle * start_angle * start_angle / 24 ) ) )
vtyo = ( maxspd * ( start_angle - ( start_angle * start_angle * start_angle / 6 ) + ( start_angle * start_angle * start_angle * start_angle * start_angle / 120 ) ) )
start_angle = ( start_angle * 180 / 3.1415 )
} endif

;calculate the speed at the ball trajectory
vty = ( vtyo - ( 10 * ( t - t_min ) ) )
v = sqrt ( ( vx * vx ) + ( vty * vty ) )
;set the neces speed CRITICAL!!! The speed is set too slowly!!!
setspd v
;set the angle
angle = xybrg vty vx
if ( angle > 90 ) then {
angle = ( angle - 360 )
} endif
setpitch angle

if ( ownalt < 1000 ) then {
;bumm!
detonate
} endif

} endif

} endif



I hope you'll be able to do it. GOOD LUCK:

ferenci

PS: I'll be away this weekend; after returning I'll correct my e-mail adress.
_________________
"There are only two kinds of warships: submarines and targets."



  View Profile of ferenci   Email ferenci   ICQ status       Edit/Delete This Post   Reply with quote
jsteed


Joined: Apr 08, 2002
Posts: 253
Posted: 2002-07-16 17:36   
After many hours I find that I can write doctrine files. The interpreter that reads these files is poor and VERY slow to say the least ( Now I have a few comments regarding ballistic flight for missiles. I'll use the parameters for a Trident D2 in this discussion. A Trident has a long range (6500nm) because it spends a good fraction of its time where gravity is very small. A smooth transition for gravity at sea level to near zero depending on altitude CANNOT be modeled in a doctrine file It slows the game enormously. If gravity is held constant then the maximum range for a missile is only 725nm. Also the apex of the trajectory would be ~190nm instead of a more usual one of 60-75 nm. In other words, realism will have to be compromised. The question is what is the best way to do that. One solution would be to allow ballistic flight up to the point where the MaxAltitude, (the number in the database), is reached. The missile would then 'fly' horizontally for a time and then descend on a ballistic course. Another solution would allow the missile to fly as high and as fast as is required in order for it to hit its target with a ballistic trajectory. This solution requires a speed of over 50000 knts in order to hit something 6500 nm away. So I would like some input as to what would be the best compromise.

Cheers, jsteed


  View Profile of jsteed      Edit/Delete This Post   Reply with quote
Goto page ( 1 | 2 Next Page )
Lock this Topic Move this Topic Delete this Topic
Powered by phpBB Version 1.4.4
Copyright © 2000 - 2001 The phpBB Group

phpBB Created this page in 0.047321 seconds.