How the Sun's position is calculated
The Sun's position is computed from the astronomy library's solar model. Its sidereal longitude gives the Sun's rashi and, with the Moon, the tithi and yoga.
What it is
The Sun moves about one degree a day, and its position is computed for the birth instant. The sidereal longitude is the ecliptic longitude minus the ayanamsa, in the same way as the other grahas.
How it is worked out or read
The Sun's position is used in the tithi (the difference from the Moon), the yoga (the sum of the Sun and Moon), and the Rahu Kaal calculation, which depends on sunrise and sunset.
Where it appears on this site
The Sun's position is shown in the birth chart and used in the panchang.
The Sun's uneven pace
The Sun appears to move about one degree a day along the ecliptic, but not at a perfectly steady rate. The Earth's orbit is slightly elliptical, and the Earth is closest to the Sun, at perihelion, in early January and farthest, at aphelion, in early July. So the Sun appears to move fastest in early January, a little over 1.01 degrees a day, and slowest in early July, a little over 0.95. The difference between the Sun's actual position and the position it would have if it moved uniformly is called the equation of centre, and it reaches nearly two degrees.
Steps in the calculation
A simple calculation of the Sun's position starts from its mean longitude, which grows at a steady rate from a reference date, and its mean anomaly, the angle from perihelion. The equation of centre is computed from the mean anomaly and added. Smaller corrections follow for nutation and aberration. The result is the Sun's apparent tropical longitude. Modern libraries do this with many more terms and reach an accuracy of a few seconds of arc. Subtracting the ayanamsa then gives the sidereal longitude used in Jyotish.
Why the solar months differ in length
Because the Sun moves at different speeds through the year, it spends different amounts of time in each sidereal sign. It passes through the signs around January more quickly and through those around July more slowly. The solar months of the regional solar calendars, which run from one sankranti to the next, therefore vary from about 29.4 to about 31.5 days. This is a direct, visible consequence of the elliptical orbit in the calendar.
Where the Sun's position is used
The Sun's sidereal longitude decides the sankrantis, the solar months and many festivals. Its angle from the Moon gives the tithi, and its sum with the Moon gives the panchang yoga. Its tropical longitude and declination decide sunrise and sunset, which in turn fix the panchang day, Rahu Kaal and Abhijit. In a chart, its sign and house are among the first things a reader notes. Few calculations in Jyotish do not depend on the Sun somewhere.
Checking it yourself
A reader can check the Sun's position roughly without any software. Mesha Sankranti, the Sun's entry into sidereal Mesha, falls around 14 April in the current era, and the Sun moves about one sign a month after that. So in mid-August the Sun should be near the start of Simha, and in mid-December near the start of Dhanu. A chart that shows something very different has an error somewhere.