I have two questions about using SYSARY in subroutines:
1) How can I tell the units at which SYSARY outputs the data (e.g. velocities)? I have set units in Adams as mm/deg but I think that my angular velocty components where output in rad/s.
2) In which manner does SYSARY request data. For example, when requesting displacements , SYSARY receives the ipar vector, containing the values of I marker, J marker and I marker. Does this mean that SYSARY requiests the displacement of the I marker, relative to the J marker, in the reference frame of the I marker?
#1: SYSARY and SYSFNC will give you values in model units for all types of data EXCEPT angles. The Adams Solver always works in radians internally, hence you will always get angular values in radians, and you should always feed back values in radians.
Just as if you specify a function for some angular value inside Adams View - then you will also need to specify it in radians, or specifically let the solver know that it is in degrees, like specifying 30D.
#2: The values are measured just as you would measure them in a function.
So measuring DX, specifying only one marker in your IPAR vector gives you DX(I_MARKER) - so all other values default to ground.
Specifying two markers DX(I_MARKER, J_MARKER) gives you dx between the markers in the global reference system.
Specifying all three markers DX(I_MARKER, J_MARKER, K_MARKER) gives you dx between I and J in the reference of K.
Regarding the use of reference markers, when they rotate along one of the bodies, do the DX value directions change as well, or do they keep getting calculated based on the reference marker's initial orientation?
To clarify here is my case:
I used a subroutine which estimates the displacement between two markers in the x, y directions and returns a force based on them (kind of like a spring in the manner of fx =k*x and fy = k*y). Assuming I calculate x between markers I and J using marker I as reference, that is DX(I_MARKER, J_MARKER, I_MARKER), while marker I rotates along with its parent body. Will the direction of x be constant (aligned with the I_MARKER's original orientation) or will it change based on its rotation?
I also have the same problem when returning the calculated force. Is fx returned to Adams in the original orientation, or in the current orientation of the gforce marker?
If the reference vector rotates during the analysis, the result follows this. The solver will not remember any "initial orientation".
If it helps, you can do simple testing by using direct function input into a state variable instead of the subroutine calls. Comparing direct function results with your subroutine results could help you debug.