Problem.context_and_cost

Problem.context_and_cost(context_func, cost_func, residual)[source]

Convenience helper to build and assign a cost_function.

Parameters:
  • context_func (callable) – Context-modifier callable.

  • cost_func (callable) – Cost-evaluation callable.

  • residual (Any) – Static simulation context.