DrStupid said:
However, this argumentation requires that the period of the oscillation is short compared to the time of the flyby and therefore also depends on the starting conditions. Without a corresponding calculation (or at least rough estimation) I cannot say if this is the case - especially if the process starts near the instable equilibrium (horizontal orientation of the ship or standing upside-down in case of the pendulum analogy).
For the case that the ship is small compared to the distance, the angular acceleration can be estimated with the quadrupole moment of the gravitational field:
\ddot \varphi = - 3 \cdot M \cdot G \cdot \frac{{\left( {r \times R} \right) \cdot \left( {r \cdot R} \right)}}{{r^2 \cdot \left| R \right|^5 }}
The minimum period of the resulting oscillation is
T < 2 \cdot \pi \cdot \sqrt {\frac{{\left| R \right|^3 }}{{3 \cdot M \cdot G}}}
As this is only by the factor sqrt(3) below the duration of a full circular orbit in the same distance, the requirement for the pendulum analogy is not fulfilled. The ship doesn't oscillate during the flyby.
As I do not have another idea how to answer this question without calculation, I tried to solve the equations of motion numerically. But all tested integrators failed to solve the three dimensional problem (x,y,orientation) for the conditions given by the OP (I didn't even try to simulate rotations around more then one axis). Thus I turned to polar coordinates and used the equation
\left| R \right| = R_{\min } \cdot \frac{{1 + \varepsilon }}{{1 + \varepsilon \cdot \cos \vartheta }}
for the trajectory in order to reduce the problem to the orientation only. Then I eliminated the time to avoid the numerical problems resulting from the high velocities and accelerations during the close flyby. The resulting differential equation was a surprise (at least for me):
\varphi '' = \frac{{\varphi ' \cdot 2 \cdot \varepsilon \cdot \sin \vartheta - 3 \cdot \left( {\cos \varphi \cdot \sin \vartheta - \sin \varphi \cdot \cos \vartheta } \right) \cdot \left( {\cos \varphi \cdot \cos \vartheta + \sin \varphi \cdot \sin \vartheta } \right)}}{{1 + \varepsilon \cdot \cos \vartheta }}
I didn't expected it to be independent from the mass of the star and the periapsis distance. However, it still depends on the starting conditions. As we don't have any information about possible starting conditions and their probabilities, no general answer can be given. Thus I tried to solve the problem at least for the following special starting conditions:
- Start in Apoapsis or infinity
- No starting angular velocity
- Equally distributed starting orientations
The result was even more surprising:
There actually are preferred orientations for eccentricities below 2, but they are not vertically as expected in most of the posts above. Instead the ship is most likely turned out of the vertical orientation by at least 18°. This is so very counterintuitive that I initially expected an error in my calculation. Thus I repeated it several times with different derivations and numerical methods but I always get the same result.