Hopsan
EquationSystemSolver Class Reference

A numerical solver utility for equation systems using LU-decomposition. More...

Public Member Functions

 EquationSystemSolver (Component *pParentComponent, int n)
 Constructor for equation system solver utility.
 
 EquationSystemSolver (Component *pParentComponent, int n, Matrix *pJacobian, Vec *pEquations, Vec *pVariables)
 Constructor for equation system solver utility with additional arguments.
 
void solve (Matrix &jacobian, Vec &equations, Vec &variables, int iteration)
 Solves a system of equations.
 
void solve (Matrix &jacobian, Vec &equations, Vec &variables)
 Solves a system of equations with just one iteration (slightly faster)
 
void solve ()
 Solves a system of equations. Requires pre-defined pointers to jacobian, equations and state variables.
 

Detailed Description

A numerical solver utility for equation systems using LU-decomposition.

Solves $J*b = x$ by first transforming it to $L*U*b = x$ and subsequently solving $U*b = y$ and $L*y = x$

Constructor & Destructor Documentation

◆ EquationSystemSolver() [1/2]

EquationSystemSolver ( Component * pParentComponent,
int n )

Constructor for equation system solver utility.

Parameters
pParentComponentPointer to parent component
nNumber of states

◆ EquationSystemSolver() [2/2]

EquationSystemSolver ( Component * pParentComponent,
int n,
Matrix * pJacobian,
Vec * pEquations,
Vec * pVariables )

Constructor for equation system solver utility with additional arguments.

Parameters
pParentComponentPointer to parent component
nNumber of states
pJacobianPointer to Jacobian matrix
pEquationsPointer to vector with equations (RHS)
pVariablesPointer to vector with state variables

Member Function Documentation

◆ solve() [1/2]

void solve ( Matrix & jacobian,
Vec & equations,
Vec & variables )

Solves a system of equations with just one iteration (slightly faster)

Parameters
jacobianJacobian matrix
equationsVector of system equations
variablesVector of state variables

◆ solve() [2/2]

void solve ( Matrix & jacobian,
Vec & equations,
Vec & variables,
int iteration )

Solves a system of equations.

Parameters
jacobianJacobian matrix
equationsVector of system equations
variablesVector of state variables
iterationHow many times the solver has been executed before in the same time step