Biomech-Sim-Toolbox 1
Toolbox for movement simulation and analysis
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
IPOPT Class Reference

Class to call the IPOPT optimization software. More...

Inheritance diagram for IPOPT:
Solver handle

Public Member Functions

function IPOPT ()
 Default constructor setting default solver options.
 
function report (in obj, in doReportSettings, in solvingInfo, in resultFilename, in title)
 Function to report the solver performance and settings.
 
function setOptionField (in obj, in field, in value)
 Function to set a new field or change a field in the solverOptions struct.
 
function setWarmstartParams (in obj, in problem, in nConInd, in nOptInd)
 Function to prepare lambda, zl, and zu in case a warm start will be used.
 
function solve (in obj, in problem)
 Function to solve the optimization problem.
 

Static Public Member Functions

static function getIPOPTVersion (in output_file)
 Function to get the IPOPT version of the ebertolazzi toolbox.
 

Private Attributes

Property ipoptOptions
 
Property solverOptions
 Struct containing the options for the IPOPT.
 

Detailed Description

Class to call the IPOPT optimization software.

https://www.coin-or.org/Ipopt/documentation/node40.html

You can run a derivative test before solving by:

solver.setOptionField('derivative_test', 'first-order');
solver.solve(problem);
Examples
/home/runner/work/BioMAC-Sim-Toolbox/BioMAC-Sim-Toolbox/ExampleScripts/+IntroductionExamples/script2D.m, /home/runner/work/BioMAC-Sim-Toolbox/BioMAC-Sim-Toolbox/ExampleScripts/+IntroductionExamples/script3D.m, and /home/runner/work/BioMAC-Sim-Toolbox/BioMAC-Sim-Toolbox/ExampleScripts/+Treadmill/script2D.m.

Constructor & Destructor Documentation

◆ IPOPT()

Default constructor setting default solver options.

Use the setting function setOptionField() to change the setting values and do not change the default settings here!

Return values
objIPOPT class object

Member Function Documentation

◆ getIPOPTVersion()

static function getIPOPTVersion ( in  output_file)
static

Function to get the IPOPT version of the ebertolazzi toolbox.

It is not ideal to obtain the IPOPT version from the log file, but we did not yet find a better solution.

Parameters
objIPOPT class object
output_fileString: Filename of output file
Return values
versionString: Version of IPOPT

◆ report()

function report ( in  obj,
in  doReportSettings,
in  solvingInfo,
in  resultFilename,
in  title 
)
virtual

Function to report the solver performance and settings.

Parameters
objIPOPT class object
doReportSettingsBoolean: If true the solver settings will also be reported. (default if empty: 0)
solvingInfo(optional) Struct: Infos of the solver which were saved in the result in solver.solve(). If it is not given or empty, the solver status will not be reported.
resultFilename(optional) String: Filename to save report in a LaTeX document. If the filename is not given the report will not be saved.
title(optional) String: Title of the document (default: 'Solver Report')
Return values
conStringString: Formated text to be printed in the console containing the solver information and the solver options.
texStringString: Formated LaTeX text containing the solver information and the solver options in two separate headers.

Reimplemented from Solver.

◆ setOptionField()

function setOptionField ( in  obj,
in  field,
in  value 
)

Function to set a new field or change a field in the solverOptions struct.

Example of use:

obj.setOptionField('tol', 0.001)
Parameters
objIPOPT class object
fieldFieldname to set or change
valueValue to set

◆ setWarmstartParams()

function setWarmstartParams ( in  obj,
in  problem,
in  nConInd,
in  nOptInd 
)

Function to prepare lambda, zl, and zu in case a warm start will be used.

They should have the length of the problem

Example of use:

obj.setWarmstartParams(obj, 1:nCon, 1:nDof)
Parameters
objIPOPT class object
problemProblem: Numerical problem which should be solved
nConInd(optional) Indices of the lambdas that should be used
nOptInd(optional) Indices for zl and zu that should be used

◆ solve()

function solve ( in  obj,
in  problem 
)
virtual

Function to solve the optimization problem.

Parameters
objIPOPT class object
problemObject of the class Problem
Return values
resultResult class object containing the solution

Reimplemented from Solver.

Member Data Documentation

◆ ipoptOptions

Property ipoptOptions
private

◆ solverOptions

Property solverOptions
private

Struct containing the options for the IPOPT.

Detailed settings of the options of the IPOPT software are documented here: https://www.coin-or.org/Ipopt/documentation/node40.html. Some default values are set within the constructor.


The documentation for this class was generated from the following file: