In December 1939, Britain had been at war with Germany for three months. U-boat attacks threatened incoming food shipments. And, armed with bicycles and walking boots, a group of medical researchers headed to the Lake District to conduct a secret study: if Britain was totally cut off from food imports, would starvation hand victory to Germany?

This was an important medical question. Could the public stay fighting fit if food was rationed to what Britain alone could produce? If the ration was too low in protein, people would get "famine oedema" (swelling from fluid build-up). Before the war, Britain imported half its meat, more than half its cheese and a third of its eggs. Much of the protein in the British diet would therefore be lost if a shipping blockade succeeded. Anaemia (insufficient iron) and scurvy (lack of vitamin C) could also become a problem.

The rationed diet had to provide enough fuel for the long hours in factories and farms needed for the war effort. If people were too weakened by lack of food, infectious diseases would pick them off, just as surely as bullets. Disease played a key part in deciding who won wars. Famously, Napoleon lost his Russian campaign in 1812 after his army was decimated by typhus and dysentery. In total war, it wasn't just the army who had to stay well to win. The home front also had to remain healthy. Having a sufficient diet was a medical issue that went to the heart of the war effort.

The researchers investigating whether Britain could win the food fight were Cambridge University physiologists Elsie Widdowson and Robert McCance. When war broke out, Elsie and Mac felt they could use their expertise in food and nutrition to answer whether, if German U-boats crippled food imports, would Britain be dieted into defeat?

Widdowson and McCance decided to experiment on themselves. Four students and Mac's mother-in-law also volunteered. They would pretend that a German shipping blockade had curtailed imports and they had to eat only British food. Everyone would get equal shares of the available produce. To work out what this might be, Elsie and Mac sought advice from Frank Engledow, a professor of agriculture who later helped set wartime food policy. British food production in 1938 became the basis for the experimental diet: one egg a week (a third of the pre-war consumption); a quarter of a pint of milk a day (half the pre-war consumption); a pound of meat and 4oz of fish per week, assuming trawlers would be commandeered for patrols. No butter and just 4oz of margarine. But they could eat as much potato, vegetables, and wholemeal bread as they wanted. The eight guinea pigs would follow this diet for three months.

Happily, the gloomy spectres of famine oedema, scurvy, and anaemia did not arise. The guinea pigs felt fit and well on the ration and could do their usual work. But there were two main difficulties. One was that meals took a long time to eat. Wholemeal bread without butter took ages to chew. The sheer quantity of potato needed to make up calories also took time to eat. All the fibre in the diet caused 250% bigger poos. They measured it.

The other problem with eating all that starch was the amount of flatus – gas – that it produced. The consequences could be, in Widdowson and McCance's description, "remarkable".

To simulate the hardest physical work that might be expected of people during the war, some of the team headed to the Lake District for an intensive fortnight of walking, cycling and mountaineering. It was tough going with snow and ice on the paths. But other than a sore knee for Elsie, the team did well enough that a professional mountaineer rated their performance "distinctly good". And this was on the diet that might be the lot for all Britain if shipping imports failed.

In 1940, the British government rationed bacon, butter and sugar, just as the team finished their trial. Their report and its conclusion – that Britain could stay fighting fit even if all food imports were lost – was circulated to government departments. But the study was kept secret until after the war. As more foods were rationed, the experiment provided assurance that home front health was secure. Had the conclusion been different, Britain may have had to decide whether to distribute the limited food equitably – and suffer the consequences of widely degraded health – or give more food to workers most important to the war effort. Elsie and Mac's experiment showed this horrible reckoning was not necessary: Britain could afford to be fair and still be fighting fit. As it turned out, the experiment had been too severe. Rationing was always more generous with butter, sugar, meat, and fish than Elsie and Mac's diet. Convoys from America and Canada were able to run the U-boat blockade and flesh out British food supplies.

Rationing during the second world war caused problems – it was hard to cook inventively with limited ingredients, and queuing for supplies burdened housewives. But Elsie and Mac's study showed that scurvy and starvation would not add to that burden.

• This article was a highly commended entry to the Wellcome Trust Science Writing Prize in association with the Guardian and the Observer, the winners of which were announced last week