疑难问题大讨论:函数加载到表加载的转换问题:log里生成的数据是如何算出来的?函数加载到表加载如何对应!

浏览:549523 回答:16
对疑难问题的讨论和交流更有助于提高ansys应用水平,希望大家积极参与!

问题如下:
函数加载到表加载的转换

ansys是怎么处理的 ,函数加载 ansys都自动转换成表加载来处理的
表加载中数组中的各个值是怎么得来的呢?如何计算的!

比如一个悬臂梁:

在梁的顶端加函数载荷,p=0.1*x,
函数加载后
转换成表加载如下图所示:

可以参考一下命令流:

MINLOAD=0 !minimum load
MAXLOAD=1 !maximum load
L=10
Thick=1
E1=30e6
/PREP7
!*
ET,1,PLANE183
KEYOPT,1,3,3
KEYOPT,1,6,0
KEYOPT,1,10,0
!*
!*
R,1,Thick,
!*
!*
MPTEMP,,,,,,,,
MPTEMP,1,0
MPDATA,EX,1,,E1
MPDATA,PRXY,1,,.27
MPDATA,DENS,1,,1
RECTNG,0,L,0,Thick
ames,all
!下面是函数加载,请在gui操作中进行

!在ansys ---parameters---functions---define/edit中定一个函数p=0.1*x
!然后保存,再从read from files 。。。。把那个文件读进来!

SFL,3,PRES, %函数名% !通过函数加载

DL,4,,ALL,0
FINISH
/SOL
/STATUS,SOLU
SOLVE
FINISH
/POST1
PLDISP,0

在log中可得到函数加载那部分的命令流如下


*DEL,_FNCNAME
*DEL,_FNCMTID
*DEL,_FNCCSYS
*SET,_FNCNAME,'as'
*SET,_FNCCSYS,0
! /INPUT,as.func,,,1
*DIM,%_FNCNAME%,TABLE,6,3,1,,,,%_FNCCSYS%
!
! Begin of equation: 0.1*{X}
*SET,%_FNCNAME%(0,0,1), 0.0, -999
*SET,%_FNCNAME%(2,0,1), 0.0
*SET,%_FNCNAME%(3,0,1), 0.0
*SET,%_FNCNAME%(4,0,1), 0.0
*SET,%_FNCNAME%(5,0,1), 0.0
*SET,%_FNCNAME%(6,0,1), 0.0
*SET,%_FNCNAME%(0,1,1), 1.0, -1, 0, 0.1, 0, 0, 2
*SET,%_FNCNAME%(0,2,1), 0.0, -2, 0, 1, -1, 3, 2
*SET,%_FNCNAME%(0,3,1), 0, 99, 0, 1, -2, 0, 0
! End of equation: 0.1*{X}

我现在想弄清楚 函数和表中数据的对应关系,
函数加载本身很简单 但ansys会自动将函数转化成表


数组中的那些值肯定不是杂乱无章的
肯定满足什么规律

这个题中的表加载也可以定义成这样的
Begin of equation: {X}
*SET,%_FNCNAME%(0,0,1), 0.0, -999
*SET,%_FNCNAME%(2,0,1), 0.0
*SET,%_FNCNAME%(3,0,1), 0.0
*SET,%_FNCNAME%(4,0,1), 0.0
*SET,%_FNCNAME%(5,0,1), 0.0
*SET,%_FNCNAME%(6,0,1), 0.0
*SET,%_FNCNAME%(0,1,1), 1.0, -1, 0, (MAXLOAD-MINLOAD)/L, 0, 0, 2
*SET,%_FNCNAME%(0,2,1), 0.0, -2, 0, 1, -1, 3, 2
*SET,%_FNCNAME%(0,3,1), 0, -1, 0, MINLOAD, 0, 0, -2
*SET,%_FNCNAME%(0,4,1), 0.0, -3, 0, 1, -2, 1, -1
*SET,%_FNCNAME%(0,5,1), 0.0, 99, 0, 1, -3, 0, 0
! End of equation: {X}
MAXLOAD-MINLOAD)/L MINLOAD
这几个量又是怎样对应的呢 ?

困扰许久 不得其法
下面是另一个会员问的,都是同样的问题,各大论坛也有人问,但一直没有令人满意的答案!

! Begin of equation: 123+222*{TIME}-0.006*{X}**2
*SET,% _FNCNAME%(0,0,1), 0.0, -999
*SET,% _FNCNAME%(2,0,1), 0.0
*SET,% _FNCNAME%(3,0,1), 0.0
*SET,% _FNCNAME%(4,0,1), 0.0
*SET,% _FNCNAME%(5,0,1), 0.0
*SET,% _FNCNAME%(6,0,1), 0.0
*SET,% _FNCNAME%(0,1,1), 1.0, -1, 0, 222, 0, 0, 1
*SET,% _FNCNAME%(0,2,1), 0.0, -2, 0, 1, -1, 3, 1
*SET,% _FNCNAME%(0,3,1), 0, -1, 0, 123, 0, 0, -2
*SET,% _FNCNAME%(0,4,1), 0.0, -3, 0, 1, -1, 1, -2
*SET,% _FNCNAME%(0,5,1), 0.0, -1, 0, 2, 0, 0, 2
*SET,% _FNCNAME%(0,6,1), 0.0, -2, 0, 1, 2, 17, -1
*SET,% _FNCNAME%(0,7,1), 0.0, -1, 0, 0.006, 0, 0, -2
*SET,% _FNCNAME%(0,8,1), 0.0, -4, 0, 1, -1, 3, -2
*SET,% _FNCNAME%(0,9,1), 0.0, -1, 0, 1, -3, 2, -4
*SET,% _FNCNAME%(0,10,1), 0.0, 99, 0, 1, -1, 0, 0
! End of equation: 123+222*{TIME}-0.006*{X}**2

这是一个函数加载,这些数据是根据什么算出来的,困扰很久了。好像与运算方法有关!
邀请回答 我来回答

全部回答

(16)
默认 最新
好学
这个问题我也很困惑,不知道怎么用命令流实现这一功能呢!在帮助里我看到这么几句话:请高手帮我解释解释


If you use table parameters to define boundary conditions, then Var1, Var2, and/or Var3 can either specify a primary variable (listed in *DIM - Primary Variables) or can be an independent parameter. If specifying an independent parameter, then you must define an additional table for the independent parameter. The additional table must have the same name as the independent parameter and may be a function of one or more primary variables(怎么实现这一功能,把一个表格用函数表示出来) or another independent parameter. All independent parameters must relate to a primary variable.

2007年1月17日
评论 点赞
mark
可以回帖
但不能发帖
2006年12月24日
评论 点赞
mark
怎么老发不了帖子
2006年12月24日
评论 点赞
arc




这个是范围数据,针对的是离散后的单元数目在多少以内的限定!

2006年12月20日
评论 点赞
mark
这个破网慢的实在不行
图片也传不上来 死活满足不了格式要求 明明是jpg

令人抓狂!
2006年10月9日
评论 点赞
mark
asinx
对应的表加载好帖子!!!!!!!!!!!
sinx.JPG
2006年10月9日
评论 点赞
mark
请期待后续的摸索和总结!


将此贴顶到海枯石烂!
2006年10月9日
评论 点赞
mark

今天上午,与sinwe的几个朋友在网上探讨了一下这个问题!
现总结如下:
1.ansys函数加载在内部都是转换成表加载的,只不过这时候与其说它是表加载,不如说它是函数加载,因为这个表是函数的变种,只是借用表来描述函数。而不是我们通常意义上的表,我们自己建立的表 自己肯定能理解
但函数转化成的表,我们就不知道具体怎么运算的,只有ansys开发程序员清楚了,觉得应该把这个在帮助了体现出来
可惜没有 。有网友认为这是ansys防止抄袭。

2.下面是simwe一个版主的摸索过程:(她把收获贴到了她的博客)


这个问题我也很好奇,于是查了帮助,很奇怪的,(我不会用这个blog,似乎上载了图片似乎只有我自己能看和下载),我尽量描述详细。


创建一个函数(比如5cos(x))以后,保存成.func文件,然后导入成矩阵之后,就是这个形式:


1 0 0 0


-999 -1 -2 -3 99


0 10 0 0 0


0 1 5 1 1


0 2 0 -2 -3


0 0 0 3 0


0 0 -1 -1 0



创建一个函数(比如5sin(x))以后,保存成.func文件,然后导入成矩阵之后,是这个形式:


1 0 0 0


-999 -1 -2 -3 99


0 9 0 0 0


0 1 5 1 1


0 2 0 -2 -3


0 0 0 3 0


0 0 -1 -1 0



所以,经过研究发现,sin和cos的区别在于9和10


也就是说ansys这个函数转换表的功能其实不是我们想象的那样和几何对应的表


而是一种类似“电报码”的表


只是翻译的功能,无他


网友需要瞬态计算中修改函数,那么他就可以每次换矩阵了,呵呵


如果函数不超过50个,还是可以承受的:)


很久没学新知识了,今天很开心!
3.我们部分的聊天记录:
perch88 10:22:32
The first one is 5*sin(x). The 2nd is 5*cos(t)
perch88 10:22:38
So this form is the transform form,
perch88 10:23:04
but not like what you think:
transform to something that related directly to the geometry
perch88 10:23:29
9 in the 1st figure stands for sin
10 in the 2nd figure is cos
perch88 10:23:45
it is like 电报
很有

perch88 10:23:49
意思

mark 10:23:55
呵呵

yudiyuxi 10:24:08
中英合并的典型

perch88 10:24:39
you can try some simple function and compare them
you will know
mark 10:25:48
这个我昨天试了一晚上了
对函数中的系数 能找到对应关系了
但还不是彻底明白 每个值是怎么算出的
perch88 10:26:52
It is just a 'code'
If you are ANSYS programer, you can define sin function to be 100 rather than 9
It depends on you, but now they are specified, you have to follow the 'rules'
mark 10:27:21
比如你说的那个5*sinx
5可以和表中的5对应
那表中的2 0 -2 -3 又代表什么意思呢
perch88 10:28:55
就像编码
那么多函数,还有数字的组合
当然要用多几行(数组)才能表示清楚
你只需要把你常用的代码记下来就行了
完全探索也没必要,毕竟不需要它
perch88 10:28:56
就像编码
那么多函数,还有数字的组合
当然要用多几行(数组)才能表示清楚
你只需?
mark 10:31:06
是这样的
我的加载函数是经常变化的
而我又不想通过gui来直接生成
而是直接在apdl 表中改数据
比如 5*sinx 我可能用到 20*sinx 4*sinx+5cosx
perch88 10:32:18
you can write down and create each matrix.func
then import and apply them accordingly




perch88 10:32:37
I don't think you have over 50 functions
perch88 10:32:57
so it is affordable to create .func file or matrix in this way
perch88 10:33:11
sha: maybe
perch88 10:33:32
sha: should be a little different because of the zig-zag
perch88 10:33:47
sha: but you'd better verify it
mark 10:33:50
对简单一点的情况
比如5*sinx
我可以把5 用一个变量a替换
然后在产生的表里把5替换成a
这样改变a 就可定义函数a*sinx了
但对复杂的函数呢
也可以这么做吗
perch88 10:34:07
you can write down and create each matrix.func
then import and apply them accordingly
perch88 10:34:20
your function is not changing randomly

perch88 10:34:27
you know exactly what they are
perch88 10:34:44
and the number of the functions is not big. say <50
perch88 10:34:58
you can create matrix for them, and name them f1,f2,,,f50
perch88 10:35:08
then reuse them in each case
mark 10:35:28
看来只能摸索到这个程度了
非常感谢perch
perch88 10:35:44
u r welcome
perch88 10:36:44
actually I think it is kind of stupid to use this 'code' table

perch88 10:37:01
I mean I don't know why the programmer use this table
perch88 10:37:12
it looks like a useless table
mark 10:38:05
呵呵
是的
它都化成table加载的
其实这个问题完全由我们自己来写table
那样更直观了
yudiyuxi 10:38:41
也许用表便于管理呀。
perch88 10:39:58
anyway. I can't understand
mark 10:40:52
在这里与其说它是表
不如说它是函数,因为他是函数的变种 用表来表示函数 而不是指我们通常的表
perch88 10:41:02
agree
mark 10:43:31
我们自己建立的表 自己肯定能理解
但函数转化成的表
我们就不知道具体怎么运算的
只有ansys程序员清楚了
觉得应该把这个在帮助了体现出来
可惜没有
海心 10:44:09
防止你抄袭
yudiyuxi 10:44:24
that s right
mark 10:46:40
呵呵
这一块确实是黑箱 对我们来说
perch88 10:47:36
I am happy today
Thank you to bring this up
海心 10:47:44
要是把人家的技术都给破译的话,下一个版本的版权就是你的了
mark 10:48:37
谢谢Perch和海心妹妹
两位都很热情
我也非常高兴
perch88 10:49:45
I summarize this and paste it to my blog. interesting
ok. see you guys
got to go now. cu



2006年10月9日
评论 点赞
mark
那些999 99等肯定是某种标识符,但其他的各代表什么含义,如何计算的,是本问题关注的重点!
2006年10月8日
评论 点赞
mark
请老大设置专家分!
我设置不了。

不是黑箱问题,与插值,运算方法有关!
2006年10月8日
评论 点赞

没解决?试试专家一对一服务

换一批
    App下载
    技术邻APP
    工程师必备
    • 项目客服
    • 培训客服
    • 平台客服

    TOP