Main Menu

Recent posts

#61
Ballistics / Re: Weapon Employment Zone
Last post by 375CT - July 02, 2014, 06:20:43 AM
In case you guys need to go VB.net some day here is a useful RNG (Gaussian) snippet I tested and works really well. The original code was written in C# which I later converted.

Public Class RandomGenerator
 
Private ReadOnly _random As Random
'indicates that an extra deviates was already calculated 
Private _hasAnotherDeviate As Boolean
'The other deviate calculated using the Box-Muller transformation 
Private _otherGaussianDeviate As Double
Public Sub New()
Me.New(New Random())
End Sub

Public Sub New(ByVal seed As Integer)
Me.New(New Random(seed))
End Sub

Public Sub New(ByVal random As Random)
_random = random
End Sub

' returns a normally distributed deviate with zero mean and unit variance. 
' Adapted from Numerical Recipe page 289: Normal (Gaussian) Deviates
 
Public Function NormalDeviate() As Double
Dim rsq, v1, v2 As Double
If _hasAnotherDeviate Then
'we have an extra deviate handy. Reset the flag and return it     
   _hasAnotherDeviate = False
  Return _otherGaussianDeviate
End If
Do
v1 = UniformDeviate(-1, 1) 'pick two uniform number
v2 = UniformDeviate(-1, 1) 'in the square extending from -1 to +1
rsq = v1 * v1 + v2 * v2 'see if they are in the unit circle
Loop While rsq >= 1.0 OrElse rsq = 0.0
'now make the box-muller transformation to get two normal deviates. 
Dim fac As Double = Math.Sqrt(-2.0 * Math.Log(rsq) / rsq)
'Return one and save one for next time
_otherGaussianDeviate = v1 * fac
_hasAnotherDeviate = True
Return v2 * fac
End Function

' Returns a uniformly distributed random number between min and max.
Public Function UniformDeviate(ByVal min As Double, ByVal max As Double) As Double
Return (max - min) * _random.NextDouble() + min
End Function

' Returns a random number between 0 and 1 
Public Function NextDouble() As Double
  Return _random.NextDouble()
End Function

End Class
#62
Ballistics / Re: Weapon Employment Zone
Last post by 375CT - July 01, 2014, 08:11:31 PM
Mman,

Great work, really liked the new sheet. Sorry if I miswrote my question, but I meant that MC was just for creating the random sampling, then applying CEP to yield the HP in one of the calcs you did. Please correct me if I'm wrong.

Got it regarding the variations and SD inputs.

Any time later, english comments would be nice, my finnish is awful  :(
#63
Ballistics / Re: Weapon Employment Zone
Last post by mman - July 01, 2014, 11:28:38 AM
Quote from: admin on July 01, 2014, 10:44:34 AM
Quote from: mman on July 01, 2014, 09:12:33 AM

This input field allows you to move group center in relation to target, if that is what you meant?


Yes. I our case, at 300m, people aim with their telecopes at a white sticker 20cm below the electronic target center.
But I guess aiming error is compensated with equivalent scope correction so that group center is on correct place?

You can download my wez tool from here:
http://wikisend.com/download/171348/WEZ CEP&MC eng.xlsm

Most of it is still in finnish, sorry.
#64
Ballistics / Re: Weapon Employment Zone
Last post by admin - July 01, 2014, 10:44:34 AM
Quote from: mman on July 01, 2014, 09:12:33 AM

This input field allows you to move group center in relation to target, if that is what you meant?


Yes. I our case, at 300m, people aim with their telecopes at a white sticker 20cm below the electronic target center.
#65
Ballistics / Re: Weapon Employment Zone
Last post by mman - July 01, 2014, 09:12:33 AM
Quote from: admin on June 30, 2014, 08:08:28 PM
would it be possible to include the effects of a hold over/under (and the horizontal equivalent)? (in combination with cant)

This input field allows you to move group center in relation to target, if that is what you meant?



Quote from: 375CT on June 30, 2014, 08:55:22 PM
Is this WEZ tool inlcuded in your Hit Prob spreadsheet? Asking because I'd like to ry it if you don't mind.
Yes, it is. I'll attach it later today.

Quote from: 375CT on June 30, 2014, 08:55:22 PM
LIked the idea of going Monte Carlo for the random sequence then using CEP for hit prob. Nice touch.
That's not the case. I calculated hit probability with two different methods:
1. CEP which is nothing to do with random sequence. Basicly it is just analytical way to express hit probability on round target.
2. Monte carlo which is based on Robert's rang.

Quote from: 375CT on June 30, 2014, 08:55:22 PM
Not quite clear the difference in the MV fields errors, any more detail will be kindly grateful.
On dispersion factors field you define SD of group (all values are expressed in standard deviations). On group center bias field you define how far away in average group center is from target center.
e.g. "Muzzle velocity variation" of 3 m/s means that your MV SD is 3 m/s. "Wrong muzzle velocity" of 3 m/s means that you have assumed muzzle velocity to be 3 m/s higher than it actually is. --> Your ballistic calculation gives you wrong holdover/scope correction clicks which leads to group center shift downwards.
#66
Ballistics / Re: Weapon Employment Zone
Last post by 375CT - June 30, 2014, 08:55:22 PM
Mman,

Is this WEZ tool inlcuded in your Hit Prob spreadsheet? Asking because I'd like to ry it if you don't mind.

LIked the idea of going Monte Carlo for the random sequence then using CEP for hit prob. Nice touch.

I know, you guys are Excel experts, now I'm going to have to do some VB.net and see what I can come up with.

Not quite clear the difference in the MV fields errors, any more detail will be kindly grateful.
#67
Ballistics / Re: Weapon Employment Zone
Last post by admin - June 30, 2014, 08:08:28 PM
Cool.

would it be possible to include the effects of a  hold over/under (and the horizontal equivalent)? (in combination with cant)
#68
Ballistics / Re: Weapon Employment Zone
Last post by mman - June 30, 2014, 05:16:20 PM
Thanks Robert! I made another WEZ tool based on monte carlo using your bfx_Rang random number.

Input values:



CEP based WEZ versus monte carlo based WEZ. Results for 4 different bullets/conditions.



+/- values for monte carlo are to show 95 % confidence interval which means that 95 % of the time error is less than that. To get that narrow confidence interval I had to calculate 100 000 simulations per bullet per range. It took 92 minutes while CEP tool did the same (and other calculations as well) in 7 sec. However CEP tool seems to give errors of 0 - 7 percentage points. As expected CEP tool is still most of the time good enough for comparison.
#69
Ballistics / Re: Weapon Employment Zone
Last post by admin - June 29, 2014, 02:40:13 PM
From Bfx_help(...)
90   ==========================Non volatile random numbers===========================
91   i is a positive integer number, b is the bottom value, t (>b) is the top value
92   <r> is an optional range
93   random_number = BfX_Ran(i; <r>) 0 <= random_number <= 1]
94   b <= random_number <= t = BfX_Ranb(i; b; t; <r>)
95   c and s are center and width of normal distribution
96   normal distribution b <= random_number <= t= BfX_Rang(i; c; s; b; t; <r>)
97   use <r> to link cells to guide Excels calculation order

i is the seed.

<r> is a cell or a range

B   C   D
2   seed   1234567
3      
4   0,051118901   =BfX_Ran(seed)
5   0,207298019   =BfX_Ran(seed;C4)
6   0,529684412   =BfX_Ran(seed;C5)
7   0,164931189   =BfX_Ran(seed;C6)
8   0,760708209   =BfX_Ran(seed;C7)
9   0,711878956   =BfX_Ran(seed;C8)
10   0,434484066   =BfX_Ran(seed;C9)
11   0,032066679   =BfX_Ran(seed;C10)
12   0,018770791   =BfX_Ran(seed;C11)
13   0,197369616   =BfX_Ran(seed;C12)
14      
15   bfx_ran    refers to the previous cell in order to force
16      a specific order of random number (cell) processing

My random number is non volatile.
Volatile means according to MS:
Excel supports the concept of a volatile function, that is, one whose value cannot be assumed to be the same from one moment to the next even if none of its arguments (if it takes any) has changed. Excel reevaluates cells that contain volatile functions, together with all dependents, every time that it recalculates. For this reason, too much reliance on volatile functions can make recalculation times slow. Use them sparingly.

The following Excel functions are volatile:

    NOW

    TODAY

    RAND

    OFFSET

    INDIRECT

    INFO (depending on its arguments)

    CELL (depending on its arguments)
#70
Ballistics / Re: Weapon Employment Zone
Last post by mman - June 28, 2014, 09:24:37 AM
Robert can you explain input values of your random number generators?