Ballistics for Excel Forum

BfX => Member projects => Topic started by: mman on December 05, 2013, 11:24:44 AM

Title: 6Dof bullet parameters
Post by: 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
Title: Re: 6Dof bullet parameters
Post by: 375CT on December 05, 2013, 03:03:28 PM
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. :-\
Title: Re: 6Dof bullet parameters
Post by: 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.
Title: Re: 6Dof bullet parameters
Post by: 375CT on December 06, 2013, 10:11:17 PM
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?
Title: Re: 6Dof bullet parameters
Post by: 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..
Title: Re: 6Dof bullet parameters
Post by: 375CT on December 07, 2013, 09:04:54 PM
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.
Title: Re: 6Dof bullet parameters
Post by: 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
Title: Re: 6Dof bullet parameters
Post by: 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 (http://openrocket.sourceforge.net/index.html)
Title: Re: 6Dof bullet parameters
Post by: mman on December 09, 2013, 07:15:29 AM
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.

Title: Re: 6Dof bullet parameters
Post by: 375CT on December 09, 2013, 08:20:50 PM
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.
Title: Re: 6Dof bullet parameters
Post by: 375CT on December 09, 2013, 08:27:31 PM
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 (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.
Title: Re: 6Dof bullet parameters
Post by: mman on December 10, 2013, 06:40:05 PM
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?
Title: Re: 6Dof bullet parameters
Post by: admin on December 10, 2013, 07:41:40 PM
* * * 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:
Title: Re: 6Dof bullet parameters
Post by: admin on December 10, 2013, 07:42:59 PM
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
Title: Re: 6Dof bullet parameters
Post by: admin on December 10, 2013, 07:47:08 PM
Please unpack. Perhaps only the exe is necessary?
Title: Re: 6Dof bullet parameters
Post by: 375CT on December 11, 2013, 03:03:03 AM
Quote from: admin on December 10, 2013, 07:47:08 PM
Please unpack. Perhaps only the exe is necessary?

Robert, thanks for the zip file.

You should get rid of those GOTO...or you won't pass any exam ;)

Mman, is this enough or you still need it refactored?
Title: Re: 6Dof bullet parameters
Post by: admin on December 11, 2013, 09:27:27 AM
goto's: the first port has to stay close to the source. Any upgrade can be compared to that.
Title: Re: 6Dof bullet parameters
Post by: mman on December 11, 2013, 09:51:43 AM
Thanks Robert! And that didn't take too long.

375CT,

Program is usable as it is. However for me VBA is the thing. Only with VBA code it is possible to implement intlift2 on excel spreadsheets and take full advantage of it.
Title: Re: 6Dof bullet parameters
Post by: admin on December 11, 2013, 07:51:28 PM
Since you insist:
i will create a BfX_IL2, and put the 6dof code in another bfx.

can you find some of the publications mentioned in the code? So that we can understand what is going on?

Title: Re: 6Dof bullet parameters
Post by: mman on December 11, 2013, 09:25:38 PM
Quote from: admin on December 11, 2013, 07:51:28 PM
Since you insist:
i will create a BfX_IL2, and put the 6dof code in another bfx.

can you find some of the publications mentioned in the code? So that we can understand what is going on?

That would be nice! but what publications?

Do you mean this:

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.

Or is there something else mentioned somewhere?

Title: Re: 6Dof bullet parameters
Post by: 375CT on December 12, 2013, 06:45:29 AM
M.A. Morris wrote "A Computer program to Predict the Major Aerodynamic Coefficients of Conventional Shell and Bullet Body Shapes," RARDE Branch Memorandum 9/81, England 1981

RARDE stands for Royal Armament Research & Development Establishment

According to some sources, Bob McCoy wrote INTLIFT based on the work of Morris.
Title: Re: 6Dof bullet parameters
Post by: mman on December 12, 2013, 07:46:22 AM
http://www.dtic.mil/cgi-bin/GetTRDoc?AD=AD0771148
www.dtic.mil/cgi-bin/GetTRDoc?AD=ADA224354
Title: Re: 6Dof bullet parameters
Post by: admin on December 12, 2013, 10:42:04 AM
Thx, i will have a look at that.

before creating the bfx functions I think I can help you a bit.

1) copy the output of the new program in Excel
2) use interpolation BfX_I

see attachment
Title: Re: 6Dof bullet parameters
Post by: mman on December 12, 2013, 11:38:29 AM
Okay how can I copy the output to excel?

For me copy output option doesn't do anything...
Title: Re: 6Dof bullet parameters
Post by: admin on December 12, 2013, 01:29:36 PM
just from screen. Right mousclick on window, select all ...

Next version will have the output to file option working
Title: Re: 6Dof bullet parameters
Post by: admin on December 12, 2013, 02:10:04 PM
this version generates Intlift2.txt with ; for excel. The file is in the same directory as the .exe
Title: Re: 6Dof bullet parameters
Post by: mman on December 12, 2013, 04:49:35 PM
Now it works great!

When you create bfx functions I'll but them into use. I have some ideas what to with them.

What I'm going to do first is advanced stability calculator. I just need to include calculations for moment of inertias and CoG. I've done some work with this already. It's easy to use 3D-CADs to check if approximations are correct. It goes without saying, I'll share spreadsheets when they are finished.
Title: Re: 6Dof bullet parameters
Post by: 375CT on December 12, 2013, 11:31:29 PM
Off topic.

May I suggest a new thread with a new title? Since most of the last posts bear no relation to HIT PROB, most readers will not be able to follow this change in direction, and will make for a better follow up.

If Robert agrees on, perhaps he could move the last entries to the new thread.
Title: Re: 6Dof bullet parameters
Post by: mman on December 14, 2013, 04:19:17 PM
Robert,

What formula have you used to calculate mach number?
Title: Re: 6Dof bullet parameters
Post by: admin on December 14, 2013, 07:32:20 PM
In intlift2 the machnumber is an input value. Not computed from anything
In bfx the speed of sound is taken to be constant, I have to look up its value?
Title: Re: 6Dof bullet parameters
Post by: mman on December 14, 2013, 08:27:52 PM
Quote from: admin on December 14, 2013, 07:32:20 PM
In intlift2 the machnumber is an input value. Not computed from anything
In bfx the speed of sound is taken to be constant, I have to look up its value?
If I'm going to use intlift and bfx 3dof solver together there has to be a conversion formula from m/s to mach number. Here is one:
http://www.engineeringtoolbox.com/speed-sound-d_82.html

But there are others. I'm just wondering which to use.
Title: Re: 6Dof bullet parameters
Post by: mman on December 14, 2013, 09:51:42 PM
I found the document for McDrag. Sorry about the long link:

https://www.google.fi/url?sa=t&rct=j&q=&esrc=s&source=web&cd=3&cad=rja&ved=0CEcQFjAC&url=http%3A%2F%2Fwww.dtic.mil%2Fcgi-bin%2FGetTRDoc%3FAD%3DADA098110&ei=-cKsUtOMNerJ4AS85oCACw&usg=AFQjCNHjItgIMvxmmiUhflSwuN4yx4WhBg&sig2=xAMolCFUy3Vx4lczxJdp3A

Spinner used in JBM for aerodynamic coefficient approximation ( this could be used as well as intlift)
http://oai.dtic.mil/oai/oai?verb=getRecord&metadataPrefix=html&identifier=AD0915628

Book about SPINNER code (may be the same as above pdf)
http://www.amazon.co.uk/SPIN-73-Updated-Version-SPINNER-Computer/dp/B00B65UG16/ref=sr_1_1/278-7643409-2629854?s=books&ie=UTF8&qid=1387055558&sr=1-1

about spinner code prediction accuracy:
www.dtic.mil/ndia/2004guns/fri/spinner.ppt

Another method for spin damping approximation:
http://www.arl.army.mil/arlreports/2003/ARL-TR-3007.pdf
Title: Re: 6Dof bullet parameters
Post by: admin on December 14, 2013, 11:46:46 PM
thx, have a look at the code in ad0915628 - i mentionned in a previous post that i salvaged much of it. however 6dof equations of motions are not so difficult to implement. the hard thing is to get the aerodynamic coefs right,
Title: Re: 6Dof bullet parameters
Post by: mman on December 15, 2013, 07:24:52 AM
Quote from: admin on December 14, 2013, 11:46:46 PM
thx, have a look at the code in ad0915628 - i mentionned in a previous post that i salvaged much of it. however 6dof equations of motions are not so difficult to implement. the hard thing is to get the aerodynamic coefs right,
Okay, I didn't know it was this SPINNER code you meant.. It's a shame because it could have been pretty accurate at least according to pp presentation of it. And intlift doesn't give all the coefficients but it's a good start.

First version of gyroscopic stability (SG) calculator attached.
I used intlift2 results as an external table as Robert suggested. Sheet is example calculation for Berger 70 gr. VLD bullet. Bullet mass is actually additional input value and one can use it to "SOLVE JACKET THICKNESS" by pressing a button as jacked thickness is hard to measure. Then code iterates jacket thickness until bullet mass given is equivalent with bullet mass calculated from dimensions.

I spent a while wondering what's wrong with ogive ratio. Then I realized that these ogive ratios are not equivalent with other ogive dimensios in Litz's book.
Title: Re: 6Dof bullet parameters
Post by: admin on December 15, 2013, 11:04:15 PM
Cool! a pitty that I cannot embark on the matter myself, I have other science to do.

I know that you can shoot the distances to test your own calculations. Can you measure the distance that your bullets start to toggle (shoot keyholes) because their velocity goes below that of sound (and the nose pressure gets a factor of 3 to 5 higher?).

I would reload as low as safe, to have low muzzle velocities and put paper targets every 10 meters in the neighbour hood where the bullets goes below the velocity of sound.

Probably statistics is involved, hence you should have statistics of the number of keyholes per meter....

?
Title: Re: 6Dof bullet parameters
Post by: mman on December 16, 2013, 06:54:35 AM
That is certainly possible. However I don't have the calculations to compare at the moment. This keyholing at transsonic velocity is usually due to dynamic instability which I cannot calculate. I would need couple more aerodynamic coefficients: spin damping moment coefficient and magnus moment coefficient.

If you look at lapua's radar drag data you can see possible effect of instability for various bullets at subsonic velocity regime. Drag usually seems to increase quite rapidly. Possibly there you could see keyholing as well.
Title: Re: 6Dof bullet parameters
Post by: admin on December 16, 2013, 06:40:24 PM
but the missing values are small?
Title: Re: 6Dof bullet parameters
Post by: mman on December 16, 2013, 07:47:45 PM
Well, no. When it comes to dynamic stability, without them two guys and pitch damping moment coefficients I have nothing.

Look at McCoy's pages 233-234 and 37-39. It should explain it.
Title: Re: 6Dof bullet parameters
Post by: mman on February 05, 2014, 07:37:58 PM
Robert anything new on bfx implementation?
Title: Re: 6Dof bullet parameters
Post by: admin on February 07, 2014, 12:24:30 AM
no, i cannot lay hands on a proper set of formula's for the bullet 6dof parameters.
Title: Re: 6Dof bullet parameters
Post by: mman on February 07, 2014, 05:44:12 PM
Shame..Not even intlift?