![]() |
SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997 |
|
![]() |
#1 |
Sailor man
![]() Join Date: Jan 2013
Location: Hong Kong
Posts: 50
Downloads: 78
Uploads: 3
|
![]()
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. ![]()
__________________
Automatic TMA calculator (metric system) Automatic TMA line detector and solver for DW/SC/688i Automatic TMA line detector and solver for maneuvering target (new) Last edited by ljqcn101; 04-14-19 at 11:25 PM. |
![]() |
![]() |
![]() |
#2 |
Gefallen Engel U-666
|
![]()
ljqcn101!
![]()
__________________
"Only two things are infinite; The Universe and human squirrelyness?!! |
![]() |
![]() |
![]() |
#3 |
Sailor man
![]() Join Date: Jan 2013
Location: Hong Kong
Posts: 50
Downloads: 78
Uploads: 3
|
![]()
Added an example which is similar to the last section of game manual.
|
![]() |
![]() |
![]() |
#4 |
Samurai Navy
![]() Join Date: Nov 2005
Location: Atlántico Sur
Posts: 558
Downloads: 401
Uploads: 0
|
![]()
Thanks!
![]()
__________________
Cold Waters 1968 Campaign LINK a lista de Youtube My Blog: www.marenguerra.blogspot.com |
![]() |
![]() |
![]() |
#5 |
Sailor man
![]() Join Date: Jan 2013
Location: Hong Kong
Posts: 50
Downloads: 78
Uploads: 3
|
![]()
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. |
![]() |
![]() |
![]() |
#6 |
Sailor man
![]() Join Date: Jan 2013
Location: Hong Kong
Posts: 50
Downloads: 78
Uploads: 3
|
![]()
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. |
![]() |
![]() |
![]() |
|
|