Scientists inflated the penises of dead dolphins so they could simulate sex between the marine animals and take notes.

The researchers wanted to study how the genitals of cetaceans like dolphins, whales and porpoises fit into one another, including what sections of the penis and vagina touch one another during sex and how deep the penis penetrates the vagina. They collected specimens that had already died of natural causes and detached and manipulated the sex organs, including creating dolphin erections, to reveal their secrets.

The team reported their process in the journal Proceedings of the Royal Society B, writing that the simulations were done to better understand the mechanics of sex between these creatures. The emphasis of their research was on the shape of the genitals — it was about the relationship between form and function.

According to the study, the research gives a window into how penises and vaginas have evolved because marine mammals “have diverse genitalia and are adapted to aquatic living and mating.”

One big difference given as an example in the study is that male seals have penis bones but cetaceans have a “fibroelastic penis.” In addition, female cetaceans have “muscular vaginal folds” but seals have none at all.

As the genitals of the dead animals were brought together in a copulation simulation, the researchers used high-resolution scans to get comprehensive views of the union.

According to a report on the research, the penis samples were taken from bottlenose dolphins, common dolphins and harbor porpoises.

“Penises were inflated with saline solution and then slipped into vaginas,” the report said, “to see how they fit and which parts of the organs of one gender interacted with which parts of the other.”

The researchers wrote in their study that in addition to using vaginas excised from recently deceased animals, they inserted the erect penises into silicone vagina casts.

They said with different species of cetaceans, they found evidence of different evolutionary processes — either congruent or antagonistic coevolution of the genitals. In antagonistic coevolution, the male and female sex organs evolve in shape to balance for the traits of the other, while congruent coevolution more involves changes that mirror one another over time.

“With the common dolphin, copulation tended to be what it seemed — a straightforward means of mating,” the report said. “But things were different with the harbor porpoises and bottlenose dolphins — the structure of the vagina was arranged such that the female could channel sperm away from her eggs if she so desired, allowing her to choose which male would inseminate her.”

Part of the difficulty of getting this information without excising the genitals of dead dolphins is that sexual contact between these marine animals takes place out at sea and the creatures don’t hand scientists an itinerary so that they are watching at the right time. That is why the researchers worked with fishermen to collect dolphins and porpoises that had died of natural causes.

“This study improves our understanding of how mechanical interactions during copulation influence the shape of genitalia and affect fertility,” the authors wrote.

The results can also help conservation experts, and help scientists better understand how sex works in other species as well.