Skip to content

Latest commit

 

History

History
129 lines (73 loc) · 6.03 KB

solver.rst

File metadata and controls

129 lines (73 loc) · 6.03 KB

Module: solver

The solver module provides interfaces to static, dynamic and eigenvalue solvers. Most of the solvers are implemented inside the C++ core.

  • Author: Johannes Gerstmayr
  • Date: 2020-12-02
  • Notes: Solver functions are included directly in exudyn and can be used with exu.SolveStatic(...)

Function: SolverErrorMessage

SolverErrorMessage(solver, mbs, isStatic = False, showCausingObjects = True, showCausingNodes = True, showHints = True)

  • function description:
    (internal) helper function for unique error and helper messages

Function: SolveStatic

SolveStatic(mbs, simulationSettings = exudyn.SimulationSettings(), updateInitialValues = False, storeSolver = True, showHints = False, showCausingItems = True)

  • NOTE: this function is directly available in MainSystem (mbs); it should be directly called as mbs.SolveStatic(...). For description of the interface, see the MainSystem Python extensions, :ref:`sec-mainsystemextensions-solvestatic`

Function: SolveDynamic

SolveDynamic(mbs, simulationSettings = exudyn.SimulationSettings(), solverType = exudyn.DynamicSolverType.GeneralizedAlpha, updateInitialValues = False, storeSolver = True, showHints = False, showCausingItems = True)

  • NOTE: this function is directly available in MainSystem (mbs); it should be directly called as mbs.SolveDynamic(...). For description of the interface, see the MainSystem Python extensions, :ref:`sec-mainsystemextensions-solvedynamic`

Function: SolverSuccess

SolverSuccess(solverStructure)

  • function description:
    return success (True/False) and error message of solver after SolveSteps(...), SolveSystem(...), SolveDynamic(...) or SolveStatic(...) have been called. May also be set if other higher level functions called e.g. SolveSystem(...)
  • input:
    solverStructure: solver structure, as stored in mbs.sys or as created e.g. by exudyn.MainSolverExplicit()
  • output:
    [success, errorString], returns success=True or False and in case of no success, information is provided in errorString
  • example:
#assume MainSystem mbs, exu library and simulationSettings:
try:
    mbs.SolveDynamic(simulationSettings)
except:
    [success, msg] = exu.SolverSuccess(mbs.sys['dynamicSolver'])
    print('success=',success)
    print('error message=',msg)
#alternative:
solver=exu.MainSolverImplicitSecondOrder()
...
[success, msg] = exu.SolverSuccess(solver)

Function: ComputeLinearizedSystem

ComputeLinearizedSystem(mbs, simulationSettings = exudyn.SimulationSettings(), projectIntoConstraintNullspace = False, singularValuesTolerance = 1e-12, returnConstraintJacobian = False, returnConstraintNullspace = False)


Function: ComputeODE2Eigenvalues

ComputeODE2Eigenvalues(mbs, simulationSettings = exudyn.SimulationSettings(), useSparseSolver = False, numberOfEigenvalues = 0, constrainedCoordinates = [], convert2Frequencies = False, useAbsoluteValues = True, computeComplexEigenvalues = False, ignoreAlgebraicEquations = False, singularValuesTolerance = 1e-12)


Function: ComputeSystemDegreeOfFreedom

ComputeSystemDegreeOfFreedom(mbs, simulationSettings = exudyn.SimulationSettings(), threshold = 1e-12, verbose = False, useSVD = False)


Function: CheckSolverInfoStatistics

CheckSolverInfoStatistics(solverName, infoStat, numberOfEvaluations)

  • function description:
    helper function for solvers to check e.g. if high number of memory allocations happened during simulation
    This can happen, if large amount of sensors are attached and output is written in every time step
  • input:
    stat=exudyn.InfoStat() from previous step, numberOfEvaluations is a counter which is proportional to number of RHS evaluations in method