Skip to content

Conversation

@H0R5E
Copy link
Contributor

@H0R5E H0R5E commented Jul 2, 2021

This change allows the PTOSim application examples to run in function and class based tests.

I am not sure if I've covered all the use cases where this change might cause an issue, but it works for me when running wecSim in the application directory (i.e. in OSWEC_Hydraulic_PTO) and it now also works for the class based tests in WEC-Sim/WEC-Sim_Applications#7

I've put this PR against master in order to get the WEC-Sim_Applications suite passing against the master branch. I am pretty sure that it will also merge into dev without issue.

This allows PTOSim application examples to run in function tests
@akeeste
Copy link
Contributor

akeeste commented Jul 19, 2021

@H0R5E Sorry if this was holding up the other applications tests...
I just tested this in the applications cases too and don't have any issues.

This function is not set-up well; it shouldn't depend on the calling workspace. Instead the output items should be function parameters. However to get this update in before v4.3 and get the tests running, let's leave this for a future cleanup item. I added it to one of the current project board items.

My only request is in a PR in your fork. This will clear the old output variables from the calling workspace. I didn't intend to open a branch on your fork to do this, but that's what GitHub automatically did when I proposed changes...

@akeeste akeeste merged commit c5b6ca4 into WEC-Sim:master Jul 21, 2021
@H0R5E H0R5E deleted the ptosim_use_caller_workspace branch August 5, 2021 14:13
@hossein-mehdipour
Copy link

hossein-mehdipour commented Sep 10, 2021

Hello @H0R5E I had a problem in #646 and you suggested me to use the file in this page to solve my problem. It in fact did solve my problem, but now I think I have another problem which I'm not sure what is the source of it. I wanted to reinstall and redownload MATLAB & WEC-Sim to see if my problem will gets solved but now that I have seen you deleted your file, I am a little confused and I wanted to ask you if you have any idea about my problem.
So basically when I use WEC-Sim directly or when in a function, I get different results (this happens both in the cases with HPTO or without HPTO). And most of the time the direct method gives the right answer, but sometimes it's the other way around. I was wondering if you could help me solve my problem?

Sorry if I shouldn't have commented here.

Update: I don't know how, but the problem got solved for me in the case of using PTO-Sim version, and now only happens when using the WEC-Sim with the Linear PTO. I am going to make a new issue regarding this as well.

@akeeste
Copy link
Contributor

akeeste commented Sep 13, 2021

@hossein-mehdipour Thanks for following up on this problem. As this PR is merged, let's continue this discussion in issue #700 that you opened.

Thanks,
Adam

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

Labels

PTO-Sim PTO-Sim (ptoSimClass.m)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants