30.12.08

每隔100秒从ABAQUS结果文件中取出位移、内力的PYTHON代码

#extract displacement, section force from ABAQUS ODB file every 100s and write to files

import odbAccess
odb = session.openOdb('walk.odb')
elemset = odb.rootAssembly.instances['PART-1-1'].elementSets['BEAMELEM']
Pipenode = odb.rootAssembly.instances['PART-1-1'].nodeSets['PIPENODE']
i = 0
OutDispfile = open('Disp.txt','w+')
OutDispfile.write("Node ")
OutDispfile.write("x disp ")
OutDispfile.write("y disp ")
OutDispfile.write("z disp\n")
OutForcefile = open('SF.txt','w+')
OutForcefile.write("Elem ")
OutForcefile.write("SF1 ")
OutForcefile.write("SF2 ")
OutForcefile.write("SF3\n")
while (i<=7700):
    timeframe = odb.getFrame(i)
    dispp = timeframe.fieldOutputs['U']
    for v in dispp.values:
        print 'Node label =', v.nodeLabel
        OutDispfile.write(str(v.nodeLabel))
        OutDispfile.write(" ")
        print 'x disp =', v.data[0]
        OutDispfile.write(str(v.data[0]))
        OutDispfile.write(" ")
        print 'y disp =', v.data[1]
        OutDispfile.write(str(v.data[1]))
        OutDispfile.write(" ")
        print 'z disp =', v.data[2]
        OutDispfile.write(str(v.data[2]))
        OutDispfile.write("\n")
    inforce = timeframe.fieldOutputs['SF']
    inforce = inforce.getSubset(region=elemset)
    for f in inforce.values:
        print 'Elem label =', f.elementLabel
        OutForcefile.write(str(f.elementLabel))
        OutForcefile.write(" ")
        print 'sf1 =', f.data[0]
        OutForcefile.write(str(f.data[0]))
        OutForcefile.write(" ")
        print 'sf2 =', f.data[1]
        OutForcefile.write(str(f.data[1]))
        OutForcefile.write(" ")
        print 'sf3 =', f.data[2]
        OutForcefile.write(str(f.data[2]))
        OutForcefile.write("\n")
    i = i + 100
OutDispfile.close()
OutForcefile.close()
odb.close()

21.12.08

每个人心中有一个平安夜

Christmas In My Heart 《圣诞在我心》 我的圣诞愿望 - 今夜请抱紧我

Every time we say goodbye
There's something breaking deep inside
I tried to hide my feelings to keep myself controlled
But somehow I can't deny what's deep inside my soul

I've been always on the run
So many different places, having fun
But like a river always knows just where to flow
Now that Decemer comes I feel like coming home

It's Christmas in my heart
When I'm with you
No matter where we are or what we do
Tomorrow may be grey
We may be torn apart
But if you stay tonight
It's Christmas in my heart

I don't know how to stay alive
Without your touch without you by my side
Just like the desert's always waiting for the rain
Oh baby, I wish the holy night would come again

Everywhere I go and everyone I know
Is making lots of wishes for old Santa Claus
But all I really need tonight
Is for you to come and hold me tight
What is Christmas without you here by my side
I need you tonight

14.12.08

无欲则刚

君子寡欲,则不役於物,可以直道而行。

11.12.08

Origin X Function - stats

stats ix:=col(1) mean:=mymean sd:=mysd sum:=mysum n:=mynum min:=mymin max:=mymax missing:=mymiss

Origin中的一个X Function, 可用来统计平均值,均方差,和,个数,最小值,最大值,最大值以及空缺个数分别放入mymean, mysd...中
(Simwe Origin班主蓝色梧桐在origin方面可谓高手, ding...)

10.12.08

陆止于此 海始于斯 - Cabo da Roca 罗卡角






心血来潮,把今年去葡萄牙的照片拿出来show一下。(又要被老婆笑话自恋+得意了)

@Cabo da Roca
欧洲大陆最西南角,“陆止于此 海始于斯”。海天相连,碧波拍岸,悬崖峭壁,让人无尽遐想。即使晴空万里,这里的风也是呼啸不止,感觉都站立不稳。
带的摄像机照的不是很清楚,从他处“借”来两张:)

再帖张Google的卫星图,整个伊比利亚半岛的。

Origin Mask




1. Mask for graph
2.Mask for worksheet
Origin seems have "two" Mask tools. Usually i use the 2nd but recently (maybe from the beginning!) i notice the 2nd becomes grey (inactive) for graph. so the 1st can be used.
Tip: Space toggles the standard and the freehand Mask for graph.

8.12.08

常思己过 莫论人非

静坐常思己过,闲谈莫论人非,能受苦乃为志士,肯吃亏不是痴人,

敬君子方显有德,怕小人不算无能,退一步天高地阔,让三分心平气和,

欲进步需思退步,若着手先虑放手,如得意不宜重往,凡做事应有余步。

持黄金为珍贵,知安乐方值千金,事临头三思为妙,怒上心忍让最高。

切勿贪意外之财,知足者人心常乐。若能以此去处事,一生安乐任逍遥。

1.12.08

快乐的征途

多数人认为,一旦达到某个目标,人们就会感到身心舒畅。但问题是你可能永远达不到目标。把快乐建立在还不曾拥有的事情上,无异于剥夺自己创造快乐的权力。记住,快乐是天赋权利。首先就要有良好的感觉,让它使自己在塑造自我的整个旅途中充满快乐,而不要再等到成功的最后一刻才去感受属于自己的欢乐。

-[Read this 10 times everyday!]

30.11.08

勇于承担大任,善于从小处做起


1. Create a plan for each day--use the plan to organize your day, but don't be married to the plan--remain flexible.
每天做一个计划——用这个计划来安排你的日子,但不要过于死板,要保持灵活性。
2. Keep a list of your priorities in view. Measure your to-dos and planned actions against them.
将考虑中的事情按主次列一个表,衡量它们的重要性并且有计划地对待。
3. Ask of each new task before you: "Who is the best person to be doing this task?"
对你面临每一个新任务的时候问一句,谁是完成这个任务的最佳人选?
4. Ask specifically for what you want, including conditions of satisfaction, and timeframes. Don't expect people to read your mind.
明确的提出你需要的东西,包括满意的条件以及时间的构成。不要指望别人了解你的心思。
5. Skip the morning news on TV. It's primarily negative. Skip the late night news on TV. It's even more negative than the morning news. Go to sleep earlier, read, or write a journal.
不要看早间新闻, 它们大多是消极的。不看晚间新闻, 它们更消极。早点上床,阅读或写一篇日记。
6. Start each day with 30-60 minutes of reading--business, educational or inspirational.
每天早上阅读30-60分钟——可以是商业的,有教育意义的或是启发心智的书籍。
7. Refine and clarify your vision. Where are your actions taking your organization?
精练地阐明你的见解。你行为的最终目的是什么?
8. Whatever you are currently complaining about--stop it.
无条件放弃你现下所有的抱怨。
9. Use the 80/20 rule to your advantage.
80/20的准则对待你的收益。(注:80/20的准则——销售额的80%来自20%的客户或20%的产品,停止把你80%的时间花在只有20%生意的80%的顾客和产品上, 将你80%的时间化在带来80%生意的的顾客和产品上。)
10. Work on one item at a time.
在一个时间内集中精力做一件事情。
11. Put your basic values into writing.
把你的基本价值观写下来。
12. Put your goals (all of them) into writing.
把你所有的目标写下来。
13. Do your next day's planning at the end of the day.
一天结束前为第二天做好计划。
14. Be networking conscious.
有意识地建立关系网。
15. Establish a reading/learning program.
制订一个阅读或者学习计划。
16. Ask the question, where is the strategic or competitive advantage?
问这样一个问题,自己的战略或者竞争优势在哪里?
17. Figure out what you are very good at doing--delegate or outsource the rest.
确定你最善于做的是什么——将其它事委派或外包给别人做。
18. Analyze the cost/benefit of what you are doing. It may be more cost-effective to delegate or outsource.
为你正做的工作做一个成本效益分析。也许把这项工作委派或外包给别人是更加划算的。
19. Ask yourself, "Is what I am doing the highest value contribution I can make now?" If not, don't do it.
问你自己:我正在做的事情能让我获得最大的利益回报吗?,如果不是,那就不要去做。

[转贴,找不到出处了。谢谢原创了]

23.11.08

I really hate 5460!

I had a dream last night that our highschool classmates had a meeting...
Very interesting and vivid like reality... chat with the gate guard "DaYe", see the notice board...
everything is similiare and familiar...
It made me missing the past time this morning.

I login to the 5460 to review the classmates...
Same as before, 5460 really get me frustrated, confused and irretated... I can not find what i want. rubbish, just rubbish... i don't know what the people of 5460 think about all day! why just spend a little time think for the USERS not YOURESELF!!


Anyway, link to my mother school to see my old dreams (good or bad).
http://www.zhengzhong.net.cn/

20.11.08

Excel Function - Match() & Index() - 组合赵某列最大值所对应其他列的值

MATCH

Returns the relative position of an item in an array (array: Used to build single formulas that produce multiple results or that operate on a group of arguments that are arranged in rows and columns. An array range shares a common formula; an array constant is a group of constants used as an argument.) that matches a specified value in a specified order. Use MATCH instead of one of the LOOKUP functions when you need the position of an item in a range instead of the item itself.

Syntax

MATCH(lookup_value,lookup_array,match_type)

Lookup_value is the value you use to find the value you want in a table.

*Lookup_value is the value you want to match in lookup_array. For example, when you look up someone's number in a telephone book, you are using the person's name as the lookup value, but the telephone number is the value you want.

*Lookup_value can be a value (number, text, or logical value) or a cell reference to a number, text, or logical value.

Lookup_array is a contiguous range of cells containing possible lookup values. Lookup_array must be an array or an array reference.

Match_type is the number -1, 0, or 1. Match_type specifies how Microsoft Excel matches lookup_value with values in lookup_array.

*If match_type is 1, MATCH finds the largest value that is less than or equal to lookup_value. Lookup_array must be placed in ascending order: ...-2, -1, 0, 1, 2, ..., A-Z, FALSE, TRUE.

*If match_type is 0, MATCH finds the first value that is exactly equal to lookup_value. Lookup_array can be in any order.

*If match_type is -1, MATCH finds the smallest value that is greater than or equal to lookup_value. Lookup_array must be placed in descending order: TRUE, FALSE, Z-A, ...2, 1, 0, -1, -2, ..., and so on.

*If match_type is omitted, it is assumed to be 1.

Remarks

*MATCH returns the position of the matched value within lookup_array, not the value itself. For example, MATCH("b",{"a","b","c"},0) returns 2, the relative position of "b" within the array {"a","b","c"}.

*MATCH does not distinguish between uppercase and lowercase letters when matching text values.

*If MATCH is unsuccessful in finding a match, it returns the #N/A error value.

*If match_type is 0 and lookup_value is text, you can use the wildcard characters, question mark (?) and asterisk (*), in lookup_value. A question mark matches any single character; an asterisk matches any sequence of characters. If you want to find an actual question mark or asterisk, type a tilde (~) before the character.

INDEX

Returns a value or the reference to a value from within a table or range. There are two forms of the INDEX function: the array (array: Used to build single formulas that produce multiple results or that operate on a group of arguments that are arranged in rows and columns. An array range shares a common formula; an array constant is a group of constants used as an argument.)

Free IP Logger

[script language="JavaScript" src="http://freehostedscripts.net/iplogger.php?site=ID10549"][/script]

"[]"-->"<>"

19.11.08

格物致知

As there is ALWAYS a way!

16.11.08

心有多静,路就能走多远

心无物欲,即是秋空霁海;座有琴书,便成石室丹丘。

割肉饲鹰

14.11.08

大道存乎一理


珠帘寨


(西皮导板)昔日有个三大贤,(原板)刘关张结义在桃园。弟兄们徐州曾失散,古城相逢又团圆。关二爷马上呼三弟,张翼德在城楼怒发冲冠。耳边厢又听(流水)人呐喊,老蔡阳的人马来到了古城边。城楼上助你三通鼓,十面旌旗壮壮威严。哗喇喇打罢了头通鼓,关二爷提刀跨雕鞍。哗喇喇打罢了二通鼓,人有精神马又欢。哗喇喇打罢了三通鼓,蔡阳的人头落在马前。一来是老儿命该丧,二来弟兄得团圆。贤弟休回长安转,就在这沙陀过几年,落得个清闲。

13.11.08

Editplus语法高亮实现是Python 编辑调试环境

为了实现语法加亮和自动完成功能,我们必须下载两个文件,下载地址为
http://www.editplus.com/files/pythonfiles.zip ,解压到editplus 的安装目录下。压缩包有三个文件,此处我们用到两个,python.acp 文件和python_extd.stx 文件。
Acp 文件是自动完成文件,stx 文件是语法加亮文件。怎样加载呢?方法如下:
tools->preferences->Setting & syntax 下,首先新建一个文件类型,我们命名为python,扩展名(file extensions)栏里我们填入py。在syntax file 栏里我们找到刚才下载的python_extd.stx 文件,在Auto completion 栏里找到python.acp 文件,在Function Pattern 栏里填入:
[ \t]*def[ \t].+:
这样我们就可以通过Ctrl+F11 快捷键直接显示出python 文件中的函数列表。

这时我们打开一个python 文件,就可以看到有语法加亮了。但是我们在编辑的时候会发现一个问题就是,在输入冒号后,没有自动缩进,当然,如果我们手工缩进后会发现后面的输入也进行了同样的缩进,怎样让editplus 自动识别冒号然后直接缩进,并且如何修改缩进的长度呢?我们可以看到一个Tab/Indent 标签,打开他可以看到Tab,Indent 的选项,分别填入自己习惯的距离。我两个都填入4,并且选中Insert spaces instead of tab 和Enable auto indent。然后在Auto Indent open 里填入一个冒号“:”。

find max Mises stress and Moment, output the displacement and moment at some timestep

import odbAccess
odb = session.openOdb('case14.odb')
Moment = 'SM'
Stress ='S'
elemset = odb.rootAssembly.instances['PART-1-1'].elementSets['BEAMELEM']
maxMises = -0.1
maxSM1 = 0.0
maxSM2 = 0.0
maxSM3 = 0.0
maxStep1 = "_None_"
maxStep2 = "_None_"
maxStep3 = "_None_"
maxStep4 = "_None_"
maxFrame1 = -1
maxFrame2 = -1
maxFrame3 = -1
maxFrame4 = -1
i = 1
for step in odb.steps.values():
# print 'Processing Step:', step.name
for frame in step.frames:
# print 'frame inc:', frame.incrementNumber
# print 'frame no:', i
allFields = frame.fieldOutputs
stressSet = allFields[Stress]
momentSet = allFields[Moment]
stressSet = stressSet.getSubset(region=elemset)
momentSet = momentSet.getSubset(region=elemset)
for stressValue in stressSet.values:
if (stressValue.mises > maxMises):
maxMises = stressValue.mises
maxElem1 = stressValue.elementLabel
maxStep1 = step.name
maxFrame1 = i
for momentValue in momentSet.values:
if (abs(momentValue.data[0]) > abs(maxSM1)):
maxSM1 = momentValue.data[0]
maxElem2 = stressValue.elementLabel
maxStep2 = step.name
maxFrame2 = i
if (abs(momentValue.data[1]) > abs(maxSM2)):
maxSM2 = momentValue.data[1]
maxElem3 = stressValue.elementLabel
maxStep3 = step.name
maxFrame3 = i
if (abs(momentValue.data[2]) > abs(maxSM3)):
maxSM3 = momentValue.data[2]
maxElem4 = stressValue.elementLabel
maxStep4 = step.name
maxFrame4 = i
i = i + 1
OutStressMomentfile = open('stressmoment.txt','w+')
print 'Maximun Mises %f in elem %d frame # %d Step: %s'%(maxMises,maxElem1, maxFrame1,maxStep1)
OutStressMomentfile.write(' Max Mises: ')
OutStressMomentfile.write(str(maxMises))
OutStressMomentfile.write(' in elem: ')
OutStressMomentfile.write(str(maxElem1))
OutStressMomentfile.write(' at frame: ')
OutStressMomentfile.write(str(maxFrame1))
OutStressMomentfile.write(' at step: ')
OutStressMomentfile.write(maxStep1)
OutStressMomentfile.write('\n')
print 'Maximun SM1 %f in elem %d frame # %d Step: %s'%(maxSM1,maxElem2, maxFrame2,maxStep2)
OutStressMomentfile.write(' MaxSM1: ')
OutStressMomentfile.write(str(maxSM1))
OutStressMomentfile.write(' in elem: ')
OutStressMomentfile.write(str(maxElem2))
OutStressMomentfile.write(' at frame: ')
OutStressMomentfile.write(str(maxFrame2))
OutStressMomentfile.write(' at step: ')
OutStressMomentfile.write(maxStep2)
OutStressMomentfile.write('\n')
print 'Maximun SM2 %f in elem %d frame # %d Step: %s'%(maxSM2,maxElem3, maxFrame3,maxStep3)
OutStressMomentfile.write(' MaxSM2: ')
OutStressMomentfile.write(str(maxSM2))
OutStressMomentfile.write(' in elem: ')
OutStressMomentfile.write(str(maxElem3))
OutStressMomentfile.write(' at frame: ')
OutStressMomentfile.write(str(maxFrame3))
OutStressMomentfile.write(' at step: ')
OutStressMomentfile.write(maxStep3)
OutStressMomentfile.write('\n')
print 'Maximun SM3 %f in elem %d frame # %d Step: %s'%(maxSM3,maxElem4, maxFrame4,maxStep4)
OutStressMomentfile.write(' MaxSM3: ')
OutStressMomentfile.write(str(maxSM3))
OutStressMomentfile.write(' in elem: ')
OutStressMomentfile.write(str(maxElem4))
OutStressMomentfile.write(' at frame: ')
OutStressMomentfile.write(str(maxFrame4))
OutStressMomentfile.write(' at step: ')
OutStressMomentfile.write(maxStep4)
OutStressMomentfile.write('\n')
OutStressMomentfile.close()
timeFrame = odb.steps['Step-2'].frames[2002]
displacement = timeFrame.fieldOutputs['U']
Pipenode = odb.rootAssembly.instances['PART-1-1'].nodeSets['PIPENODE']
PipenodeDisp = displacement.getSubset(region=Pipenode)
OutDispfile = open('Disp.txt','w+')
OutDispfile.write("Node ")
OutDispfile.write("x disp ")
OutDispfile.write("y disp ")
OutDispfile.write("z disp\n")
for v in PipenodeDisp.values:
print 'Node label =', v.nodeLabel
OutDispfile.write(str(v.nodeLabel))
OutDispfile.write(" ")
print 'x disp =', v.data[0]
OutDispfile.write(str(v.data[0]))
OutDispfile.write(" ")
print 'x disp =', v.data[1]
OutDispfile.write(str(v.data[1]))
OutDispfile.write(" ")
print 'x disp =', v.data[2]
OutDispfile.write(str(v.data[2]))
OutDispfile.write("\n")
OutDispfile.close()
SMoment = timeFrame.fieldOutputs['SM']
SMoment = SMoment.getSubset(region=elemset)
OutMomentfile = open('Moment.txt','w+')
OutMomentfile.write("Element ")
OutMomentfile.write("SM1 ")
OutMomentfile.write("SM2 ")
OutMomentfile.write("SM3 \n")
for m in SMoment.values:
print 'Elem label =', m.elementLabel
OutMomentfile.write(str(m.elementLabel))
OutMomentfile.write(" ")
print 'SM1 =', m.data[0]
OutMomentfile.write(str(m.data[0]))
OutMomentfile.write(" ")
print 'SM2 =', m.data[1]
OutMomentfile.write(str(m.data[1]))
OutMomentfile.write(" ")
print 'SM3 =', m.data[2]
OutMomentfile.write(str(m.data[2]))
OutMomentfile.write("\n")
OutMomentfile.close()
odb.close()

10.11.08

Show IP & address - <<-((

(div align="center")(img border="0" src="http://ip.chinaz.com/ipshow.asp"/)(/div)

code of visitor's map

[script src="http://widgets.amung.us/map.js" type="text/javascript">WAU_map('0u0njbpowxk6', 420, 210, 'neosat', 'default-pink')

Python script in ABAQUS to read displacement and write to a file

import odbAccess
odb = session.openOdb('case3.odb')
timeFrame = odb.steps['Step-2'].frames[99]
displacement = timeFrame.fieldOutputs['U']
Pipenode = odb.rootAssembly.instances['PART-1-1'].nodeSets['PIPENODE']
PipenodeDisp = displacement.getSubset(region=Pipenode)
myoutfile = open('tryout.txt','w+')
myoutfile.write("Node ")
myoutfile.write("x disp ")
myoutfile.write("y disp ")
myoutfile.write("z disp\n")
for v in PipenodeDisp.values:
print 'Node label =', v.nodeLabel
myoutfile.write(str(v.nodeLabel))
myoutfile.write(" ")
print 'x disp =', v.data[0]
myoutfile.write(str(v.data[0]))
myoutfile.write(" ")
print 'x disp =', v.data[1]
myoutfile.write(str(v.data[1]))
myoutfile.write(" ")
print 'x disp =', v.data[2]
myoutfile.write(str(v.data[2]))
myoutfile.write("\n")
myoutfile.close()
odb.close()

6.11.08

Guass-Jordan解线性方程组



subroutine UWAPIPE_GuassJordan(n,K,dF,du)
!
!! solve linear equations using Guass-Jordan method
use UWAPIPE_module
implicit none

integer, intent(in) :: n
real(kind=gp), dimension(n,n), intent(in) :: K
real(kind=gp), dimension(n), intent(in) :: dF
real(kind=gp), dimension(n), intent(out) :: du

integer :: i, j
real(kind=gp), dimension(n,n+1) :: Mat
real(kind=gp), dimension(n+1) :: temp

Mat(:,1:n) = K(:,:)
Mat(:,n+1) = dF(:)
du = 0.0_gp
do i = 1, n
do j = i+1, n
if (abs(Mat(j,i))>abs(Mat(i,i))) then
temp(i:n+1) = Mat(i,i:n+1)
Mat(i,i:n+1) = Mat(j,i:n+1)
Mat(j,i:n+1) = temp(i:n+1)
end if
end do
Mat(i,i:n+1) = Mat(i,i:n+1)/Mat(i,i)
do j = 1, n
if (j /= i) then
Mat(j,i:n+1) = Mat(j,i:n+1) - Mat(j,i)/Mat(i,i)*Mat(i,i:n+1)
end if
end do
end do
du = Mat(:,n+1)
end subroutine UWAPIPE_GuassJordan

5.11.08

三家店


[西皮流水]
将身儿来至在大街口
尊一声过往宾朋听从头
一不是响马并贼寇
二不是歹人把城偷
杨林与我来争斗
因此上发配到登洲
舍不得太爷的恩情厚
舍不得衙役们众班头
实难舍街坊四邻
与我的好朋友
舍不得老娘白了头
儿想娘亲难叩首
娘想儿来泪双流
眼见得红日坠落在西山后
叫一声解差把店投

3.11.08

偶感

认真听别人说话,认真考虑别人的问题,不要逃避,决断早晚要下,不如尽快做出

31.10.08

沉思录

1.不要将心思花在别人身上,不要探听别人的事情,也不要对别人任意猜度。

2.我们说的话和做的事,大都是没有意义的。如果把这些都取消的话,我们就会有更多的空闲和更少的麻烦。同样,我们也要舍弃那些无用的思想,因为无用的思想会导致无聊的行动。

3.只要做好自己份内的事情,这就足够了,其他的事情无需牵挂。

4.不要像一个摇桨的奴隶那样忙个不停,也不要像苦力一样为了得到人们的怜悯或注意而做事情。

28.10.08

公制英制

• 公制到英制

长度 1 millimetre 毫米= 0.03937 inch英寸
1 centimetre 厘米= 10 mm毫米=0.3937 inch英寸
1 decimetre 分米=10 cm厘米=3.937 inches英寸
1 metre 米=10 dm分米=1.0936 yards码=3.2808 feet英尺
1 kilometre 千米=1000 m米=0.6214 mile英里
1 mile marin 海里=1852 m米=1.1500 miles英里



面积 1 square centimetre平方厘米=0.155 sq.inch 平方英寸
1 square metre平方米=1.196 sq.yards 平方码
1 are 公亩=100 square metres 平方米=119.6 sq.yards 平方码
1 hectare 公顷=100 ares 公亩=2.471 acres 英亩
1 square kilometre 平方公里=0.386 sq.mile 平方英里



体积 1 cubic centimetre 立方厘米=0.061 cu.inch 立方英寸
1 cubic metre 立方米=1.308 cu.yards 立方码




容积 1 millilitre 毫升=0.002 British pint 英制品脱
1 centilitre 厘升=10 ml. 毫升=0.018 pint 品脱
1 decilitre 分升=10 cl. 厘升=0.176 pint 品脱
1 litre 升=10 dl. 分升=1.76 pints 品脱
1 decalitre 十升=10 l. 升=2.20 gallons 加伦
1 hectolitre 百升=100 l. 升=2.75 bushels 蒲式耳
1 kilolitre 千升=1000 l. 升=3.44 quarters 八蒲式耳



重量 1 milligram 毫克=0.015 grain 谷
1 centigram 厘克=10 mg. 毫克=0.154 grain 谷
1 decigram 分克=10 cg. 厘克=1.543 grains 谷
1 gram 克=10 dg. 分克=15.43 grains 谷
1 decagram 十克=10 g. 克=5.64 drams 打兰
1 hectogram 百克=100 g. 克=3.527 ounces 盎司
1 kilogram 千克=1000 g. 克=2.205 pounds 磅
1 ton (metric ton) 吨,公吨=1000 kg. 千克=0.984 (long) ton 长吨,英吨=1.1023 短吨,美吨



• 英制到公制

长度 1 inch 英寸=25.4 millimetres 毫米
1 foot 英尺=12 inches 英寸=0.3048 metre 米
1 yard 码=3 feet 英尺=0.9144 metre 米
1 (statute) mile 英里=1760 yards 码=1.609 kilometres 千米
1 nautical mile 海里=1852 m. 米



面积 1 square inch 平方英寸=6.45 sq.centimetres 平方厘米
1 square foot 平方英尺=144 sq.in.平方英寸=9.29 sq.decimetres 平方分米
1 square yard 平方码=9 sq.ft. 平方英尺=0.836 sq.metre 平方米
1 acre 英亩=4840 sq.yd.平方码=0.405 hectare 公顷
1 square mile 平方英里=640 acres 英亩=259 hectares 公顷




体积 1 cubic inch 立方英寸=16.4 cu.centimetres 立方厘米
1 cubic foot 立方英尺=1728 cu.in. 立方英寸=0.0283 cu.metre 立方米
1 cubic yard 立方码=27 cu.ft. 立方英尺=0.765 cu.metre 立方米



容积(英制) 1 pint 品脱=20 fluid oz. 液量盎司=34.68 cu.in. 立方英寸=0.568 litre 升
1 quart 夸脱=2 pints 品脱=1.136 litres 升
1 gallon 加伦=4 quarts 夸脱=4.546 litres 升
1 peck 配克=2 gallons 加伦=9.092 litres 升
1 bushel 蒲式耳=4 pecks 配克=36.4 litres 升
1 quarter 八蒲式耳=8 bushels 蒲式耳=2.91 hectolitres 百升



体积(美制干量) 1 pint 品脱=33.60 cu.in. 立方英寸=0.550 litre 升
1 quart 夸脱=2 pints 品脱=1.101 litres 升
1 peck 配克=8 quarts 夸脱=8.81 litres 升
1 bushel 蒲式耳=4 pecks 配克=35.3 litres 升



体积(美制液量) 1 pint 品脱=16 fluid oz. 液量盎司=28.88 cu.in. 立方英寸=0.473 litre 升
1 quart 夸脱=2 pints 品脱=0.946 litre 升
1 gallon 加伦=4 quarts 夸脱=3.785 litres 升



常衡 1 grain 格令=0.065 gram 克
1 dram 打兰=1.772 grams 克
1 ounce 盎司=16 drams 打兰=28.35 grams 克
1 pound 磅=16 ounces 盎司=7000 grains 谷=0.4536 kilogram 千克
1 stone 英石=14 pounds 磅=6.35 kilograms 千克
1 hundredweight 英担=4 quarters 四分之一英担=50.80 kilograms 千克
1 short ton 短吨(美吨)=2000 pounds 磅=0.907 tonne 公吨
1 (long) ton 长吨(英吨)=20 hundredweight 英担=1.016 tonnes 公吨

From Wikipdia: http://en.wikipedia.org/wiki/Pound-force
The pound-force is approximately equal to the gravitational force exerted on a mass of one avoirdupois pound on the surface of Earth. Since the 18th century, the unit has been used in low-precision measurements, for which small changes in Earth's gravity (which varies from place to place by up to half a percent) can safely be neglected.[1]

The 20th century, however, brought the need for a more precise definition. A standardized value for acceleration due to gravity was therefore needed. Today, in accordance with the General Conference on Weights and Measures, standard gravity is usually taken to be 9.80665 m/s² (approximately 32.17405 ft/s²)[2][3] but other values have been used, including 32.16 ft/s² (approximately 9.80237 m/s²).[4]

From the acceleration of the standard gravitational field and the international avoirdupois pound, we arrive at the following definition:[5]

1 pound-force ≡ 0.45359237 kg × 9.80665 m/s²
= 4.4482216152605 N (exactly)

Solve nonlinear function with Origin C

this is the code of Origin C solving nonlinear function using Newton-method.
also it shows how to use worksheet, datarange, vector...

#include
void SolveV0()
{
Worksheet wks=Project.ActiveLayer();
double V, H, h0, V0, f;
double beta1=0.562, beta2=0.99;
double beta, dfdV0;

beta = (beta1+beta2)^(beta1+beta2)/beta1^beta1/beta2^beta2;
if(!wks)
{
out_str("error");
return;
}

DataRange drV, drH, drh0, drV0;
Column col(wks,0);
int nrows=col.GetNumRows();

drV.Add("",wks,0,4,nrows,4);
drH.Add("",wks,0,5,nrows,5);
drh0.Add("",wks,0,10,nrows,10);
drV0.Add("",wks,0,11,nrows,11);

vector vV, vH, vh0, vV0;
drV.GetData(&vV,0);
drH.GetData(&vH,0);
drh0.GetData(&vh0,0);
drV.GetData(&vV0,0); //dummy

for(int i=0;i {
V=vV[i];
H=vH[i];
H=abs(H);
// V=abs(V);
h0=vh0[i];
V0=sqrt(H^2+V^2);
if (H==0.0)
vV0[i]=V0;
else
{
f=H/(V0*h0) - beta*(V/V0)^beta1*(1-V/V0)^beta2;
while(abs(f)>=0.0000001)
{
dfdV0 = -H/h0/V0^2 + beta*beta1*V^beta1/V0^(beta1+1)*(1-V/V0)^beta2 - beta*beta2*(V/V0)^beta1*(1-V/V0)^(beta2-1)*V/V0^2;
V0 = V0 - f/dfdV0;
f=H/(V0*h0) - beta*(V/V0)^beta1*(1-V/V0)^beta2;
}
}
}
drV0.SetColumnData(vV0,FALSE,0);
}

Origin(1)

I have just begun using Origin in processing experimental data.
Good software!
Here is the example showing how to smooth the data and reset the origion(zero point) by averageing adjacent points.
acturally this is using the X-function.

ii=1;loop(ii,1,4) { smooth iy:=($(ii)) method:=aav npts:=60 oy:=(,$(ii+4));};a=col(5)[1]; col(5)=-(col(5)-a);a=col(6)[1]; col(6)=(col(6)-a);a=col(7)[1]; col(7)=-(col(7)-a);a=col(8)[1]; col(8)=-(col(8)-a);

牛顿迭代法

用牛顿迭代法求f(x)=0在x0附近的一个实根的方法是:(1) 选一个接近于x的真实根的近似根x1;(2) 通过x1求出f(x1)。在几何上就是作x=x1,交f(x)于f(x1);(3) 过f(x1)作f(x)的切线,交x轴于x2。可以用公式求出x2。由于f'(x1)=f(x1)/(x2-x1),故x2=x1-f(x1)/f'(x1)(4) 通过x2求出f(x2);(5) 再过f(x2)作f(x)的切线交x轴于x2;(6) 再通过x3求出f(x3),…一直求下去,直到接近真正的根。当两次求出的根之差xn+1-xn≤ε就认为 xn+1足够接近于真实根。牛顿迭代公式是:xn+1=xn-f(xn)/f'(xn)牛顿迭代法的关键就是计算这个迭代公式,并在程序中进行迭代运算即可。该问题程序相对简单,就不列举了,控制一下迭代精度,直到达到需要目标即可。有一个问题需要注意的是,该方法能够有效的基本条件是:迭代公式必须是收敛的( 也就是通过迭代运算,每一次的结果必须是更接近真实值的)。

4.9.08

放手的智慧

有所不为,才能有所为。
清楚地认识自己,持久的乐观和自信。集中精力做好一件事。

12.7.08

Tricky Tips of IFortran

Don't know why but some tricky things - small but rather annoying if neglegence:

1. character(len=xx) :: stringwrite(unit = string, '(A)') i
Note: xx SHOULD BE LONGER than 12...

2. use open(unit=xx, file=xx, form='UNFORMATTED') rather than open(unit=xx, file=xx, form='BINARY') if you want to read the file.
in my program, backspace() was used, which caused troubles with the Binary format
don't know why, but frustrating me for almost a whole day!!