VM8

VM8
Parametric Calculation of Point-to-Point Distances

Overview

Reference:Any Basic Geometry Text
Analysis Type(s):Parametric Arithmetic
Element Type(s):None
Input Listing:vm8.dat

Test Case

Write a user file macro to calculate the distance d between either nodes or keypoints in PREP7. Define abbreviations for calling the macro and verify the parametric expressions by using the macro to calculate the distance between nodes N1 and N2 and between keypoints K3 and K4.

Figure 11: Parametric Calculation Problem Sketch

Parametric Calculation Problem Sketch

Geometric Properties
N1 (x, y, z) = 1.5,2.5,3.5
N2 (x, y, z) = -3.7,4.6,-3
K3 (x, y, z) = 100,0,30
K4 (x, y, z) = -200,25,80

Analysis Assumptions and Modeling Notes

The user file is created by the *CREATE command within the run. In normal use, this file would most likely already exist locally. Colons are used in the user file to create non-echoing comments (the colon character specifies a branching label in Mechanical APDL). The active coordinate system is saved and restored within the macro to ensure Cartesian coordinates in the distance calculations and to re-establish the active coordinate system after the macro is used. Lowercase input is used throughout. Input case is preserved by Mechanical APDL where appropriate (system-dependent).

Results Comparison

TargetMechanical APDLRatio
N1 - N2 distance (LEN2)8.58498.581.000
K3 - K4 distance (LEN1)305.16305.161.000