Closed Robert6codes closed 1 year ago
Apologies, there was in issue with the Simulink model causing no outputs. The simulation gets PTO outputs now however I get the following error when typing wecSim into the command window:
I found in the issues a user who faced a similar issue. I tried to just rename the userdefinedfunctions script however the problem still persists unlike with issue https://github.com/WEC-Sim/WEC-Sim/issues/741.
The issue regarding free decay tests described in the photos above still persists too.
Hi @Robert6codes
Can you please share your full case directory as a zip? In particular we will need your h5 file. I suspect your BEM data is the problem with the settling location you are seeing: since you are looking at roll, a DOF that is not by default plotted in your BEMIO output the issue may have eluded your check above.
With respect to your error, this is either a path issue or you have added a "clear" somewhere you shouldn't have...perhaps in your 'userDefinedFunctions'?. The projectRootDir variable is created on line 30 of 'initializeWecSim' and should exist until cleared on line 69 of 'stopWecSim'
Hi there,
thank you for the quick response. Please find attached the zipped document Wavestar140run-simplified_model2.zip
appreciate it,
Robert
To resolve your bug, remove the 'clear' at the beginning of your WEC-Sim input file.
The reason you are seeing that the orientation of the body at equilibrium is a function of your initial displacement is that you have already constrained the body to be a particular distance from the PTO
body(1).centerGravity = [0; 0.1120; 0.1000]; % this is from your *h5 file
pto(1).location = [0 -0.1120 0.141]; % this is from your input file
So when you give an initial vertical displacement to body, Simscape is rotating the body to try and meet both this and the distance constraint between the body and PTO.
Try adding something like this to your input file to make sure that your initial displacement falls along the radius defined by the PTO position. This suggestion won't get you to perfection but its along the right track!
%% initial disp
hypLength = norm(pto(1).location-[0, 0.1120, 0.100]); % second vector is your body CG from H5
rotAngle = pi/18; % in radians
initAngle = atan(abs(pto(1).location(2) - 0.1120)/abs(pto(1).location(3)-0.100));
body(1).initial.displacement=[0, -hypLength*(sin(rotAngle + initAngle)-sin(initAngle)), -hypLength*(cos(rotAngle + initAngle)-cos(initAngle))];
body(1).initial.axis = [1 0 0];
body(1).initial.angle = [rotAngle];
Thank you very much for this!
The development team requests that before submitting a question on the theory and implementation behind WEC-Sim to first please:
Note: italicized text below is include as an example and should be updated before submission. If you feel any section is not applicable to your request, please replace with 'N/A' rather than delete a section.
Is your question request related to a problem? Please describe.
I am using a singular Rotational PTO and when I run simulations there are no outputs of angular position, velocity, acceleration, or torque.
Describe the theory or implementation approach that you have a question
I am modelling only the float of a Wavestar in roll. I understand that the rotational PTO by default only has rotation about pitch, not roll. Therefore, I've included: pto(1).orientation.y=[1 0 0] into the input file. My simulink block is extremely simple, shown below, and the subsystem for the seabed is taken directly from the OSWEC simulink model. Within the input file, I have offset the PTO location from the free surface by: pto(1).location = [0 -0.112 0.141];.
I have complete all the troubleshooting tests with the following conclusions:
command used: body(1).initial.displacement = [0 0 0.03];
I have ran the PTO with and without damping and stiffness values.
Personal project context
This is the same project as my previous issue. It is a masters dissertation project.
Describe the type of conclusion or resolution you are looking for
Additional context Thank you very much for the help! Really appreciated.