2 Commits
Author SHA1 Message Date
vinihcrosaandClaude Opus 4.8 90006bc246 feat(physics): match rudder forces to MATLAB Dynamics (table + slipstream)
Replace analytic thin-airfoil Cl/Cd and simplified actuator-disk inflow in
RudderForces with the MATLAB rudder.m model:

- Interpolate Cl/Cd from the rudder coefficient table vs inflow incidence beta,
  computed from actual longitudinal + transversal inflow (current, sway,
  yaw-rate lever).
- Propeller slipstream: p1 geometric factor x p2 actuator-disk term with hull
  wake efficiency; degrades to free-stream when the propeller is unloaded.
- RudderConfig carries coefficients table, thrusterDiameter, hullEfficiency,
  p1 (drops unused aspectRatio).
- Wire a representative balanced-rudder table + computed p1 through the WASM
  binding.

Add Catch2 tests: Cl/Cd table lookup at known beta (exact node + interpolated
midpoint) and slipstream amplification with an associated thruster. Update
existing rudder/integration test configs for the new config shape. Full ctest
green (257/257).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-29 21:34:14 -03:00
vinihcrosaandClaude Sonnet 4.6 4f9afc1132 fix(physics): correct Obokata yaw-rate sign and integrator limits
CurrentForces::computeObokata was computing water velocity at hull sections
as (-vc_x, -(vc_y - r*xi)) instead of the correct (-vc_x, -vc_y - r*xi).
The sign error on the yaw term caused sections at bow/stern to generate
anti-damping yaw moments (positive feedback), producing exponential state
divergence when thruster + rudder were at maximum.

Fix: water_y = -vc_y - r*xi, matching MATLAB's relativeVelSection convention
(water_vel = fluid_vel - vessel_vel_at_section = -vesselVel - r*xi).

Also raise RK45 limits in YmirBindings (reltol=1e-4, abstol=1e-6,
maxStep=0.005, maxSteps=100000) to handle the transient at startup.

fix(web): correct vessel heading arrow direction on map

VesselMarker was applying psi_deg directly as CSS rotation degrees.
CSS rotate(0deg) = arrow North, but psi=0 = East in the physics world frame.
Fix: cssRotation = (90 - headingDeg + 360) % 360.

feat(web): add VesselPanel with live actuator controls

Vessel panel opens on map click, shows vessel info and live state,
exposes thruster power/azimuth and rudder angle sliders during simulation.
Includes vesselPanelStore for actuator state management and e2e tests.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-28 08:22:48 -03:00