Started working on the gradient

Description

Started adding support for the gradient. Despite the huge MR there is still a long way to go.

  • The pitch and rotor speed look up tables for the Floris model of the IEA 3.4 are now based on SciPy RegularGridInterpolator. Out of bounds predictions now return 0.
  • The pitch and rotor speed look up tables for the PyWake model of the IEA 3.4 are now based on JAX RegularGridInterpolator. Out of bounds predictions now return 0.
  • Renamed all pitch and rotor speed look up tables. They are now called iea3_4_pitch_lut and iea3_4_rotor_speed_lut.
  • Since JAX requires 1 return value, the x, y and z coordinates of the grid are now stored in 1 array. This affect all functions that produce or consume a grid.
  • Implemented gradient of rotate_grid and compute_lifetime_del using JAX. Testing the gradient of a PyWake simulation is ongoing.
  • Moved pot functions from tool_agnostic to py_wake module. Furthermore, now they are just module functions instead of being in an abstract class. Fix #25 (closed). Since they are meant to work with PyWake, they rely on AutoGrad.
  • Renamed _preallocate_ilktn ➡️ preallocate_ilktn.
  • The py_wake and tool_agnostic modules are now largely based on JAX and AutoGrad.
  • compute_lifetime_del is now based on JAX instead of xarray.
  • preallocate_ilktn now allows passing an existing numpy or JAX array, and it will simply wrap it into a DataArray.

Checklist

  • Updated changelog
  • Linked relevant issues
  • Updated documentation
  • Updated project version
Edited by Riccardo Riva

Merge request reports

Loading