OCELEX APPLICATION
WITH GOOGLE AI STUDIO
I began the development of this simulation with the specific goal of creating a rudimentary 2D route optimizer for our UAV and ASV fleet utilizing Google Gemini Studio as a co pilot from the very first commit. The initial process was fraught with friction because the code the AI generated was functionally disorganized and often created React components that triggered infinite render loops or state updates that clashed with the animation frame rate. I spent a considerable amount of time acting as a software architect debugging the foundational logic because the AI would often suggest naive solutions like updating the position of every plastic particle using state variables which caused the entire application to freeze. I had to manually intervene and rewrite the core state management using mutable references to handle the entity data without triggering the render cycle of React which was a necessary optimization to ensure the simulation could handle hundreds of moving objects at twenty thousand times real speed without crashing the browser.
Once the application architecture was stable I directed my focus toward the physics engine because a static environment would render our data useless for this project. I pushed Gemini to generate mathematical models for fluid dynamics specifically prompting it to write the vector flow function. However the AI initially provided simple linear vectors so I had to guide it to implement complex trigonometric functions using sine and cosine waves mapped against the grid coordinates to simulate the chaotic vortices of an ocean gyre. I took this a step further by hard coding specific environmental coefficients into the logic such as the Stokes Drift constant of zero point zero six which mathematically accounts for the specific velocity floating debris gains from wave height. I integrated these calculations into the main animation loop ensuring that every single plastic particle trajectory was updated continuously based on the sea configuration state effectively turning the code into a physics compliant digital twin of the North Pacific Gyre.
The most intellectually demanding part of the coding process was refining the autonomous navigation logic where I had to move beyond basic pathfinding to ensure the UAV mission was actually viable. The initial greedy algorithms the AI suggested simply sent the boat to the nearest plastic which resulted in inefficient chasing behavior where the vessel burned fuel chasing targets moving away from it. I had to implement a sophisticated intercept algorithm prompting Gemini to write a calculation function which solves the geometric problem of predicting where a moving target will be at a future time based on the vessel velocity. To prevent this heavy calculation from stalling the simulation I architected a custom caching layer using a Map data structure. This optimization checks if a trajectory has already been calculated for a specific boat and target pair and retrieves it instantly reducing the computational load on the CPU by orders of magnitude during high speed time warping.
To further optimize the mission efficiency I implemented a combinatorial optimization algorithm known as 2 opt within the path segment optimization function. The AI struggled to contextualize this for a moving map so I had to manually logic check the code to ensure it only ran during specific intervals controlled by the optimization interval constant to prevent thread blocking. This algorithm mathematically analyzes the queue of targets for the boat and iteratively swaps the order of visitations to untangle crossing paths minimizing the total distance traveled. I coupled this with a heuristic cost function that I programmed to weigh not just distance but also the time required to collect different sizes of plastic defined in the plastic size constant ensuring the AI prioritized high value targets that were drifting out of range.
This software stands as the primary analytical tool for the UAV project translating abstract operational theories into concrete logistical data. I built the extensive settings view to allow us to inject specific mission variables such as the fuel tank capacity in liters and the burn rate of the vessel directly into the simulation math. By tracking and rendering this data via the graphs view component we can visualize the operational cost index which is a derivative metric I coded to represent the aggregate cost of fuel and time and mechanical stress. This code provides the necessary proof of concept demonstrating that by using predictive intercept algorithms and optimized fleet coordination we can achieve a collection efficiency that makes the autonomous recovery of marine debris a viable engineering reality.
FRAME CREATION & PRESSURE SIMULATION
PROPELLER ANALYSIS
THROTTLE TILT
UAV Engineering & Design
WING ANALYSIS
IOT Simulation
AIoT & Automation
OCELEX Route Optimisation Application
Conveyor
ANALYSIS
AI TRAINING
Workings
EQUATIONS OF MOTION AND CONTROL
CMEMS Data