6Dof bullet parameters

Started by mman, December 05, 2013, 11:24:44 AM

Previous topic - Next topic

mman

375CT,

Since you are VB programmer could you possibly convert this McCoy's intlift2 to VBA language?
http://www.jbmballistics.com/ballistics/downloads/downloads.shtml

375CT

Quote from: mman on December 05, 2013, 11:24:44 AM
375CT,

Since you are VB programmer could you possibly convert this McCoy's intlift2 to VBA language?
http://www.jbmballistics.com/ballistics/downloads/downloads.shtml

Perhaps there is some confusion here, because what I do is VB.net programming, not VBA (Office)

Anyway, I'll look into it despite the original code is really old (BASICA), and full of "Spaghetti code" which is a real mess to work with. :-\

mman

No confusion, just thought you might be more familiar with different languages than me. Thanks for your effort in any case.

375CT

Quote from: mman on December 06, 2013, 09:54:39 PM
No confusion, just thought you might be more familiar with different languages than me. Thanks for your effort in any case.

Do you have McDrag already converted?


375CT

Quote from: mman on December 07, 2013, 06:45:37 PM
Quote from: 375CT on December 06, 2013, 10:11:17 PM
Do you have McDrag already converted?
No..

Ok, will look into the IntLift2 code and post the refactoring to VB.net, just give me some time to do it.  :)

The major issue I see here is the lack of a running sample...so, in a way we are working in complete blindness, unles you have some.

mman

#6
No, I don't.

McCoy is full of interesting things you could calculate (guestimate) if you just knew these 6-dof coefficients.. Intlift could be useful in that sense.

EDIT:

I red an old email exchange with brad (guy behind JBMballistics) and he said the following about intlift2:

"I have converted it, but it's part of my online programs and I haven't
made that source code available to the public."

So I guess if you convert it you could compare the results with JBM's Modified Point Mass Trajectory calculator. I believe it actually uses McCoys code to calculate those 6-dof coefficients

admin

I did some work here.

I have implemented the 6Dof flight-dynamics.

I have looked at the intlift code, and I remember downloading Qbasic and trying it out.

I implemented partly the official N a t o standard to estimate 6-dof coeficients. That document was very unclear. I wonder if the N a t o bullets fly.

I salvaged some of the code that is at the base of P r o d a s, and the N a t o standards. It is a very poorly digitized public US document. Some of the code is unreadable, but I could do most of the restauration by reading the papers.

Then I decided to port Intlif2, which is only a few hundred lines, and then time ran out.

Currently i am a professor in computer science and have a PhD and a post doc in nuclear physics. Clearly, code conversion is a non issue, however I like to understand the physics behind it, e.g. the basics behind Intlift. That stops me from blindly implementing code. So I started to buy some books. Conclusion: the 6-dof parameters are calculated with phenomenological formulas. The only available sources to which the parametrisations are fitted are US data sources. Currently fluid dynamics is replacing the old methods.

have a look here: http://openrocket.sourceforge.net/index.html

mman

Robert thanks for your input. I'm merely M.Sc. and for me it's sometimes enough to get an estimation to get on the ball park. And for that intlift2 should be useful. Even without completely understanding it.

For accurate results I would try CFD. Which I did already without getting reasonable results. That's of course just due to my incompetence not fault of the method itself.

I'll check on that OpenRocket. Thanks for the link.


375CT

Quote from: mman on December 08, 2013, 06:49:06 PM
No, I don't.

McCoy is full of interesting things you could calculate (guestimate) if you just knew these 6-dof coefficients.. Intlift could be useful in that sense.

EDIT:

I red an old email exchange with brad (guy behind JBMballistics) and he said the following about intlift2:

"I have converted it, but it's part of my online programs and I haven't
made that source code available to the public."

So I guess if you convert it you could compare the results with JBM's Modified Point Mass Trajectory calculator. I believe it actually uses McCoys code to calculate those 6-dof coefficients

According to the documentation, IntLift2 uses McDrag inputs. That's the reason I asked before if you have it already ported.

I don't think it's that straightforward to compare the outputs, but I could be wrong.

375CT

#10
Quote from: admin on December 08, 2013, 10:50:23 PM
I did some work here.

I have implemented the 6Dof flight-dynamics.

I have looked at the intlift code, and I remember downloading Qbasic and trying it out.

I implemented partly the official N a t o standard to estimate 6-dof coeficients. That document was very unclear. I wonder if the N a t o bullets fly.

I salvaged some of the code that is at the base of P r o d a s, and the N a t o standards. It is a very poorly digitized public US document. Some of the code is unreadable, but I could do most of the restauration by reading the papers.

Then I decided to port Intlif2, which is only a few hundred lines, and then time ran out.

Currently i am a professor in computer science and have a PhD and a post doc in nuclear physics. Clearly, code conversion is a non issue, however I like to understand the physics behind it, e.g. the basics behind Intlift. That stops me from blindly implementing code. So I started to buy some books. Conclusion: the 6-dof parameters are calculated with phenomenological formulas. The only available sources to which the parametrisations are fitted are US data sources. Currently fluid dynamics is replacing the old methods.

have a look here: http://openrocket.sourceforge.net/index.html

Robert,

Code conversion can be a BIG issue, as long as you don't have a solid baseline to follow, indeed it could be a complete waste of time if we don't have something we trust in to compare against. Not to mention the complete lack of documentation.

Of course I agree that a few hundred lines won't stop the refactoring, but being so "basica" are you 100% sure you can make it a "true" solution?

Bear in mind I only have a simple MSc in Computer Science, an MSc in Operations Research and an MBA. Anyway count on me to do some work, since I'm no shy when it comes to share our codes.

If you have already did the refactoring from IntLift2 to VB, and if you don' mind, I can take a look to make it a workable program.

mman

Robert have you tried this open rocket by yourself?

Seems like you have to put an engine in the rocket to calculate anything... Is there some trick for bullets?

admin

* * * Intlift2 FOR CLA, CMA, AND CDA2 * * *
* * * adopted for VB.net by Robert Meijer Dec 2013, version 0 * * *
* * * see www.bfxyz.nl * * *

ENTER REFERENCE DIAMETER (MM) 6

ENTER TOTAL LENGTH (CALIBERS) 6

ENTER NOSE LENGTH (CALIBERS) 2

ENTER HEADSHAPE PARAMETER (RT/R) 0,4

ENTER BOATTAIL LENGTH (CALIBERS) 0,7

ENTER BASE DIAMETER (CALIBERS) 0,6

ENTER MEPLAT DIAMETER (CALIBERS) 0,1

ENTER CENTER OF GRAVITY (CALIBERS FROM NOSE) 3

ENTER PROJECTILE IDENTIFICATION rob

* * * Intlift2 FOR CLA, CMA, AND CDA2 * * *
PROJECTILE IDENTIFICATION:  rob
DREF        LT        LN      RT/R
(MM)      (CAL)     (CAL)
6,000     6,000     2,000     0,400

LBT       DB        DM        CGN
(CAL)     (CAL)     (CAL)     (CAL,NOSE)
0,700     0,600     0,100     3,000

MACH      CLA       CMA       CDA2
0,50      0,88      5,07      2,66
0,60      0,90      5,36      2,71
0,70      0,92      5,71      2,73
0,80      0,97      6,30      2,77
0,90      0,97      7,13      2,50
0,95      0,62      7,86      2,56
1,00      1,44      6,12      3,52
1,10      1,61      5,65      4,66
1,20      1,84      5,53      5,62
1,40      2,17      4,99      6,35
1,60      2,42      4,59      6,53
1,80      2,57      4,35      7,00
2,00      2,67      4,17      7,77
2,20      2,74      4,07      8,25
2,50      2,81      3,95      9,29
3,00      2,91      3,82      11,68



COPY THIS OUTPUT?ENTER Y FOR YES, N FOR NO:

admin

Module Module1

    Sub Main()
10:     REM [PROGRAM INTLIFT.BAS, EDITED FOR TANDY 1000 HX (JULY 1990)]
        'revived for vb.net december 2013 by Robert Meijer
20:     REM THIS PROGRAM IS A MODIFIED VERSION OF M. A. MORRIS' RARDLIFT
30:     REM CODE, WITH CORRECTIONS FOR SMALL ARMS BULLETS AND MEDIUM
40:     REM CALIBER CANNON PROJECTILES.
50:     Console.Clear()
60:     ''REM KEY OFF
70:     ''COLOR(7, 1, 8) : CLS()
80:     REM KEY ON
90:     REM
95:     ''DEFDBL(A - H, J - Z)
100:    REM INTERIM ESTIMATES OF LIFT, OVERTURNING MOMENT
110:    REM AND YAW DRAG COEFFICIENTS FOR SMALL ARMS
120:    REM PROJECTILES. THE PROGRAM INPUT FOLLOWS THE
130:    REM MCDRAG FORMAT, BUT REQUIRES A CORRECT
140:    REM VALUE FOR CENTER OF GRAVITY LOCATION.
150:    REM
160:    REM STANDARD DEVIATIONS OF THE CLA AND CMA
        Dim CLA, CMA As Double
170:    REM ESTIMATES ARE 10 PERCENT, AT ALL SPEEDS.
180:    REM THE STANDARD DEVIATION IN CDA2 IS 25 PERCENT.
        Dim CDA2 As Double
190:    REM LARGER ERRORS WILL RESULT FOR PROJECTILE
200:    REM TOTAL LENGTHS EXCEEDING 7 CALIBERS, AND FOR
210:    REM NOSE LENGTHS SHORTER THAN 1.5 CALIBERS.
220:    REM
230:    Dim M(20), Z(20), C3(20), C7(20), C8(20) As Double 'M = mach intervals
240:    REM J=NUMBER OF DECIMAL PLACES IN OUTPUT.
        Dim J As Integer
250:    J = 2

        Dim MAXI As Integer

        Dim A As Double
        Dim A1 As Double

        Dim B, B1 As Double

        Dim C1, C2, C4 As Double
        Dim C5 As Double 'BOATTAIL MOMENT ABOUT NOSE
        Dim C6 As Double 'TOTAL MOMENT ABOUT NOSE

        Dim D, PD As Double 'reference diameter [mm]
        Dim D1 As Double

        Dim E1, E2 As Double

        Dim F1, PF1 As Double
        Dim F2, PF2 As Double
        Dim F3 As Double

        Dim L1, PL1 As Double 'nose length in calibers
        Dim L2, PL2 As Double '
        Dim L3, PL3 As Double 'total lenght in calibers
        Dim L4
        Dim L10 As Double
        Dim L11 As Double


        Dim G1, PG1 As Double 'CENTER OF GRAVITY (CALIBERS FROM NOSE)

        Dim K As String 'PROJECTILE IDENTIFICATION

        Dim S3, PS3 As Double

        Dim N As Integer

        Dim T1 As Double

        Dim U1, U2, U3, U7, U8 As Double


        Dim X1, X2, X3 As Double


252:    REM Changes to McCoy Code: Brad Millard 21 June 1996
253:    REM Following lines added for output formatting, used in all prints
254:    Dim OFFMT As String = "{0,-10:F2}"
255:    Dim IFFMT As String = "{0,-10:F3}"
256:    Dim OSFMT As String = "{0,-10}"
257:    Dim ISFMT As String = "{0,-10}"


        Dim ANS As String
        Dim K1 As String

        'set the mach intervals
        M = {0.5, 0.6, 0.7, 0.8, 0.9, 0.95, 1.0, 1.1, 1.2, 1.4, 1.6, 1.8, 2.0, 2.2, 2.5, 3.0}

        Console.Write("* * * Intlift2 FOR CLA, CMA, AND CDA2 * * *")
        Console.Write(vbCrLf)
        Console.Write("* * * adopted for VB.net by Robert Meijer Dec 2013, version 0 * * *")
        Console.Write(vbCrLf)
        Console.Write("* * * see www.bfxyz.nl * * *")
340:    REM
350:    REM  INPUT PROJECTILE DIMENSIONS.
360:    REM
370:    MAXI = 0
380:    Console.Write(vbCrLf)
390:    Console.Write(vbCrLf)
400:    E1 = 0
410:    E2 = 0
420:    Console.Write("ENTER REFERENCE DIAMETER (MM) ")
430:    D = Convert.ToDouble(Console.ReadLine().ToString)
440:    Console.Write(vbCrLf)
450:    Console.Write("ENTER TOTAL LENGTH (CALIBERS) ")
460:    L3 = Convert.ToDouble(Console.ReadLine().ToString)
470:    If L3 <= 7 Then GoTo 490
480:    E1 = 1
490:    Console.Write(vbCrLf)
500:    Console.Write("ENTER NOSE LENGTH (CALIBERS) ")
510:    L1 = Convert.ToDouble(Console.ReadLine().ToString)
520:    If L1 >= 1.5 Then GoTo 540
530:    E2 = 1
540:    Console.Write(vbCrLf)
550:    Console.Write("ENTER HEADSHAPE PARAMETER (RT/R) ")
560:    S3 = Convert.ToDouble(Console.ReadLine().ToString)
570:    Console.Write(vbCrLf)
580:    Console.Write("ENTER BOATTAIL LENGTH (CALIBERS) ")
590:    L2 = Convert.ToDouble(Console.ReadLine().ToString)
600:    Console.Write(vbCrLf)
610:    Console.Write("ENTER BASE DIAMETER (CALIBERS) ")
620:    F1 = Convert.ToDouble(Console.ReadLine().ToString)
630:    Console.Write(vbCrLf)
640:    Console.Write("ENTER MEPLAT DIAMETER (CALIBERS) ")
650:    F2 = Convert.ToDouble(Console.ReadLine().ToString)
660:    Console.Write(vbCrLf)
670:    Console.Write("ENTER CENTER OF GRAVITY (CALIBERS FROM NOSE) ")
680:    G1 = Convert.ToDouble(Console.ReadLine().ToString)
690:    Console.Write(vbCrLf)
700:    Console.Write("ENTER PROJECTILE IDENTIFICATION ")
710:    K = Console.ReadLine().ToString
720:    Console.Write(vbCrLf)
730:    REM ECHO INPUT DATA
740:    'Console.Clear()
750:    Console.Write("* * * Intlift2 FOR CLA, CMA, AND CDA2 * * *")

        Console.Write(vbCrLf)
770:    Console.Write("PROJECTILE IDENTIFICATION:  " + K)
780:    Console.Write(vbCrLf)

782:    REM Changes to McCoy Code: Brad Millard 12 June 1996
784:    REM Added print formatting to lines 790-870
790:    Console.Write(String.Format(ISFMT, "DREF"))
        Console.Write(String.Format(ISFMT, "  LT "))
        Console.Write(String.Format(ISFMT, "  LN "))
        Console.Write(String.Format(ISFMT, "RT/R"))
        Console.Write(vbCrLf)
        Console.Write(String.Format(ISFMT, "(MM)"))
        Console.Write(String.Format(ISFMT, "(CAL)"))
        Console.Write(String.Format(ISFMT, "(CAL)"))
        Console.Write(vbCrLf)
        Console.Write(String.Format(IFFMT, D))
        Console.Write(String.Format(IFFMT, L3))
        Console.Write(String.Format(IFFMT, L1))
        Console.Write(String.Format(IFFMT, S3))
        Console.Write(vbCrLf)
        Console.Write(vbCrLf)
830:    Console.Write(String.Format(ISFMT, " LBT "))
        Console.Write(String.Format(ISFMT, " DB  "))
        Console.Write(String.Format(ISFMT, " DM  "))
        Console.Write(String.Format(ISFMT, " CGN "))
        Console.Write(vbCrLf)
        Console.Write(String.Format(ISFMT, "(CAL)"))
        Console.Write(String.Format(ISFMT, "(CAL)"))
        Console.Write(String.Format(ISFMT, "(CAL)"))
        Console.Write(String.Format(ISFMT, "(CAL,NOSE)"))
        Console.Write(vbCrLf)
850:    Console.Write(String.Format(IFFMT, L2))
        Console.Write(String.Format(IFFMT, F1))
        Console.Write(String.Format(IFFMT, F2))
        Console.Write(String.Format(IFFMT, G1))
        Console.Write(vbCrLf)
        Console.Write(vbCrLf)
        Console.Write(String.Format(OSFMT, "MACH"))
        Console.Write(String.Format(OSFMT, "CLA "))
        Console.Write(String.Format(OSFMT, "CMA "))
        Console.Write(String.Format(OSFMT, "CDA2"))
        Console.Write(vbCrLf)
880:    PD = D
890:    PL3 = L3
900:    PL1 = L1
910:    PS3 = S3
920:    PL2 = L2
930:    PF1 = F1
940:    PF2 = F2
950:    PG1 = G1
960:    REM
970:    REM  CONVERT MCDRAG UNITS TO PROGRAM UNITS.
980:    REM
990:    D = D / 1000
1000:   L3 = L3 - L1
1010:   F1 = F1 * D
1020:   F2 = F2 * D
1030:   REM
1040:   REM SET UP NOSE SHAPE PARAMETERS.
1050:   REM
1060:   If S3 < 0.1 Then GoTo 1120
1070:   If S3 > 0.8 Then GoTo 1100
1080:   N = 1
1090:   GoTo 1130
1100:   N = 2
1110:   GoTo 1130
1120:   N = 3
1130:   L10 = L1
1140:   T1 = (L10 ^ 2 + ((1 - F2 / D) / 2) ^ 2) / (1 - F2 / D)
1150:   If N = 3 Then GoTo 1190
1160:   L1 = Math.Sqrt(T1 - 0.25)
1170:   If N = 1 Then GoTo 1210
1180:   GoTo 1230
1190:   L1 = (D / (D - F2)) * L10
1200:   GoTo 1230
1210:   L11 = (D / (D - F2)) * L10
1220:   L1 = (L1 + L11) / 2
1230:   F3 = L1 - L10
1240:   G1 = G1 + F3
1250:   D1 = F1 / D
1260:   REM
1270:   REM CALCULATION OF BODY LIFT
1280:   REM WITH NO BOATTAIL.
1290:   REM
1300:   For I = 0 To 15

1302:       REM Changes to McCoy Code: Brad Millard 21 June 1996
1303:       REM Following lines added to simplify calculation of B and B1
1304:       REM Lines 1305, 1306 replace lines 1310-1360.
1305:       B = (Math.Abs(M(I) * M(I) - 1.0!)) ^ 0.5
1306:       B1 = (Math.Abs(M(I) * M(I) - 0.9025)) ^ 0.5

1310:       REM IF M(I) < .951 then goto 1350
1320:       REM B = (M(I) * M(I) - 1) ^ .5
1330:       REM B1 = (M(I) * M(I) - .9025) ^ .5
1340:       REM GOTO 1370
1350:       REM B = (1 - M(I) * M(I)) ^ .5
1354:       REM IF M(I) = .95 then goto B1 = 0
1356:       REM GOTO 1370 NOTE: Forces jump over line 1360 -- BUG
1360:       REM B1 = (.9025 - M(I) * M(I)) ^ .5  NOTE: Never executed

1370:       If M(I) > 1.19 Then GoTo 1500
1380:       A = M(I) * M(I) / L1
1390:       If A > 0.4 Then GoTo 1480
1400:       If A > 0.35 Then GoTo 1460
1410:       If A > 0.25 Then GoTo 1440
1420:       C1 = 0.856 * A - 0.044 * L3 + 1.963
1430:       GoTo 1510
1440:       C1 = (0.43 * A - 0.1515) * L3 + 2.202 - 0.1 * A
1450:       GoTo 1510
1460:       C1 = (0.104 - 0.3 * A) * L3 + 0.573 * A + 1.9665
1470:       GoTo 1510
1480:       C1 = (0.12 * A - 0.064) * L3 - 0.227 * A + 2.2865
1490:       GoTo 1510
1500:       C1 = 1.974 + 0.921 * B / L1
1510:       If M(I) > 0.951 Then GoTo 1620
1520:       REM
1530:       REM SUBSONIC LIFT LOSS DUE TO THE
1540:       REM PRESENCE OF A BOATTAIL.
1550:       REM
1560:       If L2 < 0.48 Then GoTo 1610
1570:       C2 = B1 * (3.115 + 15.083 * L2 * L2 - 21.106 * L2)
1580:       C2 = C2 + 71.14601 * L2 - 47.3 * L2 * L2 - 18.303
1590:       C2 = C2 * D1 ^ 0.75 * (1 - D1 ^ 0.75)
1600:       GoTo 1750
1610:       If B1 = 0 Then GoTo 1680
1620:       If L2 / B1 > 3 Then GoTo 1680
1630:       REM
1640:       REM SUPERSONIC BOATTAIL LIFT LOSS.
1650:       REM
1660:       C2 = (1 - D1 ^ 2) * (2 - (3 - L2 / B1) ^ 3.2439 / 17.649)
1670:       GoTo 1690
1680:       C2 = (1 - D1 ^ 2) * 2
1690:       If M(I) < 0.951 Then GoTo 1750
1700:       If M(I) > 2 Then GoTo 1750
1710:       If M(I) > 1.4 Then GoTo 1740
1720:       C2 = C2 * (0.5 * M(I) + 0.41)
1730:       GoTo 1750
1740:       C2 = C2 * (1.3662 - 0.1833 * M(I))
1750:       If M(I) < 1.01 Then GoTo 1820
1760:       L4 = 0.34 + 0.25 / B
1770:       If L2 < L4 Then GoTo 1820
1780:       C2 = C2 * (1 - (1 - (1 - D1) * L4 / L2) ^ 2) / (1 - D1 ^ 2)
1790:       REM
1800:       REM TOTAL LIFT.
1810:       REM
1820:       C3(I) = C1 - C2
1830:       REM
1840:       REM CALCULATION OF PITCHING MOMENT
1850:       REM ABOUT NOSE DUE TO BODY AND NOSE.
1860:       REM
1870:       If M(I) < 1.01 Then GoTo 1960
1880:       If B < 0.6 Then GoTo 1940
1890:       If B < 1 Then GoTo 1920
1900:       C4 = (0.82 - 0.15 * B) * L1 + 1.7 * B + 0.3
1910:       GoTo 2070
1920:       C4 = (2.045 - 1.375 * B) * L1 + 4.575 * B - 2.575
1930:       GoTo 2070
1940:       C4 = (0.166 * B + 1.12) * L1 + 0.05 * B + 0.14
1950:       GoTo 2070
1960:       If B > 0.65 Then GoTo 2020
1970:       If B > 0.3 Then GoTo 2000
1980:       C4 = (1.12 - 0.233 * B) * L1 + 1.1 * B + 0.14
1990:       GoTo 2070
2000:       C4 = (1.304 - 0.846 * B) * L1 + 2.286 * B - 0.216
2010:       GoTo 2070
2020:       C4 = (1.304 - 0.846 * B) * L1 + 0.5 * B + 0.945
2030:       REM
2040:       REM CORRECTION TO PITCHING MOMENT
2050:       REM FOR DIFFERENT NOSE SHAPES.
2060:       REM
2070:       If N = 1 Then GoTo 2150
2080:       If N = 2 Then GoTo 2110
2090:       C4 = 0.667 * C4 / 0.557
2100:       GoTo 2150
2110:       C4 = 0.456 * C4 / 0.557
2120:       REM
2130:       REM BOATTAIL LIFT CENTER FROM NOSE.
2140:       REM
2150:       If M(I) = 1 Then GoTo 2180
2160:       X1 = (0.66 - 0.041 * L2 / B) * L2
2170:       GoTo 2190
2180:       X1 = L2 / 2
2190:       X1 = X1 + L1 + L3 - L2
2200:       REM
2210:       REM BOATTAIL MOMENT ABOUT NOSE.
2220:       REM
2230:       C5 = X1 * C2
2240:       REM
2250:       REM TOTAL MOMENT ABOUT NOSE.
2260:       REM
2270:       C6 = C4 - C5
2280:       REM
2290:       REM OVERALL LIFT CENTER AFT OF NOSE.
2300:       REM
2310:       X2 = C6 / C3(I)
2320:       X3 = G1 - X2
2330:       Z(I) = X2
2340:       REM
2350:       REM MOMENT ABOUT GENTER OF GRAVITY.
2360:       REM
2370:       C7(I) = C3(I) * X3

2380:       REM
2390:       REM CORRECTIONS TO CMA.
2392:       REM Changes to McCoy Code : Brad Millard, 21 June 1996
2394:       REM line 2400: changed to 2401

2400:       REM IF M(I) <= .95 THEN 2440
2401:       If M(I) < 0.951 Then GoTo 2440

2410:       If M(I) = 1.0! Then GoTo 2460
2420:       U7 = 0.82
2430:       GoTo 2470
2440:       U7 = 0.73 + 0.163 * M(I)
2450:       GoTo 2470
2460:       U7 = 0.84
2470:       C7(I) = U7 * C7(I)
2480:       REM
2490:       REM BODY ASPECT RATIO.
2500:       REM
2510:       A1 = 1 / (L1 / 2 + L3 - L2 + L2 * (1 + D1) / 2)
2520:       If M(I) > 1.3 Then GoTo 2640
2530:       If M(I) > 1 Then GoTo 2620
2540:       If M(I) > 0.8 Then GoTo 2600
2550:       REM
2560:       REM CALCULATION OF YAW DRAG.
2570:       REM
2580:       C8(I) = 1.476 + 0.467 * M(I) + 0.08649999 * C3(I) * C3(I) / A1
2590:       GoTo 2650
2600:       C8(I) = 1.85 + (0.3825 * M(I) - 0.2195) * C3(I) * C3(I) / A1
2610:       GoTo 2650
2620:       C8(I) = 9.467 * M(I) - 7.617 + (0.606 - 0.443 * M(I)) * C3(I) * C3(I) / A1
2630:       GoTo 2650
2640:       C8(I) = 9.825 - 3.95 * M(I) + (0.1458 * M(I) - 0.1594) * C3(I) * C3(I) / A1
2650:       If M(I) > 2 Then GoTo 2720
2660:       If M(I) > 1.25 Then GoTo 2700
2670:       If M(I) < 1 Then GoTo 2730
2680:       C8(I) = C8(I) * (1.2 - 0.2 * M(I))
2690:       GoTo 2730
2700:       C8(I) = C8(I) * (0.133 * M(I) + 0.784)
2710:       GoTo 2730
2720:       C8(I) = C8(I) * (1.41 - 0.18 * M(I))
2730:       If M(I) > 0.95 Then GoTo 2830
2740:       If M(I) > 0.9 Then GoTo 2780
2750:       If M(I) < 0.8 Then GoTo 2830
2760:       C8(I) = C8(I) * (1.8 - M(I))
2770:       GoTo 2830
2780:       C8(I) = C8(I) * (2 * M(I) - 0.9)
2790:       REM
2800:       REM PRINT RESULTS.
2810:       REM
2820:       REM CORRECTIONS TO CDA2.
2830:       U8 = 1.33
2840:       C8(I) = U8 * C8(I)

2850:       REM
2860:       REM CORRECTIONS TO CLA.
2862:       REM Changes to McCoy Code : Brad Millard, 21 June 1996
2863:       REM line 2880-2930: changed to 2931-2937
2870:       REM IF M(I) <= 1! then goto 2910
2880:       REM IF M(I) = 1.1 then goto 2930
2890:       REM U1 = 1.09 - .057 * M(I)
2900:       REM GOTO 2940
2910:       REM U1 = .96 + .038 * M(I)
2920:       REM GOTO 2940
2930:       REM U1 = 1!

2931:       If M(I) <= 1.0! Then GoTo 2937
2932:       If M(I) > 1.11 Then GoTo 2935
2933:       U1 = 1.0!
2934:       GoTo 2940
2935:       U1 = 1.09 - 0.057 * M(I)
2936:       GoTo 2940
2937:       U1 = 0.96 + 0.038 * M(I)

2940:       If L3 >= 1.5 Then GoTo 2960
2950:       U1 = U1 - 0.12 * (1.5 - L3) ^ 2
2960:       If M(I) <= 0.95 Then GoTo 2980
2970:       If M(I) >= 1 Then GoTo 3000
2980:       U2 = (0.22 * M(I) ^ 2) / (Math.Sqrt(1 - M(I) ^ 2))
2990:       GoTo 3010
3000:       U2 = 0.431 / M(I) - 0.1
3010:       U3 = U1 + U2 * (L2 / D1) ^ 2
3020:       C3(I) = U3 * C3(I)
3030:       REM

3032:       REM Changes to McCoy Code : Brad Millard, 21 June 1996
3034:       REM Following three lines not necessary since we're using
3036:       REM the formatting string FFMT$
3040:       REM C3(I) = INT((10 ^ J) * C3(I) + .5) / (10 ^ J)
3050:       REM C7(I) = INT((10 ^ J) * C7(I) + .5) / (10 ^ J)
3060:       REM C8(I) = INT((10 ^ J) * C8(I) + .5) / (10 ^ J)

3062:       REM Changes to McCoy Code: Brad Millard 12 June 1996
3064:       REM Added print formatting to lines 3070
3070:       Console.Write(String.Format(OFFMT, M(I)))
            Console.Write(String.Format(OFFMT, C3(I)))
            Console.Write(String.Format(OFFMT, C7(I)))
            Console.Write(String.Format(OFFMT, C8(I)))
            Console.Write(vbCrLf)
3080:       MAXI = MAXI + 1
3090:   Next I

3100:   Console.Write(vbCrLf)
3110:   Console.Write(vbCrLf)
3120:   If E1 <> 0 Then Console.WriteLine("PROJECTILE TOO LONG FOR ACCURATE ESTIMATES.")
3130:   If E2 <> 0 Then Console.WriteLine("NOSE LENGTH TOO SHORT FOR ACCURATE ESTIMATES.")
3140:   Console.Write(vbCrLf)
3150:   Console.Write("COPY THIS OUTPUT?")
3160:   Console.Write("ENTER Y FOR YES, N FOR NO:")
3170:   ANS = Console.ReadLine().ToString
3180:   If ANS = "N" Then GoTo 3460
3190:   If ANS = "Y" Then GoTo 3240
3200:   GoTo 3140
3210:   REM
3220:   REM  PRINT HARD COPY
3230:   REM
3240:   Console.Write(vbCrLf)
3250:   Console.Write("* * * INTERIM PROGRAM FOR CLA, CMA, AND CDA2 * * *")
3260:
3270:   Console.WriteLine("PROJECTILE IDENTIFICATION:  " + K)
3280:

3282:   REM Changes to McCoy Code: Brad Millard 12 June 1996
3284:   REM Added print formatting to lines 3290-3390
3290:   Console.Write(String.Format(ISFMT, "DREF"))
        Console.Write(String.Format(ISFMT, "  LT "))
        Console.Write(String.Format(ISFMT, "  LN "))
        Console.Write(String.Format(ISFMT, "RT/R"))
        Console.Write(vbCrLf)
        Console.Write(String.Format(ISFMT, "(MM)"))
        Console.Write(String.Format(ISFMT, "(CAL)"))
        Console.Write(String.Format(ISFMT, "(CAL)"))
        Console.Write(vbCrLf)
        Console.Write(String.Format(IFFMT, PD))
        Console.Write(String.Format(IFFMT, PL3))
        Console.Write(String.Format(IFFMT, PL1))
        Console.Write(String.Format(IFFMT, PS3))
        Console.Write(vbCrLf)
3330:   Console.Write(String.Format(ISFMT, " LBT "))
        Console.Write(String.Format(ISFMT, " DB  "))
        Console.Write(String.Format(ISFMT, " DM  "))
        Console.Write(String.Format(ISFMT, "   CGN   "))
        Console.Write(vbCrLf)
        Console.Write(String.Format(ISFMT, "(CAL)"))
        Console.Write(String.Format(ISFMT, "(CAL)"))
        Console.Write(String.Format(ISFMT, "(CAL)"))
        Console.Write(String.Format(ISFMT, "(CAL,NOSE)"))
        Console.Write(vbCrLf)
        Console.Write(String.Format(IFFMT, PL2))
        Console.Write(String.Format(IFFMT, PF1))
        Console.Write(String.Format(IFFMT, PF2))
        Console.Write(String.Format(IFFMT, PG1))
        Console.Write(vbCrLf)

3370:   Console.Write(String.Format(OSFMT, "MACH"))
        Console.Write(String.Format(OSFMT, "CLA"))
        Console.Write(String.Format(OSFMT, "CMA"))
        Console.Write(String.Format(OSFMT, "CDA2"))
        Console.Write(vbCrLf)

3380:   For I = 0 To MAXI - 1
3390:       Console.Write(String.Format(OFFMT, M(I)))
            Console.Write(String.Format(OFFMT, C3(I)))
            Console.Write(String.Format(OFFMT, C7(I)))
            Console.Write(String.Format(OFFMT, C8(I)))
            Console.Write(vbCrLf)
3400:   Next I
3410:   Console.Write(vbCrLf)
3420:   Console.Write(vbCrLf)
3430:   If E1 <> 0 Then Console.Write("PROJECTILE TOO LONG FOR ACCURATE ESTIMATES")
3440:   If E2 <> 0 Then Console.Write("NOSE LENGTH TOO SHORT FOR ACCURATE ESTIMATES")
3450:
3460:   REM
3470:   REM  CHECK FOR ANOTHER CASE.
3480:   REM
3490:   Console.Write(vbCrLf)
3500:   Console.Write(vbCrLf)
3510:   Console.Write("DO YOU WANT TO RUN ANOTHER CASE?")
3520:   Console.Write("ENTER Y FOR YES, N FOR NO:")
3530:   K1 = Console.ReadLine().ToString
3540:   If K1 = "Y" Then GoTo 370
3550:   If K1 = "N" Then GoTo 3570
3560:   GoTo 3500
3570:   End

    End Sub

End Module

admin

Please unpack. Perhaps only the exe is necessary?