Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fairlead Tension Output #2232

Closed
WS991106 opened this issue May 21, 2024 · 13 comments
Closed

Fairlead Tension Output #2232

WS991106 opened this issue May 21, 2024 · 13 comments

Comments

@WS991106
Copy link

Dear @jjonkman ,

Running the simulation will show the tension in the command line, but I would like to know how to output the Fairlead tension out with a scope inside Simulink, because I don't find a string about the tension in OutlistParameters.xlsx. I'm trying to output it out, but it reports an error.
1716292427006

1716292059404

@jjonkman
Copy link
Collaborator

Dear @WS991106,

FairTen1 is an output of MoorDyn if you've selected it in the OUTPUTS section of the MoorDyn input file.

The MoorDyn outputs are not documented in the OutListParameters.xlsx spreadsheet, but are documented in the online MoorDyn documentation: https://moordyn.readthedocs.io/en/latest/inputs.html#the-v2-input-file.

Best regards,

@WS991106
Copy link
Author

Dear @jjonkman

If I want to output the Fairlead tension inside simulink to a scope, do I need to modify the source code? If I need to modify it, what part of it should I modify? Is there any information to introduce it?

Best regards,

@jjonkman
Copy link
Collaborator

Dear @WS991106,

You don't need to change the source code for that. You should be able to extract FairTen1 (or any other OpenFAST output) from OutData via strmatch() and then send that signal to a scope.

Best regards,

@WS991106
Copy link
Author

Dear @jjonkman
1716785448749

I tried what you said, but I still get the error as below, I don't know what the problem is.

@jjonkman
Copy link
Collaborator

Dear @WS991106,

I'm not sure what this error says in English. Regardless, is FairTen1 included in the OutData array?

Best regards,

@WS991106
Copy link
Author

WS991106 commented Jun 4, 2024

Dear @jjonkman ,

Thank you very much for your help, my problem has been solved by changing the string all caps to FAIRTEN1 and it won't report an error!

Best regards,

@jjonkman
Copy link
Collaborator

jjonkman commented Jun 4, 2024

@WS991106 -- I'm glad you solved the problem.

@RyanDavies19 @andrew-platt -- Sounds like a simple issue to fix in MoorDyn by making use a call to Conv2UC().

Best regards,

RyanDavies19 added a commit to FloatingArrayDesign/MoorDyn that referenced this issue Jun 5, 2024
Documentation note to address: OpenFAST/openfast#2232 (comment)
@RyanDavies19
Copy link
Contributor

@jjonkman @andrew-platt I added a comment to the documentation to address this. For now I think its best to leave it as is, so that users who have scripts set up already don't have to make changes

@jjonkman
Copy link
Collaborator

jjonkman commented Jun 5, 2024

@RyanDavies19 -- I'm not sure what scripts you are referring to, but using Conv2UC() would simply open up the possibility for users to select MoorDyn output FAIRTEN1 using any combination of upper or lower case letters, e.g., FairTen1. This is how most other output parameters of other OpenFAST modules work and provides user some flexibility.

@RyanDavies19
Copy link
Contributor

@jjonkman from the MoorDyn input file side, the output channels are not case sensitive. Users could give fairten1 and it would be correctly read. MoorDyn uses Conv2UC() before processing the output channel name and assigning it to the output parameter structure as all caps, so that the output file has headers in caps.

I discussed this with Matt and the idea is that any users who have set up their own scripts to process moordyn output files will have done so based on the all caps method, so in order to not break that convention its better to leave it as is. My understanding of the OutList variable is that it contains a list of all the output channels as written by MoorDyn, so I'm not sure if there is a way to allow for searching while still having the MoorDyn output file headers be caps.

@bjonkman
Copy link
Contributor

bjonkman commented Jun 5, 2024

I'm not sure we're all talking about the same issue here. I don't know how MoorDyn deals with the case of channel output names, so I won't comment on that. However, the issue here is likely that the output channel from MoorDyn (possibly using whatever case the user entered in the input file) does not have the same case as the Simulink block is expecting. The best fix is to change the Simulink block to ignore case:

The Simulink model should change u(strmatch('FairTen1',OutList)) to u(strcmpi('FairTen1',OutList)). Matlab documentation also says strmatch() should not be used anymore, so this fixes both issues.

@jjonkman
Copy link
Collaborator

jjonkman commented Jun 5, 2024

Thanks for clarifying, @bjonkman. That makes sense. I'll go ahead and close this issue.

@jjonkman jjonkman closed this as completed Jun 5, 2024
andrew-platt added a commit to andrew-platt/openfast that referenced this issue Jun 5, 2024
The `strmatch` command is deprecated in newer MATLAB versions.  Using `strcmpi` also allows for case insensitivity (see issue OpenFAST#2232)
@andrew-platt
Copy link
Collaborator

Updated the Simulink example cases with PR #2254.

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

No branches or pull requests

5 participants