OpenSim Moco  0.2.0
Public Member Functions | List of all members
CasOC::Solver Class Reference

Description

Once you have built your CasOC::Problem, create a CasOC::Solver to configure how you want to solve the problem, then invoke solve() to solve your problem.

This class assumes that the problem is solved using direct collocation.

#include <Moco/Moco/MocoCasADiSolver/CasOCSolver.h>

Public Member Functions

 Solver (const Problem &problem)
 
void setNumMeshIntervals (int numMeshIntervals)
 
void setMesh (std::vector< double > mesh)
 
const std::vector< double > & getMesh () const
 
void setTranscriptionScheme (std::string scheme)
 
const std::string & getTranscriptionScheme () const
 
std::string getDynamicsMode () const
 
void setMinimizeLagrangeMultipliers (bool tf)
 
bool getMinimizeLagrangeMultipliers () const
 
void setLagrangeMultiplierWeight (double weight)
 
double getLagrangeMultiplierWeight () const
 
void setImplicitMultibodyAccelerationBounds (Bounds bounds)
 
Bounds getImplicitMultibodyAccelerationBounds () const
 
bool getMinimizeImplicitMultibodyAccelerations () const
 
void setMinimizeImplicitMultibodyAccelerations (bool tf)
 
double getImplicitMultibodyAccelerationsWeight () const
 
void setImplicitMultibodyAccelerationsWeight (double weight)
 
void setImplicitAuxiliaryDerivativeBounds (Bounds bounds)
 
Bounds getImplicitAuxiliaryDerivativeBounds () const
 
bool getMinimizeImplicitAuxiliaryDerivatives () const
 
void setMinimizeImplicitAuxiliaryDerivatives (bool tf)
 
double getImplicitAuxiliaryDerivativesWeight () const
 
void setImplicitAuxiliaryDerivativesWeight (double weight)
 
void setInterpolateControlMidpoints (bool tf)
 Whether or not to constrain control values at mesh interval midpoints by linearly interpolating control values from mesh interval endpoints. More...
 
bool getInterpolateControlMidpoints () const
 
void setOptimSolver (std::string optimSolver)
 
const std::string getOptimSolver () const
 
void setFiniteDifferenceScheme (const std::string &scheme)
 The finite difference scheme to be set on all CasOC::Function objects. More...
 
std::string getFiniteDifferenceScheme () const
 The finite difference scheme to be set on all CasOC::Function objects. More...
 
void setCallbackInterval (int callbackInterval)
 
int getCallbackInterval () const
 
void setSparsityDetection (const std::string &setting)
 "none" to use block sparsity (treat all CasOC::Functions as dense; default), "initial-guess", or "random".
 
void setSparsityDetectionRandomCount (int count)
 If sparsity detection is "random", use this number of random iterates to determine sparsity.
 
void setWriteSparsity (const std::string &setting)
 If this is set to a non-empty string, the sparsity patterns of the optimization problem derivatives are written to files whose names use setting as a prefix.
 
std::string getWriteSparsity () const
 
void setParallelism (std::string parallelism, int numThreads)
 Use this to tell CasADi to evaluate differential-algebraic equations, path constraints, integrands, etc. More...
 
std::pair< std::string, int > getParallelism () const
 
void setPluginOptions (casadi::Dict opts)
 
const casadi::Dict & getPluginOptions () const
 
void setSolverOptions (casadi::Dict solverOptions)
 
const casadi::Dict getSolverOptions () const
 
Iterate createInitialGuessFromBounds () const
 The contents of this iterate depends on the transcription scheme.
 
Iterate createRandomIterateWithinBounds () const
 The contents of this iterate depends on the transcription scheme.
 
Solution solve (const Iterate &guess) const
 

Member Function Documentation

◆ getFiniteDifferenceScheme()

std::string CasOC::Solver::getFiniteDifferenceScheme ( ) const
inline

The finite difference scheme to be set on all CasOC::Function objects.

Note
Default is 'central'.

◆ setFiniteDifferenceScheme()

void CasOC::Solver::setFiniteDifferenceScheme ( const std::string &  scheme)
inline

The finite difference scheme to be set on all CasOC::Function objects.

Note
Default is 'central'.

◆ setInterpolateControlMidpoints()

void CasOC::Solver::setInterpolateControlMidpoints ( bool  tf)
inline

Whether or not to constrain control values at mesh interval midpoints by linearly interpolating control values from mesh interval endpoints.

Note
Only applies to Hermite-Simpson collocation.

◆ setParallelism()

void CasOC::Solver::setParallelism ( std::string  parallelism,
int  numThreads 
)

Use this to tell CasADi to evaluate differential-algebraic equations, path constraints, integrands, etc.

in parallel across grid points. "parallelism" is passed on directly to the "parallelism" argument of casadi::MX::map(). CasADi supports "serial", "openmp", "thread", and perhaps some other options.


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