[2] He was given leave of absence in 1782 and was called to Stockholm in 1788 to assist with the organization of the Royal Swedish Academy of War Sciences.
Among his works on the theory of the Moon was De theoria lunae commentarii (1769), in which, with the theory of gravitation as a starting point, the motion of the Moon is determined, and related problems are solved according to other, partly simpler, methods than those given by Clairaut, Euler and Lagrange.
Among the subjects of his other writings are transits of Venus, the atmospheres of the planets and the method of determining the equation of time.
He also tried to support academic teaching in this area and to this end published a new edition of Newton's work on the quadrature of curves, which he provided with notes and additions.
[1][2] Melanderhjelm on literary subjects wrote, for example Om nyttan af ett eget de lärdes språk (on the benefit of one's own language).