Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations GregLocock on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

User written subroutine 1

Status
Not open for further replies.

subroutine

Automotive
Sep 4, 2006
2
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)
!
 
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.
 
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.

Can you please explain.
 
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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor