![]() |
Open sourced automatic TMA calculator
Download link: http://www.subsim.com/radioroom/down...o=file&id=5458
I decided to share my personal TMA calculator suitable for figuring out target course/speed/distance using bearing only information. The calculator uses metric system and is particularly designed for Wolfpack. It's an old school C++ console for quick input/output, so you enter parameters one by one according to the console display and then you got the results. (Source code: https://github.com/LJQCN101/Auto-TMA-console) For example, I recorded 3 bearings at a 2-minute interval with my boat staying still using AP connected to TDC, so I can get some pretty precise readings from TDC heading dial: 321.3, 326.48, 330.9 in this case. Inputted into the calculator and got a target course of 32.8deg. Then I moved straight forward for 935m with my heading 20deg, and took the 4th bearing 334.5 at time 8:30. Put them all into the calculator, and I got the target course 32.8deg, speed around 8 kts, distance 4716m. The calculator is not limited to this situation and you are allowed to move and steer the boat as you want. http://www.subsim.com/radioroom/down...ma_0.3_V9D.jpg |
welcome back!
ljqcn101!:Kaleun_Salute: AFTER A SIX YEAR SILENT RUN!
|
Added an example which is similar to the last section of game manual.
|
Thanks! :Kaleun_Cheers:
|
For anyone who is interested in the formulas or wants to implement in other apps:
First I set three unknown variables, 1. target distance at first bearing as "L1_distance" 2. target course as "crs" 3. target speed as "spd" And I let ownship coordinate (m,n) initiate at (0,0). Y axis points to north (0 deg), and X axis points to east (90 deg). All angles start at Y axis and rotate in clockwise direction. So we can get: 1. target speed component on x axis "u" = spd * sin(crs) 2. target speed component on y axis "v" = spd * cos(crs) 3. target coordinate (a,b) at first bearing = L1_distance * sin(brg1), L1_distance * cos(brg1) 4. target coordinate (x,y) at each time = (a+u*t, b+v*t) 5. the vector pointing from ownship to target = (x-m, y-n) By knowing the bearing of this vector, we can get the bearing vector equation: (y-n)*sin(brg) = (x-m)*cos(brg) Since we have three unknown variables to solve, in order to make sure the left hand side of the equation is really close to the right hand side, we can use the least square method: Let formula f(t) = (y-n)*sin(brg) - (x-m)*cos(brg) So we need to minimise the sum of squared f(t) for all bearing vectors. I used BFGS algorithm to solve this utilising C++ Dlib library. |
Next version I'm planning to add random -/+ 0.5 deg noise to the bearing inputs and do some basic error analysis on the solution, so players can decided if they want to continue record bearings or just use the current solution.
Interest myself to see how much impact it has to those 3-bearing AOB or 4-bearing methods. |
Quote:
I'm using this tool to quickly work out the AOB vs bearing differences for the stationary 3-bearing method: http://www.subsim.com/radioroom/showthread.php?t=147719 It is based on the following math formula: cotangent (AOB) = cotangent (B2-B1) - 2*cotangent (B3-B1) Let's say we start taking bearings when a target happens to show an AOB of 21 degrees to it's course at the first bearing. Starting with the a time taken for an initial bearing difference of 6 degrees then the 3rd bearing will be around 16 degrees from the first. If you consider the edge cases of 0.5 degree bearing inaccuracies you would end up with the 2 situations that show the biggest variation to AOB: B2-B1 -1 degree ; B3-B1 +0.5 degree B2-B1 +1 degree; B3-B1 -0.5 degree This results in a AOB range of 35 degrees: 5 vs 16.5, AOB = 12 degrees 7 vs 15.5, AOB = 47 degrees This range of possible AOBs might be acceptable. But you are not always as lucky to find a target this far away still on the horizon. In these situations, but also when it is moving away, the AOB convergence goes quickly. But the nearer the target is to the horizon, the slower the bearing drift becomes. Ultimately a snails pace. The closer you are to the point where the target starts with an AOB of 90 the harder it becomes to notice a change in bearing drift. It is pretty constant in that area. For example, with an AOB of 70, and a time interval worth 6 degrees the 3rd bearing would indicate 12.35 degrees of drift. We are not able to measure to such precision, but let's assume we were. Then with the above mentioned bearing difference errors this would entail an AOB range between 21 and 145 degrees. That is certainly not very useful. But with periscope sightings instead, and measuring using the heading dial on the TDC this situation will have much better results. We have several options to increase the change in bearing. First, to double up the interval, meaning we would have to stay listening stationary for a total of 4 original time intervals. If the target started again at 70 degrees AOB at bearing 1, but we instead listen at the double duration then bearing 2 was likely recorded as 12 degrees. And subsequent the third would come around 25 degrees from the first. This would lead to a AOB-range of 46-91. That is substantially narrowed, but still pretty wide. We could also re-use the 2nd and 3rd bearings and wait for the 4th from a stationary position. Then we can verify our first three bearings for correctness. If we additionally listen half-way through the 2nd interval we can use B1, B2.5 and B4 to get AOB based on a wider bearing change range. The latter one will have the possible AOB range narrowed down. With the superior speed on the surface vs the convoy it would seem using the moving 4-bearing method, as described by Kuikueg and Neuro, is more effective. As one is able to move perpendicular to the bearings to either side in order to increase the bearing changes. But perhaps this only becomes necessary when the game provides more challenging convoy spawn distances. Simply moving towards the sound, with a intermediate hydrophone check is still the simplest option. |
Thanks Pisces for the analysis on 3-bearing AOB method!
I've just released v0.3 and added probability calculation for positional/course error distributions, assuming a random inaccuracy of bearing input within a range of -0.5 to 0.5 deg. The probability is computed over 1000 iterations. Since this tool uses least squares optimisation to interpolate an solution, I can keep the original time interval and take one more bearing to further reduce the impact from bearing inaccuracies. An example of recording a 5 deg/min bearing rate target when stationary: Code:
time t1 = 0 (sec) But looks like simply increasing the time interval virtually achieved the same result: Code:
time t1 = 0 (sec) |
Hi!
Can you please tell me which Windows version did you use? My copy refuses to be installed an dI guess it has to do with that. |
Quote:
|
I am currently working on a method based on radial speed rule
(Bearing Rate=(Target Speed*sinAOB-Ownspeed*sin(LeadingAngle))/Range) By taking into consideration that the new AOB=PREVIOUSAOB+BEARINGCHANGE Then if you apply the Rule of Sins for three individual bearing shootings and counting manualy the bearing rate, you can have a final equation with an unkown target speed or sinAOB. The maths are too long for the moment and require patience! |
Quote:
For computational convenience the boat is always assumed to be able to instantaneously change speed or course at each observation point, but in reality it cannot. And any departure from these idealisations introduce errors. That's why I use distance and direction between two observation points for computation. |
All times are GMT -5. The time now is 05:44 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 1995- 2025 Subsim®
"Subsim" is a registered trademark, all rights reserved.