Wave Simulation

The wave simulation models how the boat I built (see Daedalus) translates and rotates in waves via code I wrote in Python. I made this model for two reasons: to aid in the design of a gyroscopic stabilizer for my boat and for fun! Below is an animation of the resulting motion found.

Animation of the resulting motion of my boat in a wave.


Coordinate Systems

The image below shows the coordinate system setup, where there is a fixed global coordinate system and a body fixed boat coordinate system.

Global coordinate system XYZ, and body fixed (boat fixed) coordinate system.

Equations of Motion

The model is based on rigid body dynamics. The equations of motion that I derived are shown at the bottom of the below image, with some of the key equations that are substituted into it shown, too. For a detailed explanation, view my report.

Key equations and the equations of motion.

The wave interaction with the boat is approximated as a buoyancy force acting at the center of mass of the displaced water. The displaced water is shown in blue in the image below, and its center of mass and buoyance force is shown.

Boat hull (clear white), and displaced water (clear blue) along with the displaced water center of mass and buoyancy force.

To compute the displaced water, my boat is voxelized, as shown on the left of the below image (coarse voxelization viewing purposes). The voxels are then translated and rotated to compare to the wave surface, leaving only the voxels below the surface of the wave. From that, the center of mass of the displaced water and the buoyancy force is calculated.

Left voxelized hull. Right corresponding hull geometry; looking at the bottom of the hull.

The discrete nature of voxelization causes instability (due to discrete jumps in the residuals as a voxel crosses the wave boundary). To combat that instability and to model the viscosity of the water, I added viscous damping, which greatly improved the stability and made the results appear more realistic.


Solver

I programmed an iterative solver that solves each time step. Since the EOM is highly nonlinear, it was very difficult to reduce the residual to near zero consistently. After much experimentation, I found a hybrid coupled and weak coupled solving method (details in report) that works consistently, but it takes hours to run.


Animations

Below is an animation of the results with nearly no damping (it took around 12 hours to solve). As you can see, at t = 38 seconds, the boat does a flip. I believe this is due to the instability caused by the discrete nature of voxelization, which can’t be masked by the tiny amount of damping.

Animation of results with barely any damping.

Below is a much earlier result; as you can see, it has some stability problems due to no damping and a few bugs in my code.

Early animation result


All Degrees of Freedom

All the animations above are only solving for four degrees of freedom and assuming x=0, y=0 (the boat doesn’t move horizontally). I’m currently working on solving for all degrees of freedom, but I’m having some issues where the boat flys away horizontally.

Below is an unrealistic result that I’m working on troubleshooting. My plan is to animate all the forces (as vectors on the boat) to try to find if a force is in the wrong direction, as from pouring through plots and equations, I can’t find anything wrong. Additionally, I’m going to take a deeper dive into the solver to make sure it is not finding other bad solutions, as due to the nonlinearity, the system would have multiple solutions.

This is a more recent result where I’m now solving for the more meant in the x,y direction (all degrees of freedom). For some of them, they can act strangely, and I’m currently looking into why it not working very well for all degrees of freedom

Report

If you are interested in more details, please take a look at the report I wrote below. I always intended to do this project because it was fun, but I also used it for a final project for an intermediate numerical methods class. This project was much more complex than what was expected for the class. The professor shows my project now as an example of a final project.

Since writing the report, I’ve continued working on the project and have nearly completed all the future work identified in the paper. Such as better animations, higher order finite difference, better solvers methods, and multiple solving passes, which really reduce the residuals much more!


Validation

Up to this point, a “realistic result” is just a result that appears realistic to my eyes based on my experience with my boat. This is not particularly rigorous, and I want to validate my model. So, this coming summer, I’m hoping to experimentally measure the response of my boat and compare it to what my model predicts. My plan is to wait for a day when the lake is perfectly still, then disturb the boat and record the response. Another possible method is to record the waves accurately (using a 3D scanner) instead of controlling them, and then that can be easily fed into my simulation.