Not sure of the logic of $40k for a battery. It would have to be appalling to have to replace the entire battery.
Agreed, you could plug in lower cost assumptions for the battery swaps, but that would also make Tesla's profit margin on the warranty higher.
Another way to look at the warranty cost - at $7,500 over three years, Tesla could have spent $48K on each one of the 17 battery swaps and still come out even. No question there's a healthy profit margin built in.