Skip to content

Top farm problem structure

Mads M. Pedersen requested to merge TopFarmProblemStructure into master

I have restructure topfarm Some of it is still working with backward compatibility.

I have restructured into:

  • TopFarmProblem (self, cost_comp, record_id, expected_cost): (a base class for optimization problems)
  • Cost_comp can be the usual wakemodel cost components or an other problem
  • Record id: se later
  • Expected cost: used for scaling
  • TurbineTypeOptimizationProblem(TopFarmProblem)
  • TurbineXYZOptimizationProblem
  • TopFarm (Backward compatible wrapper of TurbineXYZOptimizationProblem)
  • InitialXYZOptimizationProblem

These classes can be used as cost_comp for each other which gives us a very flexible way to run nested problems But I have not fixed the multistart yet

I have made a new recorder setup. It uses a inmemory ListRecorder, that I have implemented. You can give it record_id=

  • ”test” -> “recordings/test.pkl”, latest
  • “tmp/test” -> tmp/test.pkl, latest
  • “c:/tmp/test” -> c:/tmp/test.pkl, latest
  • “test:latest”: optimization starts from last
  • “test:best”: optimization starts from best
  • “test:none”: optimisation starts from scratch
  • “test:4”: optimization starts from 4th iteration

optimize interface: cost, state, recorder = tf.optimize()

  • State: {‘turbineX’:[0,0,0],…}

Recorder:

  • recorder.save()
  • recorder.animate_turbineXY(self, duration=10, tail=5, plot_initial=True, filename=None): o if filename: then save as mp4 otherwise show

The DOE driver is suitable for the TurbineTypeOptimizationProblem and InitialXYZOptimizationProblem using the standard generators. In addition, I have implemented a ConstrainedXYZGenerator based on Mikkels fix_constraint code. It is instantiated with a normal DOEGenerator but modifies the positions to satisfy the boundary and spacing constraints.

The interfaces to DummyCost and CostModelComponent has been modified, such that it can be used for custom inputs e.g. turbineType.

I have not had time to look into the interface to Jufens NOJStreamline with turbine types, but it should be much easier now.

It is still failing one test on the Linux test machine, but I am almost sure that it is an openmdao or scipy bug in that version.

/cc @rink @mikf @pire @dave @jufen

Edited by Mads M. Pedersen

Merge request reports