×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Are you an
Engineering professional?
Join Eng-Tips Forums!
• Talk With Other Members
• Be Notified Of Responses
• Keyword Search
Favorite Forums
• Automated Signatures
• Best Of All, It's Free!

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

#### Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

# User written subroutine

## User written subroutine

(OP)
Hi all,

I want to determine the Displacement Velocity and Acceleration of a damper under simulation to calculate the Damper Force in a user written subroutine. Descibing the part and marker statement are not supporetd by fortran compiler. Can any body give me some tips how this can be done.

This is how I have dont it at the moment

PART/01, MASS=1, IM=280.2, -567.0, 345.0 &
&,IP=100.0,100.0,100.0
MARKER/0101, QP=267.0, -600.0, 180.0
!
! Defining upper damper mount
!
PART/02, MASS=1, IM=293.4, -534.0, 510.0 &
&,IP=100.0,100.0,100.0
MARKER/0201 QP=307.0, -500.0, 680.0
!
! Determine displacement
!
DIS, FUNCTION=DM(01,02)
!
! Determine velocity
!
VEL, FUNCTION=VM(01,02)
!
! Determine acceleration
!
ACC, FUNCTION=ACCM(01,02)
!

### RE: User written subroutine

Have you read the help section on user-written subroutines? particularly SFOSUB? Which even includes an example...

Cheers

Greg Locock

Please see FAQ731-376 for tips on how to make the best use of Eng-Tips.

### RE: User written subroutine

(OP)
The tip you gave me for using SFOSUB as a starting point for my subroutine was really useful.

I dont understand how will the software get he valuse of PAR ( 4,5,6,7 ) or am i supposed to mention them.
PAR(1,2,3) are the co-ordinatres of the marker whoes vel./disp. is being measured in 'z' direction. Shall I mention them as well. And what if I want to measure DM?
I dont have a clue what does IPAR( 1 )  = NINT(PAR( 1 )) mean.

### RE: User written subroutine

Yes, you have to explicitly pass the variables to your sub, and read the answers back in to the Solver.

The easiest example of functional code in the tutorials is the ABS controller example, which includes all the code, and it works.

Cheers

Greg Locock

Please see FAQ731-376 for tips on how to make the best use of Eng-Tips.

#### Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

#### Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Close Box

# Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

• Talk To Other Members
• Notification Of Responses To Questions
• Favorite Forums One Click Access
• Keyword Search Of All Posts, And More...

Register now while it's still free!