question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Interpolation issue: x_new below the range

See original GitHub issue

Hi,

I am trying to conduct a very simple example with Floris. The code is almost identical to the one in the example 08_calc_aep_from_rose_use_class.py https://github.com/NREL/floris/blob/main/examples/08_calc_aep_from_rose_use_class.py. The only difference is that I am using my own wind_rose data, but it has the same structure than the data in the example provided. Every time I execute the sentence:

aep = fi.get_farm_AEP_wind_rose_class(wind_rose=wind_rose)

I get the error:

File "D:\Programas\EntornosA3\wisdem\lib\site-packages\scipy\interpolate\_interpolate.py", line 695, in _evaluate
    below_bounds, above_bounds = self._check_bounds(x_new)

  File "D:\Programas\EntornosA3\wisdem\lib\site-packages\scipy\interpolate\_interpolate.py", line 724, in _check_bounds
    raise ValueError("A value in x_new is below the interpolation "

ValueError: A value in x_new is below the interpolation range.

Does this error suggest something to you? Any ideas?

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
Josue9740commented, Sep 26, 2022

Ok! Simple and effective. Thank you so much!

1reaction
Bartdoekemeijercommented, Sep 26, 2022

I would suggest simply expanding your Cp/Ct tables:, for example, you can add a 0.0 0.0 entry and a 50.0 0.0 entry for both tables, indicating zero power/thrust at 0 m/s and zero power/thrust at 50 m/s. Take a look at the NREL 5MW definition https://github.com/NREL/floris/blob/main/floris/turbine_library/nrel_5MW.yaml as an example.

Cp at 0 m/s: https://github.com/NREL/floris/blob/0c2adf3e702b6427da946a6ba9dbedbea22738be/floris/turbine_library/nrel_5MW.yaml#L11

Ct at 0 m/s: https://github.com/NREL/floris/blob/0c2adf3e702b6427da946a6ba9dbedbea22738be/floris/turbine_library/nrel_5MW.yaml#L63

Read more comments on GitHub >

github_iconTop Results From Across the Web

`ValueError: A value in x_new is above the interpolation range ...
I hoped rounding the original values to 2 significant digits would solve the problem, but it didn't, it displays fewer digits but still...
Read more >
Introduction to Scipy: Interpolation and Integration
The simplest interpolation routine in scipy.interpolate is interp1d: ... above_bounds.any(): ValueError: A value in x_new is below the interpolation range.
Read more >
ValueError: A value in x_new is above the interpolation range
ValueError : A value in x_new is above the interpolation range. The entire chain goes below. Any hint as to why I am...
Read more >
scipy.interpolate.interp1d — SciPy v1.9.3 Manual
If True, a ValueError is raised any time interpolation is attempted on a value outside of the range of x (where extrapolation is...
Read more >
1 Interpolation - University of Southampton
Poor scaling is a different problem and is caused by the matrix elements ... trying to use those samples to estimate the value...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found