The SET_GSE_ ALGEBRAIC_EQN subroutine is used with GSESUB to specify the implicit, algebraic equation.


Setup utility subroutine for GSE.


Fortran Calling Syntax
SET_GSE_ALGEBRAIC_EQN (gse_id, eqn_idx, errflag)
C/C++ Calling Syntax
c_set_gse_algebraic_eqn (gse_id, eqn_idx, errflag);
Python Calling Syntax
py_set_gse_algebraic_eqn(gse_id, eqn_idx, errflag)


The identifier of the GSE element.
The equation index of the algebraic equations.


Returns information about the call status.
A non-zero value indicates failure.


  1. All indices are 1-based. That is, the index starts from 1, not 0.
  2. SET_GSE_ALGEBRAIC_EQN should only be called when iflag=1.
  3. In most cases, GSE are in the following form:

    However, in some cases, the state equations may involve both differential and algebraic equations. For example:(2)

    When this occurs, it is necessary to tell MotionSolve the equation indices of the algebraic equations associated with the algebraic state X2, using SET_GSE_ ALGEBRAIC_EQN. For example, call: SET_GSE_ALGEBRAIC_EQN (gse_id, 2, errflag)

  4. A common use case for SET_GSE_ ALGEBRAIC_EQN is to convert the implicit form of state equations:

    into the explicit form that can be solved in MotionSolve. For example, define:(4)

    The implicit form can be converted to the following differential algebraic equations:(5)

    This is in the same DAE form shown in the previous remark.