bluemira.equilibria.optimisation.problem._position ================================================== .. py:module:: bluemira.equilibria.optimisation.problem._position Classes ------- .. autoapisummary:: bluemira.equilibria.optimisation.problem._position.CoilsetPositionCOP Module Contents --------------- .. py:class:: CoilsetPositionCOP(eq: bluemira.equilibria.equilibrium.Equilibrium, targets: bluemira.equilibria.optimisation.constraints.MagneticConstraintSet | None, position_mapper: bluemira.utilities.positioning.PositionMapper, max_currents: numpy.typing.ArrayLike | None = None, gamma=1e-08, opt_algorithm: bluemira.optimisation.AlgorithmType = Algorithm.SBPLX, opt_conditions: dict[str, float] | None = None, opt_parameters: dict[str, float] | None = None, constraints: list[bluemira.equilibria.optimisation.constraints.UpdateableConstraint] | None = None) Bases: :py:obj:`bluemira.equilibria.optimisation.problem.base.EqCoilsetOptimisationProblem` .. autoapi-inheritance-diagram:: bluemira.equilibria.optimisation.problem._position.CoilsetPositionCOP :parts: 1 :private-bases: Coilset OptimisationProblem for coil currents and positions subject to maximum current bounds and positions bounded within a provided region. Coil currents and positions are optimised simultaneously. :param eq: Equilibrium object (used to update magnetic field targets) with Coilset to optimise. :param targets: Set of magnetic field targets to use in objective function. :param position_mapper: Position mappings of coil regions :param max_currents: Maximum allowed current for each independent coil current in coilset [A]. If specified as a float, the float will set the maximum allowed current for all coils. :param gamma: Tikhonov regularisation parameter in units of [A⁻¹]. :param opt_algorithm: The optimisation algorithm to use (e.g. SLSQP) :param opt_conditions: The stopping conditions for the optimiser. for defaults see :class:`~bluemira.optimisation._algorithm.AlgorithDefaultTolerances` along with `max_eval=100` :param opt_parameters: Optimiser specific parameters, see https://nlopt.readthedocs.io/en/latest/NLopt_Reference/#algorithm-specific-parameters Otherwise, the parameters can be founded by digging through the source code. :param constraints: List of optimisation constraints to apply to the optimisation problem .. rubric:: Notes Setting stopval and maxeval is the most reliable way to stop optimisation at the desired figure of merit and number of iterations respectively. Some NLOpt optimisers display unexpected behaviour when setting xtol and ftol, and may not terminate as expected when those criteria are reached. .. py:attribute:: position_mapper .. py:attribute:: bounds .. py:attribute:: gamma :value: 1e-08 .. py:method:: optimise(x0: numpy.typing.NDArray | None = None, *, keep_history: bool = False, check_constraints: bool = False, **_) -> bluemira.equilibria.optimisation.problem.base.CoilsetOptimiserResult Run the optimisation. :rtype: The result of the optimisation. .. py:method:: objective(vector: numpy.typing.NDArray[numpy.float64]) -> float Least-squares objective with Tikhonov regularisation term. :param vector: The new coilset state vector. :rtype: The figure of merit being minimised. .. py:method:: get_mapped_state_bounds(max_currents: numpy.typing.ArrayLike | None = None) -> tuple[numpy.ndarray, numpy.ndarray] Get mapped bounds on the coilset state vector from the coil regions and maximum coil currents. :param max_currents: Maximum allowed current for each independent coil current in coilset [A]. If specified as a float, the float will set the maximum allowed current for all coils. :returns: **bounds** -- Array containing state vectors representing lower and upper bounds for coilset state degrees of freedom. :rtype: np.array