Subroutine Type
|
Utility/Setup
|
Definition
|
The SET_DISCRETE_INTERFACE subroutine tells the solver to call the user-written subroutine discretely at successful integration steps.
|
Use
|
The function can be called by SFOSUB, VFOSUB, VTOSUB, GFOSUB, DIFSUB, or VARSUB.
|
Calling Syntax
|
Fortran
SET_DISCRETE_INTERFACE ()
C/C++
c_set_discrete_interface()
Python
py_set_discrete_interface()
|
Input Arguments
|
None.
|
Output Values
|
None.
|
Comments
|
1. | SET_DISCRETE_INTERFACE should only be called during subroutine initialization when IFLAG is set to TRUE. |
2. | The default interface with the subroutine is continuous. In other words, the subroutine is called not only at successful integration steps, but also at all corrector iterations in-between the integration steps. |
3. | If SET_DISCRETE_INTERFACE is in a user-written subroutine, the interface of only that subroutine will be changed to discrete, and the subroutine will be called only at successful integration steps. |
4. | A subroutine with a SET_DISCRETE_INTERFACE call is regarded by MotionSolve as a discrete dynamical system. Therefore, the Jacobian terms (the derivatives of subroutine outputs with respect to MotionSolve states) associated with the subroutine are discarded. |
5. | The following two plots show an example of the same continuous output (blue line) as seen by MotionSolve with the discrete interface (red line). |
Zero Order Hold
First Order Hold
6. | Besides co-simulation, where the data between the solver and the user-written-subroutines are exchanged discretely, you may also call SET_DISCRETE_INTERFACE from the user-written subroutine(s) to potentially improve corrector convergence. This may be useful if the subroutine outputs are extremely discontinuous and you don't want the solver to calculate the Jacobian terms numerically for use with the corrector iterations. |
|