Skip to content

User defined force - RM3#112

Draft
jleonqu wants to merge 10 commits into
WEC-Sim:devfrom
jleonqu:userDefinedForce
Draft

User defined force - RM3#112
jleonqu wants to merge 10 commits into
WEC-Sim:devfrom
jleonqu:userDefinedForce

Conversation

@jleonqu

@jleonqu jleonqu commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

The RM3 example was modified to include an external force defined by the user

* The RM3 example was modified to include an external force defined by
  the user

@akeeste akeeste left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Initial review comments attached. Changes for whoever can next pick this up to start with

Comment thread RM3_UserDefinedForce/hydroData/rm3.out Outdated
Comment thread RM3_UserDefinedForce/geometry/plate.stl Outdated
Comment thread RM3_UserDefinedForce/geometry/float.stl Outdated
Comment thread RM3_UserDefinedForce/hydroData/bemio.m Outdated
Comment thread RM3_UserDefinedForce/hydroData/README.md Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If only position output is visualized, pare down file size

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If only position output is visualized, pare down file size

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If only position output is visualized, pare down file size

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resave to older simulink version

Comment on lines +3 to +25
%Plot waves
waves.plotElevation(simu.rampTime);
try
waves.plotSpectrum();
catch
end

%Plot heave response for body 1
output.plotResponse(1,3);

%Plot heave response for body 2
output.plotResponse(2,3);

%Plot heave forces for body 1
output.plotForces(1,3);

%Plot heave forces for body 2
output.plotForces(2,3);

%Save waves and response as video
% output.saveViz(simu,body,waves,...
% 'timesPerFrame',5,'axisLimits',[-150 150 -150 150 -50 20],...
% 'startEndTime',[100 125]);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pare down to visualizations specific to this case. Maybe combine with dataVisualization.m?

@akeeste

akeeste commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

@basaucier some more additions to this PR that just came to mind:

  • products.txt file. This determines whether the CI needs to install any additional MATLAB packages
  • README.md
  • a test file

See some of the other applications (e.g. Generalized_Body_Modes) for sample files that you can adapt here. It would be great if the test file also confirmed how an identical force can be applied at different points, e.g. as:

  • a translational force at a given application point
  • the equivalent force-moment couple at a body CG

@basaucier

Copy link
Copy Markdown

Added the requested products.txt, README.md, and MATLAB unit test for the RM3 user-defined force example TestRM3UserDefinedForce.m.

The products.txt file lists the MATLAB products required for CI. The README describes the RM3 user-defined force example and the generalized force/moment vector format [Fx, Fy, Fz, Mx, My, Mz].

The test file verifies that the example runs, checks that F_ext_b1 is a valid user-defined force/moment vector, and demonstrates the equivalence between applying a translational force at representative application point offsets and applying the same force plus the equivalent moment about the body CG:

M_CG = r_CG_P x F

The added test passes locally with 3 passed, 0 failed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants