Документация Engee

OptimizationFunction

Страница в процессе перевода.

SciMLBase.OptimizationFunction(sys::System; kwargs...)
SciMLBase.OptimizationFunction{iip}(sys::System; kwargs...)
SciMLBase.OptimizationFunction{iip, specialize}(sys::System; kwargs...)

Create a SciMLBase.OptimizationFunction from the given sys. iip is a boolean indicating whether the function should be in-place. specialization is a SciMLBase.AbstractSpecalize subtype indicating the level of specialization of the SciMLBase.OptimizationFunction.

Beyond the arguments listed below, this constructor accepts all keyword arguments supported by the DifferentialEquations.jl solve function. For a complete list and detailed descriptions, see the DifferentialEquations.jl solve documentation.

Keyword arguments

  • u0: The u0 vector for the corresponding problem, if available. Can be obtained using ModelingToolkit.get_u0.

  • p: The parameter object for the corresponding problem, if available. Can be obtained using ModelingToolkit.get_p.

  • eval_expression: Whether to compile any functions via eval or RuntimeGeneratedFunctions.

  • eval_module: If eval_expression == true, the module to eval into. Otherwise, the module in which to generate the RuntimeGeneratedFunction.

  • checkbounds: Whether to enable bounds checking in the generated code.

  • simplify: Whether to simplify any symbolically computed jacobians/hessians/etc.

  • cse: Whether to enable Common Subexpression Elimination (CSE) on the generated code. This typically improves performance of the generated code but reduces readability.

  • sparse: Whether to generate jacobian/hessian/etc. functions that return/operate on sparse matrices. Also controls whether the mass matrix is sparse, wherever applicable.

  • check_compatibility: Whether to check if the given system sys contains all the information necessary to create a SciMLBase.OptimizationFunction and no more. If disabled, assumes that sys at least contains the necessary information.

  • expression: Val{true} to return an Expr that constructs the corresponding problem instead of the problem itself. Val{false} otherwise.

  • jac: Whether to symbolically compute and generate code for the jacobian function.

  • grad: Whether the symbolically compute and generate code for the gradient of the cost function with respect to unknowns.

  • hess: Whether to symbolically compute and generate code for the hessian function.

  • cons_h: Whether to symbolically compute and generate code for the hessian function of constraints. Since the constraint function is vector-valued, the hessian is a vector of hessian matrices.

  • cons_j: Whether to symbolically compute and generate code for the jacobian function of constraints.

  • sparsity: Whether to provide symbolically compute and provide sparsity patterns for the jacobian/hessian/etc.

  • cons_sparse: Identical to the sparse keyword, but specifically for jacobian/hessian functions of the constraints.

  • kwargs...: Additional keyword arguments passed to the solver

All other keyword arguments are forwarded to the SciMLBase.OptimizationFunction struct constructor.