the work is dedicated to the problem of mathematical modeling of track circuits during a rail break in complex configuration track circuits. In the first part of the article, a methodology for calculating the A-parameters of the equivalent four-pole of the track circuit is presented, which allows for the use of computers to avoid the analytical solution of the equation system based on boundary conditions for determining the integration constants, and subsequent derivation of analytical expressions for determining the A-parameters. This methodology is described using the simplest case of a rail break in an unbranched track circuit bounded by insulating joints. In the second part, an example of implementing the described methodology in the form of program code in the Python programming language on this simplest example is provided, demonstrating practical coincidence with the results calculated using known formulas. In the third part of the article, equations are presented that allow using the presented methodology to calculate the A-parameters of the equivalent four-pole of the rail line of a branched track circuit with three switches and four relay ends for all possible variants of rail break localization.