How a determined scientist cracked the case of the first successful - and disastrous - submarine attack.