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

FAST_SFunc number of inputs and what is NumAdditionalInputs #1425

Open
uniqueusername-sahil opened this issue Jan 31, 2023 · 7 comments
Open

Comments

@uniqueusername-sahil
Copy link

Hi,

I hope I am not asking something which is already documented.

I am using the FAST_SFunc simulink block in a model. Matlab version is 2022b, OpenFAST is version 3.4. OS is Windows 10 64bit. The open loop example runs without error.

In the examples the SIG test passes seven inputs to the block.

In this documentation (probably unofficial. sorry) it says that the total inputs to the block shall be 8 + NumAdditionalInputs which implies that the minimum total number of inputs cannot be less than eight

Finally, in the ROSCO project the MDL passes 51 inputs and is parameterised with NumAdditionalInputs = 43, but that throws a bunch of errors from simulink about vector dimensions. After I changed the 43 into a 0 then simulink was happy and ROSCO seems to be working. I did engage with the ROSCO team and they indicated that this seems to be an OpenFAST topic, hence I am asking here.

Right now I am supposing that the latest version of the SFunc is able to auto-detect the number of inputs that it is receiving and do what it must.

My question is how many inputs must be provided to the block? and in what order? how does the block know which input is which?

Thanks,
Sahil

@jjonkman
Copy link
Collaborator

Dear @uniqueusername-sahil

The issue you describe similar to one discussed here: #1205 (and hopefully the solution discussed solves your issue).

It sounds like the Simulink example for SIG has not been updated with the correct number of inputs to the S-Function. This should be fixed in an update to OpenFAST.

Best regards,

@uniqueusername-sahil
Copy link
Author

Dear @jjonkman

Thank you so much for your reply. It all makes sense now.

Regards,
Sahil

@jjonkman
Copy link
Collaborator

jjonkman commented Feb 1, 2023

I'm reopening this issue until the Simulink example for SIG has been fixed.

@jjonkman jjonkman reopened this Feb 1, 2023
@andrew-platt
Copy link
Collaborator

@jjonkman, I just tested the Simulink SIG example with 3.4.0. It ran without issue.

The documentation may be out of date though. I'll take a look at that and get it updated for the 3.4.1 release (out of sequence bug fix).

@andrew-platt
Copy link
Collaborator

andrew-platt commented Feb 7, 2023

@uniqueusername-sahil, I have a couple of questions on your setup. I'm rather surprised that the SIG model failed to run for you. Is it possible you are running a FAST_SFunc.mexw64 built with an older version of OpenFAST (<3.1.0)? The SIG model was updated in March of 2021 to include the 51 channels (8+43) before OpenFAST release 3.1.0.

The documentation you found is from FAST v8 (predecessor to OpenFAST). It hasn't been fully ported over to OpenFAST or updated.

@rafmudaf, can we do a PR sometime for the Simulink documentation source that builds this: https://raf-openfast.readthedocs.io/en/docs-all/source/user/openfast/simulink.html

@rafmudaf
Copy link
Collaborator

rafmudaf commented Feb 7, 2023

can we do a PR sometime for the Simulink documentation source that builds this: https://raf-openfast.readthedocs.io/en/docs-all/source/user/openfast/simulink.html

Sure, feel free to create the pull request from https://github.com/rafmudaf/openfast/tree/docs/fast8readme. However, I don't recall the status of that effort to move the documentation from the FAST 8 pdfs to readthedocs. Some sections are more complete than others.

@uniqueusername-sahil
Copy link
Author

Hi @andrew-platt ,

Sorry. I am re-reading now and I see the question was not totally clear.

The both OpenFAST examples do run. My problem was with ROSCO, which seemed to be passing too many inputs to the SFUNC. Since jjonkman kindly pointed me to the other gihub issues things are making a lot more sense now and I also gave feedback to the ROSCO repository.

I know the docs I used are for previous versions, but the readthedocs does direct me there. Porting the documentation is a very big elephant to eat and you can only do it one bite at a time. I really appreciate the support that is available in this community.

Regards,
Sahil

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

4 participants