At fifteen she married a duke of thirty-one. When he died, his will shut her out of the government that would rule for their son. It did not shut her out of very much else.

On 20 October 1577, at Wolgast, Sophia Hedwig of Brunswick-Wolfenbüttel married Ernst Ludwig, Duke of Pomerania-Wolgast. Her sixteenth birthday was still six weeks away. Her parents had begun negotiating the marriage while she was young, and they had spent the intervening years making sure that the daughter they were sending into another ruling family arrived equipped for it.

Her father was Duke Julius of Brunswick-Wolfenbüttel. Her mother, Hedwig of Brandenburg, was an elector's daughter. Both set great store by a careful education, and one trace of it survives: a notebook from around 1575 that the girl filled with exercises in Latin and French. It belongs to the years just before her marriage. Its pages held the exercises of a girl who was being prepared for a place in the world, although the place itself was being negotiated by other people.

She entered a court where learning and expensive display lived comfortably together. Ernst Ludwig gave the university at Greifswald new statutes and commissioned a new college building for it. He also kept a splendid household in the restored castle at Wolgast. The splendour steadily weakened finances that were already in poor shape. A fine court could advertise a dynasty's importance rather more easily than it could pay its bills.

They had two daughters, Hedwig Maria and Elisabeth Magdalena, followed by a son, Philipp Julius. When Ernst Ludwig died in June 1592, Sophia Hedwig was thirty and their son was seven. The duke's will entrusted the boy's guardianship to his brother Bogislaw. Sophia Hedwig was excluded from the government that would rule during his minority.

She remained his mother.

The children stayed with her, and she set up her widow's household at Loitz. This was a small town on the Peene with a castle and an administrative district, a place where land, income and the work of officials paid for the provision made for a ducal widow. The castle stood on a hill surrounded by a moat. Across the town was the church of St Mary. Both buildings would bear the marks of her presence.

Widowhood brought property and responsibilities as well as restrictions. At Loitz, Sophia Hedwig rebuilt and enlarged both the castle and the church, and she borrowed heavily to pay for it. A household suited to her rank brought further expense. Being shut out of the duchy's government did not make a ducal court any cheaper to run.

Nor did it keep her out of her son's education. In 1597 she returned with the family to Wolgast, where Philipp Julius received the scholarly and courtly training meant to fit him for rule. Later she pressed for him to travel abroad. The boy whose government had been given to an uncle still had a mother taking an active interest in what he ought to learn.

While he was away, she visited the administrative districts herself and heard their accounts. She had organised the cultivation of the estate at Jamitzow near Lassan. She founded a brickworks and a wool manufactory, and invested in salt and iron. The widow left out of the formal guardianship made officials answer to her all the same. None of it cleared the debts. She kept trying, inventively and stubbornly, to bring them under control, and never managed it. Energy and economic knowledge did not guarantee that the figures would come right, and the household went on costing more than her estates could comfortably bear.

It also supplied medicines.

In 1617 the Augsburg art agent Philipp Hainhofer visited Pomerania and suffered from dizziness during his stay. Sophia Hedwig had a medicinal water and powder prepared and sent to him by her distiller. During the same visit, her court apothecary supplied medicines to her officers and servants and to the poor of the town, and she gave alms. Loitz still remembers her as a duchess whom plague could not keep from the poor and the sick. The household that cost so much could also put something useful into another person's hands.

Books had their place in it too. At St Mary's she ordered a library to be established and gave it her own eight-volume edition of Luther's works, handsomely bound. In the same church she had a gallery of coats of arms made for sixty-two of her ancestors, the family she had brought with her to Pomerania at fifteen. Her portrait, painted beside her husband's, hangs there as well, looking straight at whoever stands in front of it.

Sophia Hedwig died on 30 January 1631, aged sixty-nine, while imperial and Swedish troops fought around nearby Demmin. The castle where she kept her court has gone, and so has the hill it stood on. The eight volumes she gave St Mary's are still in Loitz, the books of a woman who had come to her wedding at fifteen with a notebook of Latin and French exercises behind her.