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

Randomized layout optimization #697

Merged
merged 42 commits into from
May 24, 2024
Merged

Conversation

paulf81
Copy link
Collaborator

@paulf81 paulf81 commented Aug 4, 2023

Add randomized layout optimization

@misi9170 and I have been working on an optimization method which works a little like a particle filter. We used some ideas for parrelelization from @Bartdoekemeijer 's UncertainityInterface so in much the same way it should work parallelized on a computer or hpc with mpi as @Bartdoekemeijer had set up the UncertainityInterface (nice code @Bartdoekemeijer!)

The main idea of the algorithm is to maintain N number of open possible optimal layouts and randomly perturb turbines within the layout. Periodically the candidate layouts are re-sampled such that the best performing layouts are duplicated and the worst are removed.

Some nice features of the algorithm are since it's working are exposed we can order the operations of checks from cheapest (check in bounds, check min-distance) to more expensive (compute AEP) and only compute AEP if viable.

We include the possibility for random jumps in turbine locations to avoid getting stuck in local minima. We believe the algorithm will scale to more cores, and to disconnected layout regions pretty seamlessly but haven't tested yet. It should intrinsically support heterogeneous inflows but haven't tested yet. The algorithm also uses a time limit (rather than convergence test) to decide when to quit, this could be improved later on.

Sharing now, though still in progress to allow easier collaboration and feedback. We include an example 29_test_random_opt.py to show usage

TODO:

  • Add tests (integration, reg)
  • Documentation

@paulf81 paulf81 added the enhancement An improvement of an existing feature label Aug 4, 2023
@Bartdoekemeijer
Copy link
Collaborator

Sounds really interesting! The way you describe it, it seems to be some sort of genetic algorithm, where only the strongest contenders survive every iteration and turbine locations are randomly mutated. Looking forward to seeing how this all pans out compared to the existing methods!

@rafmudaf rafmudaf changed the title Feature/random opt Randomized layout optimization Nov 8, 2023
@misi9170 misi9170 marked this pull request as ready for review May 15, 2024 21:53
@misi9170
Copy link
Collaborator

Examples are currently failing due to something with Matplotlib that I don't understand... perhaps it will fix itself, otherwise we may need to put a version specifier in

@paulf81
Copy link
Collaborator Author

paulf81 commented May 16, 2024

Examples are currently failing due to something with Matplotlib that I don't understand... perhaps it will fix itself, otherwise we may need to put a version specifier in

I'll have a look

@paulf81
Copy link
Collaborator Author

paulf81 commented May 16, 2024

Examples are currently failing due to something with Matplotlib that I don't understand... perhaps it will fix itself, otherwise we may need to put a version specifier in

I'll have a look

I think it fixed it, I think in earlier versions of matplotlib you could say cm.get_cmap or plt.cm.get_cmap but now plt.get_cmap is preferred. I checked that the change works with matplotliblib 3.7.1 (what I had) and 3.9. Seems to follow from: https://matplotlib.org/stable/api/prev_api_changes/api_changes_3.9.0.html#removals

@misi9170
Copy link
Collaborator

Thanks @paulf81 !

@misi9170
Copy link
Collaborator

misi9170 commented May 20, 2024

@Bartdoekemeijer , @bayc , any chance you'd be willing to review this PR?

@misi9170 misi9170 added floris.optimization new-feature A new feature and removed enhancement An improvement of an existing feature labels May 20, 2024
@misi9170 misi9170 self-requested a review May 24, 2024 16:59
@misi9170 misi9170 merged commit 7fa3bf1 into NREL:develop May 24, 2024
8 checks passed
@paulf81 paulf81 deleted the feature/random_opt branch June 1, 2024 10:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants