关于STEP函数的问题 - 图文

更新时间:2024-02-26 23:13:01 阅读量: 综合文库 文档下载

说明:文章内容仅供预览,部分内容可能不全。下载后的文档,内容与下面显示的完全一致。下载之前请确认下面内容是否您想要的,是否完整无缺。

ADAMS的函数种类比较多:

1、Displacement Functions 2、Velocity Functions 3、 Acceleration Functions 4、 Contact Functions 5、 Spline Functions

6、 Force in Object Functions 7、Resultant Force Functions 8、 Math Functions 9、 Data Element Access

10、User-Written Subroutine Invocation 11、Constants & Variables

虽然在ADAMS的帮助文档有些说明,但实际使用时初学者可能往往遇到困难,现根据自己已往的经验对一些常用的函数作一介绍,并相应给出了实例,充实论坛,也方便后学的同志。 一、 几个常用函数的说明 1、 STEP函数

格式:STEP (x, x0, h0, x1, h1) 参数说明:

x ―自变量,可以是时间或时间的任一函数

x0 ―自变量的STEP函数开始值,可以是常数或函数表达式或设计变量; x1 ―自变量的STEP函数结束值,可以是常数、函数表达式或设计变量 h0 ― STEP函数的初始值,可以是常数、设计变量或其它函数表达式 h1 ― STEP函数的最终值,可以是常数、设计变量或其它函数表达式

此主题相关图片如下:

2、 IF函数

格式:IF(表达式1: 表达式2, 表达式3, 表达式4) 参数说明:

表达式1-ADAMS的评估表达式;

表达式2-如果的Expression1值小于0,IF函数返回的Expression2值; 表达式3-如果表达式1的值等于0,IF函数返回表达式3的值; 表达式4-如果表达式1的值大于0,IF函数返回表达式4的值; 例如:函数 IF(time-2.5:0,0.5,1) 结果: 0.0 if time < 2.5 0.5 if time = 2.5 1.0 if time > 2.5 3、AKISPL函数

格式:AKISPL (First Independent Variable, Second Independent Variable,Spline Name, Derivative Order) 参数说明:

First Independent Variable —— spline中的第一个自变量 Second Independent Variable (可选) —— spline中的第二自变量

Spline Name —— 数据单元spline的名称 Derivative Order (可选) —— 插值点的微分阶数,一般用0就可以了 例如:

function = AKISPL(DX(marker_1, marker_2, marker_2), 0, spline_1) spline_1用下表中的离散数据定义

自变量(x): -4.0 -3.0 -2.0 -1.0 0.0 1 2 3 4 函数值 (y): -3.6 -2.5 -1.2 -0.4 0.0 0.4 1.2 2.5 3.6 AKISPL的拟合曲线如下:

自变量(x): -4.0 -3.0 -2.0 -1.0 0.0 1 2 3 4 函数值 (y): -3.6 -2.5 -1.2 -0.4 0.0 0.4 1.2 2.5 3.6 AKISPL的拟合曲线如下:

二、实例说明 1、分段函数的表示

在ADMA中如何输入力或位移、速度、加速度等的分段曲线,这一直是一个值得注意的问题。 下面用一个小例子进行简单说明:(这个例子实际上就是常见的加速-匀速-减速问题) 1) 要输入的速度函数为:

10*t (0

V= 1 (0.1

-10*t+5 (0.4

velo(time)=if(time-0.1:step(time,0,0,0.1,1),1,step(time,0.4,1,0.5,0)) 3) 得到的速度曲线如下图:

2、方形波函数的输入

1) 有时需要输入下方波形式的力或力矩,如果单纯地采用STEP函数迭加是不能实现的。

2) 在ADAMS中输入的函数形式为: step(sin(2*pi*time),-0.01,-1,0.01,1)

注意点:

⑴当方波的频率改变时,可以通过改变下式中的FREQ得以实现 sin(2*pi*FREQ*time) ⑵改变方波的上下限的方法:

step(sin(2*pi*time),-0.01,LOWER,0.01,UPPER) ⑶例如:

step(sin(2*pi*3.0*time),-0.01,0,0.01,7) 中的频率为3HZ,上下限分别为0,7 3) 在ADAMS中所得到的方波曲线如下:

3、 AKISPL函数的应用

有时做路径规划或输入力或力矩时,需要用到AKISPL函数,关于这部分的内容,我不详细讨论了,可参考我前面发的帖子。

http://www.dytrol.com/bbs/dispbbs.asp?boardID=4&ID=1601&page=1

数据单元SPLINE实际上可根据多种渠道创建,如经验数据、实验数据等都可以。 建立SPLINE时所用的数据:

Time Dis_X 0 0 0.263157895 264.6382854 0.526315789 529.0483902 0.789473684 751.4278083 1.052631579 781.2404309 1.315789474 619.0122219 1.578947368 552.1253792 1.842105263 718.4079735 2.105263158 983.8161748 2.368421053 1248.462634 2.631578947 1513.142799 2.894736842 1777.653155 3.157894737 2034.291889 3.421052632 2156.967539 3.684210526 2085.106599 3.947368421 2025.181599

4.210526316 2146.663913 4.473684211 2375.226147 4.736842105 2634.081904 5 2900 Time Dis_Z 0 0 0.263157895 -7.67E-04 0.526315789 0.613674188 0.789473684 102.2423923 1.052631579 352.6958661 1.315789474 558.5047146 1.578947368 807.3775974 1.842105263 1002.119048 2.105263158 1000.01823 2.368421053 1000.009096 2.631578947 1000.267792 2.894736842 999.4879245 3.157894737 962.0426698 3.421052632 736.5248822 3.684210526 484.6759224 3.947368421 264.2985997 4.210526316 38.2516224 4.473684211 4.175972774 4.736842105 -1.187352978 5 0 我也来一个分段函数: y=-x^2-20 X<-1

x+10 -1<=x<=15 x^2-15 x>15 解答:

y=if(x+1:-x^2-20,x+10,if(x-15:x+10,x+10,x^2+15)) 也就是:

x+1<0,即x<-1,y=-x^2-20 x+1=0,即x=-1,y=x+10

x+1>0,即x>-1 y=if(x-15:x+10,x+10,x^2+15)

x+1>0 且x-15<0,即-10 且x-15=0,即x=15,y=x+10 x+1>0 且x-15>0,即x>15,y=x^2-15 我也发一个关于测量接触力的是一位高手交给我的: CONTACT( Contact_Name , On_Body , Component , Axes ) contact_name 接触力的名字

on_body 作用体与反作用体,0为I物体,就是作用体,1为J物体就是反作用体! Component 是接触的分量。1代表力总的大小,2代表X方向的分力,3代表Y方向上的,4代表Z方向上的。5代表力矩总的大小,6代表X方向的力矩(右手螺旋),7代表Y方向的,8代表Z方向的!

Axes 是一个marker,就是代表你在哪个坐标系下测量。默认为0,也就是在大地坐标系下测量

在定义接触力时Normal Force有两个选项:

1、Restitution(Define a restitution-based contact); 2、Impact(Define an impact contact)

第二个选项就是利用IMPACT函数,它能方便地表达那种间歇碰撞力 (即达到某一位移值才激发的碰撞力)。 它的参数意义及力学基础: One-sided Impact (IMPACT)

1、理解:用只抗压缩的非线性的弹簧阻尼方法近似计算出单边碰撞力。

2、格式:IMPACT (Displacement Variable, Velocity Variable, Trigger for Displacement Variable, Stiffness Coefficient, Stiffness Force Exponent, Damping Coefficient, Damping Ramp-up Distance) 3、参数说明:

Displacement Variable

实时位移变量值,通过DX、DY、DZ、DM等函数实时测量。 Velocity Variable

实时速度变量值,通过VX、VY、VZ、VM等函数实时测量。 Trigger for Displacement Variable 激发碰撞力的位移测量值。 Stiffness Coefficient or K 刚度系统。

Stiffness Force Exponent 非线性弹簧力指数。 Damping Coefficient or C 阻尼系数。

Damping Ramp-up Distance

当碰撞力被激发阻尼逐渐增大的位移值。 4、Impact函数的力学基理:

IMPACT函数值由自变量值决定其有无: IMPACT = Off if s > so On if s <=so

IMPACT函数的数学计算公式为:

MAX {0, K(so - s)**e - Cv *STEP (s, so- d, 1, so ,0)} 参数说明: s ——位移变量 v ——速度变量

so——碰撞力的激发位移值

K ——刚度系数 C ——阻尼系数

D ——阻尼逐渐增大的位移值

哈哈,谢谢freexx的表扬

BISTOP函数:它的格式是BISTOP( x, dx, x1, x2, k, e, cmax, d)这里它由八个参数定义。它与函数IMPACT类似。

可以这么说:BISTOP是双侧碰撞函数,而IMPACT是单侧碰撞函数。

BISTOP的触发是由两个边界条件确定的,即x1和x2,当x值大于或等于x1且小于或等于x2时,函数值为0,当x值大于x2或小于x1时,它的值是不同的。 当x小于x1时,返回值是:k(x1-x)^e-cmax*dx*step(x,x1-d,1,x1,0),当x大于x2时,返回值是:k(x-x2)^e-cmax*dx*step(x,x2,1,x2+d,0)。 各种参数表示意义可以从IMPACT里推出来,它只是多了一个x2。

关于STEP函数得问题:

Step函数格式为:step(x,x0,h0,x1,h1) 其中各参数意义如下: x,自变量;

x0,阶跃函数起点自变量值; h0, 阶跃起点处函数值; x1,阶跃终点自变量值; h1,阶跃终点函数值

STEP(X, X0, H0, X1,H1, 0, TEMP1, ERRFLG)

这个是adams提供的功能子函数,主要是用于用户自己编译的子程序中,可直接调用该函数,其中前五个参数跟平常的step函数是一样的。TEMP1为返回值,ERRFLG为若出错返回一个错误信息。 ________________________________________________________

我拿帮助文件里的一个例子给解释一下。这个例子是用户自编译的传感器的子程序。源代码如下: SUBROUTINE SENSUB (ID, TIME, PAR, NPAR, IFLAG, VALUE ) INTEGER ID

DOUBLE PRECISION TIME DOUBLE PRECISION PAR( * ) INTEGER NPAR LOGICAL IFLAG

DOUBLE PRECISION VALUE C以上为函数的实参定义。

DOUBLE PRECISION X0, H0, X1, H1, STPVAL LOGICAL ERRFLG

C以上为形参,即用户自定义的参数。 X0 = PAR(1) H0 = PAR(2) X1 = PAR(3) H1 = PAR(4)

C 将形参赋给参数数组。

CALL STEP(TIME, X0, H0, X1, H1, 0, STPVAL, ERRFLG) C调用功能程序。

CALL ERRMES(ERRFLG, 'Error calling STEP from SENSUB.', & ID, 'STOP' ) VALUE = STPVAL C若出错给出错误信息。 RETURN END

C返回STPVAL值,结束程序。

举个简单的例子,比如在一个系统中要设定一个传感器。知道它监控的值发生在3~4秒之间,值的大小在5~6之间,但达到这个值的具体时间并不确定。这个值用step表示为step(time,3,5,4,6)。我们要求当传感器监控的值达到一个数比如5.7时停止仿真。做法如下:

首先将上面的子程序编译,链接,生成一个dll文件,比如为sen.dll,链接到adams中。在adams/view中应选择如图的设置。

接着建一个简单的模型,在其中建立一个传感器,设置如图所示。然后进行仿真,仿真时间5秒,步长0.01。在我的例子中当时间为3.63秒时停止仿真。

动画如下:

我只是举个简单的例子说明功能函数的使用,具体的应用还要看自己的需要。一般情况下adams所提供的function都是够用的。只在特殊的情况下才需用户子程序的。

一条曲线,其节点是:

X (time) , Y(deg) 0 , 0 0.15 , 20 0.3 , 0 0.45, 20 0.6, 45 0.75 , 60 0.9, 15 1, 0

请问如果用step函数来表示,应该怎么写? 不胜感激?

step(time,0,0d,0.15,20d)

+step(time,0.15,0d,0.3,-20d)+step(time,0.3,0,0.45,20d) +step(time,0.45,0d,0.6,25d)+step(time,0.6,0d,0.75,15d) +step(time,0.75,0d,0.9,-45d)+step(time,0.9,0d,1.0,-15d)

呵呵 ,虽然有些麻烦,但是容易理解,也应该是正确的,你可以到精华区搜索一下,有斑竹的帖子,并且有step函数的介绍。

step(time,0,0,0.15,20)+step(time,0.15,0,0.3,-20)+step(time,0.3,0,0.45,20)+step(time,0.45,0,0.6,25)+step(time,0.6,0,0.75,15)+step(time,0.75,0,0.9,-45)+step(time,0.9,0,1.0,-15) 或定义为: step(time,0,0,0.15, step(time,0.15,20,0.3, step(time,0.3,0,0.45, step(time,0.45,20,0.6, step(time,0.6,45,0.75, step(time,0.75,60,0.9, step(time,0.9,15,1.0,0) ))))))

论坛上有andyxin做的step函数的两种用法的帖子,可以好好找来看看的

看看是不是你想要的结果?函数应该是如下(上面写的有点问题):

step(time,0,0d,0.15,20d)+step(time,0.15,0d,0.3,-20d)+step(time,0.3,0,0.45,20d) +step(time,0.45,0d,0.6,25d)+step(time,0.6,0d,0.75,15d) +step(time,0.75,0d,0.9,-45d)+step(time,0.9,0d,1.0,-15d)。

问题:

我要添加一个分段的力,力是位移的函数,物体向下运动时,Y坐标由大变小,我用了step函数,而

step(A,x0,h0,x1,h1)函数中,仿真要求x0x1才

行。 我看了论坛中的一些文章,例子中力都是时间的函数,和我的不同, 希望高手指点一下:

把你的位移,即A改成-A,如step(-DY(cm, MARKER_2),0,10,100,50)。

谢谢damo,但是还是有问题,由于我的模型中物体位置沿Y方向从-1到-2,施加的力从10N到100N,我的设置是step(-(DY(PART_1.cm),-1,10,-2,100),仿真后还是出错,如下:

ERROR: The value of x0 must be less than the value of x1 in a STEP function. You have input x0=-1 and x1=-2. 怎么办啊 ? 先谢谢了

应该是这样step(-(DY(PART_1.cm),1,10,2,100),我不知道你想作什么,我作了一个简单的例子,你看看是否符合你的要求。

要建的模型需要加一个预紧力,然后在模型运动开始时这个力要突然去掉。请问如何加这个力呢?

Step函数应该可以实现。或者在指定的时间使用Deactivate使之失效 我个人认为,瞬时力本身是一个理想的概念。 再短也有个作用时间。

实际的力作用总是有个时间的。

如果你一定要一个瞬时力作用,我觉得用step函数足够。 比如

100*(STEP(time,0,0,0.01,1)+STEP(time,0.02,0,0.03,-1)) 从0秒开始作用,0.03秒时撤销

用了0.01秒作为瞬时作用时间。这个时间大小可能要看你的模型。

其实瞬时力作用的目的是获得初速度,或者效果是等价的。 因此可以按panda5165 说的,给一个物体的初速度。

下面这个机构要在兰线位移处受力,而其余位置不受作用力,请问这个施加力的函数该怎么编?

谢谢版主赐教:STEP( x , x0 , h0 , x1 , h1 )由数组A的X值,生成区间(x0 , h0 )至(x1 , h1 )的阶梯曲线,返回y值的数组。这句话是书中原话,搞不明白怎么用,版主能说清楚一点吗?再有可以在力函数编辑器里采用if....语句吗? 谢谢你介绍的这么详细。

我按照你的指点做了一下,结果却还是常数1000N,这是第一个问题。

再有如果自变量x不用时间time而用该机构曲柄的转角作为自变量,因为曲柄转角做为自变量更为精确,这样的话step函数中的x该怎么使用曲柄转角呢?

上面那个图的周期我搞错了,应该是0.5秒,而不是1秒,修改如图。

出问题的画面如下,还望牧羊人1118 和各位大侠指点一下,谢谢!

兰线处显示是常量,那处红线我是用曲柄转角作为横坐标的。

搜索了论坛的有关step的帖子,基本自己解决了这个问题。

STEP( time,0.2,0,0.21,1000 )+ STEP( time,0.21,0,0.3,0 )+STEP( time,0.3,0,0.31,-1000) 这样就得到自己所需的结果啦。谢谢上面两位大侠

牧羊人1118:上午我做了一下,确实有问题,我已经给你修改了以下,在下面.另外如果变量不是时间是转角,就使用转角代替时间,也可以. !

!-------------------------- Default Units for Model ---------------------------! ! !

defaults units & length = mm & angle = deg & force = newton & mass = kg & time = sec !

defaults units &

coordinate_system_type = cartesian & orientation_type = body313 !

!------------------------ Default Attributes for Model ------------------------! ! !

defaults attributes &

inheritance = bottom_up & icon_visibility = on & grid_visibility = off &

size_of_icons = 20.0 & spacing_for_grid = 1000.0 !

!------------------------------ Adams/View Model ------------------------------! ! !

model create &

model_name = model_1 !

model attributes &

model_name = model_1 & size_of_icons = 20.0 !

view erase !

!--------------------------------- Materials ----------------------------------! ! !

material create &

material_name = .model_1.steel & adams_id = 1 &

youngs_modulus = 2.07E+005 & poissons_ratio = 0.29 & density = 7.801E-006 !

!-------------------------------- Rigid Parts ---------------------------------! !

! Create parts and their dependent markers and graphics !

!----------------------------------- ground -----------------------------------! ! !

! ****** Ground Part ****** !

defaults model & part_name = ground !

defaults coordinate_system &

default_coordinate_system = .model_1.ground !

! ****** Markers for current part ****** !

marker create &

marker_name = .model_1.ground.MARKER_12 & adams_id = 12 &

location = 150.0, 0.0, 0.0 & orientation = 0.0d, 0.0d, 0.0d !

marker create &

marker_name = .model_1.ground.MARKER_25 &

adams_id = 25 &

location = -93.3, 99.775, 0.0 & orientation = 180.0d, 90.0d, 180.0d !

marker create &

marker_name = .model_1.ground.MARKER_33 & adams_id = 33 &

location = 300.0, 0.0, 0.0 & orientation = 0.0d, 0.0d, 0.0d !

marker create &

marker_name = .model_1.ground.MARKER_40 & adams_id = 40 &

location = -10.0, -15.0, 0.0 & orientation = 0.0d, 0.0d, 0.0d !

marker create &

marker_name = .model_1.ground.MARKER_43 & adams_id = 43 &

location = -213.2997769648, 100.0063620378, 0.0 & orientation = 359.8895326957d, 90.0d, 180.0d !

part create rigid_body mass_properties & part_name = .model_1.ground & material_type = .model_1.steel

!

! ****** Points for current part ****** !

point create &

point_name = .model_1.ground.POINT_1 & location = 0.0, 0.0, 0.0 !

point attributes &

point_name = POINT_1 & size_of_icons = 20.0 !

point create &

point_name = .model_1.ground.POINT_2 & location = 150.0, 0.0, 0.0 !

point create &

point_name = .model_1.ground.POINT_3 & location = -100.0, 0.0, 0.0 !

point create &

point_name = .model_1.ground.POINT_4 & location = 225.0, 0.0, 0.0 !

point create &

point_name = .model_1.ground.POINT_5 &

location = -93.3, 99.775, 0.0 !

point create &

point_name = .model_1.ground.POINT_11 & location = -93.3, 140.0, 0.0 !

point create &

point_name = .model_1.ground.POINT_15 & location = -213.2997769648, 100.0063620378, 0.0 !

point create &

point_name = .model_1.ground.POINT_15_2 & location = -10.0, -15.0, 0.0 !

point create &

point_name = .model_1.ground.POINT_16 & location = 10.0, -15.0, 0.0 !

! ****** Graphics for current part ****** !

part attributes &

part_name = .model_1.ground & name_visibility = off & size_of_icons = 20.0 !

!----------------------------------- PART_2 -----------------------------------! ! !

defaults coordinate_system &

default_coordinate_system = .model_1.ground !

part create rigid_body name_and_position & part_name = .model_1.PART_2 & adams_id = 2 &

location = 0.0, 0.0, 0.0 & orientation = 0.0d, 0.0d, 0.0d !

defaults coordinate_system &

default_coordinate_system = .model_1.PART_2 !

! ****** Markers for current part ****** !

marker create &

marker_name = .model_1.PART_2.MARKER_1 & adams_id = 1 &

location = -100.0, 0.0, 0.0 & orientation = 0.0d, 0.0d, 0.0d !

marker create &

marker_name = .model_1.PART_2.MARKER_2 &

adams_id = 2 &

location = 270.0, 0.0, 0.0 & orientation = 0.0d, 0.0d, 0.0d !

marker create &

marker_name = .model_1.PART_2.cm & adams_id = 13 &

location = 85.0, 0.0, 0.0 & orientation = 0.0d, 0.0d, 0.0d !

marker create &

marker_name = .model_1.PART_2.MARKER_7 & adams_id = 7 &

location = 0.0, 0.0, 0.0 & orientation = 0.0d, 0.0d, 0.0d !

marker create &

marker_name = .model_1.PART_2.MARKER_9 & adams_id = 9 &

location = -100.0, 0.0, 0.0 & orientation = 0.0d, 0.0d, 0.0d !

marker create &

marker_name = .model_1.PART_2.MARKER_27 & adams_id = 27 &

location = 225.0, 0.0, 0.0 & orientation = 270.0d, 90.0d, 180.0d !

part create rigid_body mass_properties & part_name = .model_1.PART_2 & material_type = .model_1.steel !

! ****** Graphics for current part ****** !

geometry create shape link &

link_name = .model_1.PART_2.LINK_6 & i_marker = .model_1.PART_2.MARKER_1 & j_marker = .model_1.PART_2.MARKER_2 & width = 10.0 & depth = 18.5 !

part attributes &

part_name = .model_1.PART_2 & color = RED & name_visibility = off !

!----------------------------------- PART_3 -----------------------------------! ! !

defaults coordinate_system &

default_coordinate_system = .model_1.ground !

part create rigid_body name_and_position & part_name = .model_1.PART_3 & adams_id = 3 &

location = 0.0, 0.0, 0.0 & orientation = 0.0d, 0.0d, 0.0d !

defaults coordinate_system &

default_coordinate_system = .model_1.PART_3 !

! ****** Markers for current part ****** !

marker create &

marker_name = .model_1.PART_3.MARKER_3 & adams_id = 3 &

location = 150.0, 0.0, 0.0 & orientation = 0.0d, 0.0d, 0.0d !

marker create &

marker_name = .model_1.PART_3.MARKER_4 & adams_id = 4 &

location = 225.0, 0.0, 0.0 & orientation = 0.0d, 0.0d, 0.0d !

marker create &

marker_name = .model_1.PART_3.cm & adams_id = 14 &

location = 187.5, 0.0, 0.0 & orientation = 0.0d, 0.0d, 0.0d !

marker create &

marker_name = .model_1.PART_3.MARKER_11 & adams_id = 11 &

location = 150.0, 0.0, 0.0 & orientation = 0.0d, 0.0d, 0.0d !

marker create &

marker_name = .model_1.PART_3.MARKER_17 & adams_id = 17 &

location = 225.0, 0.0, 0.0 & orientation = 0.0d, 0.0d, 0.0d !

part create rigid_body mass_properties & part_name = .model_1.PART_3 & material_type = .model_1.steel !

! ****** Graphics for current part ****** !

geometry create shape link &

link_name = .model_1.PART_3.LINK_7 & i_marker = .model_1.PART_3.MARKER_3 & j_marker = .model_1.PART_3.MARKER_4 & width = 10.0 & depth = 3.75 !

part attributes &

part_name = .model_1.PART_3 & color = GREEN & name_visibility = off !

!----------------------------------- PART_4 -----------------------------------! ! !

defaults coordinate_system &

default_coordinate_system = .model_1.ground !

part create rigid_body name_and_position & part_name = .model_1.PART_4 & adams_id = 4 &

location = 0.0, 0.0, 0.0 & orientation = 0.0d, 0.0d, 0.0d !

defaults coordinate_system &

default_coordinate_system = .model_1.PART_4

!

! ****** Markers for current part ****** !

marker create &

marker_name = .model_1.PART_4.MARKER_5 & adams_id = 5 &

location = -100.0, 0.0, 0.0 &

orientation = 86.158293458d, 0.0d, 0.0d !

marker create &

marker_name = .model_1.PART_4.MARKER_6 & adams_id = 6 &

location = -93.3, 99.775, 0.0 & orientation = 86.158293458d, 0.0d, 0.0d !

marker create &

marker_name = .model_1.PART_4.cm & adams_id = 15 &

location = -96.65, 49.8875, 0.0 & orientation = 356.158293458d, 0.0d, 0.0d !

marker create &

marker_name = .model_1.PART_4.MARKER_10 & adams_id = 10 &

location = -100.0, 0.0, 0.0 &

orientation = 0.0d, 0.0d, 0.0d !

marker create &

marker_name = .model_1.PART_4.MARKER_21 & adams_id = 21 &

location = -93.3, 99.775, 0.0 & orientation = 0.0d, 0.0d, 0.0d !

part create rigid_body mass_properties & part_name = .model_1.PART_4 & material_type = .model_1.steel !

! ****** Graphics for current part ****** !

geometry create shape link &

link_name = .model_1.PART_4.LINK_8 & i_marker = .model_1.PART_4.MARKER_5 & j_marker = .model_1.PART_4.MARKER_6 & width = 10.0 & depth = 4.9999851562 !

part attributes &

part_name = .model_1.PART_4 & color = MAIZE & name_visibility = off

!

!----------------------------------- PART_5 -----------------------------------! ! !

defaults coordinate_system &

default_coordinate_system = .model_1.ground !

part create rigid_body name_and_position & part_name = .model_1.PART_5 & adams_id = 5 &

location = 0.0, 0.0, 0.0 & orientation = 0.0d, 0.0d, 0.0d !

defaults coordinate_system &

default_coordinate_system = .model_1.PART_5 !

! ****** Markers for current part ****** !

marker create &

marker_name = .model_1.PART_5.MARKER_16 & adams_id = 16 &

location = 210.0, -10.0, -15.0 & orientation = 0.0d, 0.0d, 0.0d !

marker create &

marker_name = .model_1.PART_5.cm & adams_id = 19 &

location = 225.0, 0.0, 0.0 & orientation = 0.0d, 0.0d, 0.0d !

marker create &

marker_name = .model_1.PART_5.MARKER_18 & adams_id = 18 &

location = 225.0, 0.0, 0.0 & orientation = 0.0d, 0.0d, 0.0d !

marker create &

marker_name = .model_1.PART_5.MARKER_26 & adams_id = 26 &

location = 225.0, 0.0, 0.0 & orientation = 270.0d, 90.0d, 180.0d !

part create rigid_body mass_properties & part_name = .model_1.PART_5 & material_type = .model_1.steel !

! ****** Graphics for current part ****** !

geometry create shape block &

block_name = .model_1.PART_5.BOX_9 &

adams_id = 9 &

corner_marker = .model_1.PART_5.MARKER_16 & diag_corner_coords = 30.0, 20.0, 30.0 !

part attributes &

part_name = .model_1.PART_5 & color = GREEN & name_visibility = off !

!----------------------------------- PART_6 -----------------------------------! ! !

defaults coordinate_system &

default_coordinate_system = .model_1.ground !

part create rigid_body name_and_position & part_name = .model_1.PART_6 & adams_id = 6 &

location = 0.0, 0.0, 0.0 & orientation = 0.0d, 0.0d, 0.0d !

defaults coordinate_system &

default_coordinate_system = .model_1.PART_6 !

! ****** Markers for current part ******

!

marker create &

marker_name = .model_1.PART_6.MARKER_20 & adams_id = 20 &

location = -105.0, 90.0, -15.0 & orientation = 0.0d, 0.0d, 0.0d !

marker create &

marker_name = .model_1.PART_6.cm & adams_id = 23 &

location = -95.0, 100.0, 0.0 & orientation = 0.0d, 0.0d, 0.0d !

marker create &

marker_name = .model_1.PART_6.MARKER_22 & adams_id = 22 &

location = -93.3, 99.775, 0.0 & orientation = 0.0d, 0.0d, 0.0d !

marker create &

marker_name = .model_1.PART_6.MARKER_24 & adams_id = 24 &

location = -93.3, 99.775, 0.0 & orientation = 180.0d, 90.0d, 180.0d !

marker create &

marker_name = .model_1.PART_6.MARKER_30 & adams_id = 30 &

location = -93.3, 99.775, 0.0 & orientation = 0.0d, 0.0d, 0.0d !

part create rigid_body mass_properties & part_name = .model_1.PART_6 & material_type = .model_1.steel !

! ****** Graphics for current part ****** !

geometry create shape block &

block_name = .model_1.PART_6.BOX_10 & adams_id = 10 &

corner_marker = .model_1.PART_6.MARKER_20 & diag_corner_coords = 20.0, 20.0, 30.0 !

part attributes &

part_name = .model_1.PART_6 & color = MAIZE & name_visibility = off !

!----------------------------------- PART_7 -----------------------------------! !

!

defaults coordinate_system &

default_coordinate_system = .model_1.ground !

part create rigid_body name_and_position & part_name = .model_1.PART_7 & adams_id = 7 &

location = 0.0, 0.0, 0.0 & orientation = 0.0d, 0.0d, 0.0d !

defaults coordinate_system &

default_coordinate_system = .model_1.PART_7 !

! ****** Markers for current part ****** !

marker create &

marker_name = .model_1.PART_7.MARKER_42 & adams_id = 42 &

location = -213.2997769648, 100.0063620378, 0.0 & orientation = 359.8895326957d, 90.0d, 180.0d !

marker create &

marker_name = .model_1.PART_7.MARKER_28 & adams_id = 28 &

location = -93.3, 99.775, 0.0 &

orientation = 179.8895326957d, 0.0d, 0.0d !

marker create &

marker_name = .model_1.PART_7.MARKER_29 & adams_id = 29 &

location = -213.2997769648, 100.0063620378, 0.0 & orientation = 179.8895326957d, 0.0d, 0.0d !

marker create &

marker_name = .model_1.PART_7.cm & adams_id = 32 &

location = -153.2998884824, 99.8906810189, 0.0 & orientation = 359.8895326957d, 0.0d, 0.0d !

marker create &

marker_name = .model_1.PART_7.MARKER_31 & adams_id = 31 &

location = -93.3, 99.775, 0.0 & orientation = 0.0d, 0.0d, 0.0d !

part create rigid_body mass_properties & part_name = .model_1.PART_7 & material_type = .model_1.steel !

! ****** Graphics for current part ******

!

geometry create shape link &

link_name = .model_1.PART_7.LINK_11 & i_marker = .model_1.PART_7.MARKER_28 & j_marker = .model_1.PART_7.MARKER_29 & width = 10.0 & depth = 5.8350108451 !

part attributes &

part_name = .model_1.PART_7 & color = CYAN & name_visibility = off !

!----------------------------------- PART_8 -----------------------------------! ! !

defaults coordinate_system &

default_coordinate_system = .model_1.ground !

part create rigid_body name_and_position & part_name = .model_1.PART_8 & adams_id = 8 &

location = 0.0, 0.0, 0.0 & orientation = 0.0d, 0.0d, 0.0d !

defaults coordinate_system &

default_coordinate_system = .model_1.PART_8 !

! ****** Markers for current part ****** !

marker create &

marker_name = .model_1.PART_8.MARKER_8 & adams_id = 8 &

location = 0.0, 0.0, 0.0 & orientation = 0.0d, 0.0d, 0.0d !

marker create &

marker_name = .model_1.PART_8.MARKER_36 & adams_id = 36 & location = 0.0, 0.0, 0.0 & orientation = 0.0d, 0.0d, 0.0d !

marker create &

marker_name = .model_1.PART_8.MARKER_37 & adams_id = 37 &

location = -10.0, -15.0, 0.0 & orientation = 0.0d, 0.0d, 0.0d !

marker create &

marker_name = .model_1.PART_8.MARKER_38 &

adams_id = 38 &

location = 10.0, -15.0, 0.0 & orientation = 0.0d, 0.0d, 0.0d !

marker create &

marker_name = .model_1.PART_8.cm & adams_id = 41 &

location = 0.0, -10.1104897666, 0.0 & orientation = 0.0d, 0.0d, 0.0d !

marker create &

marker_name = .model_1.PART_8.MARKER_39 & adams_id = 39 &

location = -10.0, -15.0, 0.0 & orientation = 0.0d, 0.0d, 0.0d !

part create rigid_body mass_properties & part_name = .model_1.PART_8 & material_type = .model_1.steel !

! ****** Graphics for current part ****** !

geometry create shape plate &

plate_name = .model_1.PART_8.PLATE_17 &

marker_name = .model_1.PART_8.MARKER_36, .model_1.PART_8.MARKER_37, &

.model_1.PART_8.MARKER_38 & width = 20.0 & radius = 3.0 !

part attributes &

part_name = .model_1.PART_8 & color = GREEN & name_visibility = off !

!----------------------------------- Joints -----------------------------------! ! !

constraint create joint revolute & joint_name = .model_1.JOINT_1 & adams_id = 1 &

i_marker_name = .model_1.PART_2.MARKER_7 & j_marker_name = .model_1.PART_8.MARKER_8 !

constraint attributes &

constraint_name = .model_1.JOINT_1 & name_visibility = off !

constraint create joint revolute & joint_name = .model_1.JOINT_2 & adams_id = 2 &

i_marker_name = .model_1.PART_2.MARKER_9 & j_marker_name = .model_1.PART_4.MARKER_10 !

constraint attributes &

constraint_name = .model_1.JOINT_2 & name_visibility = off !

constraint create joint revolute & joint_name = .model_1.JOINT_3 & adams_id = 3 &

i_marker_name = .model_1.PART_3.MARKER_11 & j_marker_name = .model_1.ground.MARKER_12 !

constraint attributes &

constraint_name = .model_1.JOINT_3 & name_visibility = off !

constraint create joint revolute & joint_name = .model_1.JOINT_4 & adams_id = 4 &

i_marker_name = .model_1.PART_3.MARKER_17 & j_marker_name = .model_1.PART_5.MARKER_18 !

constraint attributes &

constraint_name = .model_1.JOINT_4 &

name_visibility = off !

constraint create joint revolute & joint_name = .model_1.JOINT_5 & adams_id = 5 &

i_marker_name = .model_1.PART_4.MARKER_21 & j_marker_name = .model_1.PART_6.MARKER_22 !

constraint attributes &

constraint_name = .model_1.JOINT_5 & name_visibility = off !

constraint create joint translational & joint_name = .model_1.JOINT_6 & adams_id = 6 &

i_marker_name = .model_1.PART_6.MARKER_24 & j_marker_name = .model_1.ground.MARKER_25 !

constraint attributes &

constraint_name = .model_1.JOINT_6 & name_visibility = off !

constraint create joint translational & joint_name = .model_1.JOINT_7 & adams_id = 7 &

i_marker_name = .model_1.PART_5.MARKER_26 & j_marker_name = .model_1.PART_2.MARKER_27 !

constraint attributes &

constraint_name = .model_1.JOINT_7 & name_visibility = off !

constraint create joint fixed & joint_name = .model_1.JOINT_8 & adams_id = 8 &

i_marker_name = .model_1.PART_6.MARKER_30 & j_marker_name = .model_1.PART_7.MARKER_31 !

constraint attributes &

constraint_name = .model_1.JOINT_8 & name_visibility = off !

constraint create joint fixed & joint_name = .model_1.JOINT_9 & adams_id = 9 &

i_marker_name = .model_1.PART_8.MARKER_39 & j_marker_name = .model_1.ground.MARKER_40 !

constraint attributes &

constraint_name = .model_1.JOINT_9 &

name_visibility = off !

!----------------------------------- Forces -----------------------------------! ! !

force create direct single_component_force &

single_component_force_name = .model_1.SFORCE_1 & adams_id = 1 &

type_of_freedom = translational &

i_marker_name = .model_1.PART_7.MARKER_42 & j_marker_name = .model_1.ground.MARKER_43 & action_only = on & function = \!

!---------------------------------- Motions -----------------------------------! ! !

constraint create motion_generator & motion_name = .model_1.MOTION_1 & adams_id = 1 &

type_of_freedom = rotational & joint_name = .model_1.JOINT_3 & function = \!

constraint attributes &

constraint_name = .model_1.MOTION_1 & name_visibility = off !

!------------------------------ Dynamic Graphics ------------------------------! ! !

defaults coordinate_system &

default_coordinate_system = .model_1.ground !

geometry create shape force &

force_name = .model_1.SFORCE_1_force_graphic_1 & adams_id = 11 &

force_element_name = .model_1.SFORCE_1 &

applied_at_marker_name = .model_1.PART_7.MARKER_42 !

!---------------------------------- Accgrav -----------------------------------! ! !

force create body gravitational & gravity_field_name = gravity & x_component_gravity = 0.0 & y_component_gravity = -9806.65 & z_component_gravity = 0.0 !

force attributes &

force_name = gravity & size_of_icons = 20.0 !

!----------------------------- Analysis settings ------------------------------! ! !

!---------------------------------- Measures ----------------------------------! ! !

measure create angle &

measure_name = .model_1.MEA_ANGLE_1 & first_point = .model_1.PART_5.cm &

middle_point = .model_1.ground.MARKER_12 & last_point = .model_1.ground.MARKER_33 !

data_element attributes &

data_element_name = .model_1.MEA_ANGLE_1 & color = WHITE !

measure create object &

measure_name = .model_1.MOTION_1_MEA_1 & from_first = yes &

object = .model_1.MOTION_1 & characteristic = element_torque & component = z_component

!

data_element attributes &

data_element_name = .model_1.MOTION_1_MEA_1 & color = WHITE !

measure create object &

measure_name = .model_1.SFORCE_1_MEA_1 & from_first = yes &

object = .model_1.SFORCE_1 & characteristic = element_force & component = x_component & create_measure_display = no !

data_element attributes &

data_element_name = .model_1.SFORCE_1_MEA_1 & color = WHITE !

measure create object &

measure_name = .model_1.SFORCE_1_MEA_2 & from_first = no &

object = .model_1.SFORCE_1 & characteristic = element_force & component = mag_component & create_measure_display = no !

data_element attributes &

data_element_name = .model_1.SFORCE_1_MEA_2 & color = WHITE !

measure create object &

measure_name = .model_1.SFORCE_1_MEA_3 & from_first = yes &

object = .model_1.SFORCE_1 & characteristic = element_force & component = mag_component !

data_element attributes &

data_element_name = .model_1.SFORCE_1_MEA_3 & color = WHITE !

!----------------------------- Simulation Scripts -----------------------------! ! !

simulation script create &

sim_script_name = .model_1.Last_Sim & commands = &

\single_run transient type=auto_select end_time=1.0 number_of_steps=100 model_name=.model_1 initial_static=no\!

!---------------------------- Function definitions ----------------------------! !

!

constraint modify motion_generator & motion_name = .model_1.MOTION_1 & function = \* time\!

force modify direct single_component_force &

single_component_force_name = .model_1.SFORCE_1 &

function = \time , 0 , 0 , 0.5 , 0 )+STEP( time , 0.50 , 1000 , 0.500001 , 0 )+STEP( time,0.599999,0.0,0.6,1000.0 )+STEP( time,0.7,-1000.0,1.0,-1000.0) \!

!--------------------------- Expression definitions ---------------------------! ! !

defaults coordinate_system &

default_coordinate_system = ground !

marker modify &

marker_name = .model_1.ground.MARKER_12 & location = &

(LOC_RELATIVE_TO({0, 0, 0}, .model_1.ground.POINT_2)) !

marker modify &

marker_name = .model_1.ground.MARKER_25 & location = &

(LOC_RELATIVE_TO({0, 0, 0}, .model_1.ground.POINT_5)) !

本文来源:https://www.bwwdw.com/article/cyla.html

Top