| 5 | 1/1 | 返回列表 |
| 查看: 1457 | 回復(fù): 6 | |||
| 當(dāng)前只顯示滿足指定條件的回帖,點(diǎn)擊這里查看本話題的所有回帖 | |||
astringent銅蟲 (著名寫手)
|
[交流]
【求助】相關(guān)函數(shù)歸一化問題 已有4人參與
|
||
|
最近一直在看自相關(guān)函數(shù)的程序,有個(gè)問題想不通。 自相關(guān)函數(shù)的定義是A=(a(t)*a(0))/(a(0)*a(0)),當(dāng)對體系中所有粒子求和時(shí),是先算出每個(gè)例子的(a(t)*a(0)) /(a(0)*a(0))然后求和?還是先分別求a(t)*a(0)以及a(0)*a(0)和然后再相除呢?兩者有什么區(qū)別?請大家指點(diǎn)。 [ Last edited by ghcacj on 2010-12-8 at 09:27 ] |
銅蟲 (著名寫手)
|
為什么我用兩種方法得到的結(jié)果有很大差別呢,勞煩指教。 下面是我的程序 這是我的程序: do i=1,10000 (粒子數(shù)) do ntel=1,npoints (共有npoints個(gè)數(shù)據(jù)) if (確定timeorigin的條件) then t0=t0+1 time0(t0)=ntel tcf0(t0)=tcf(ntel) do t=1,t0 delt=ntel-time0(t)+1 if(delt.lt.npoints) tcf(delt)=tcf(delt)+tcf(ntel)*tcf0(t) tcf0(delt)=tcf0(delt)+tcf0(t)*tcf0(t) acf(delt)=tcf(delt)+tcf(ntel)*tcf0(t)/ tcf0(t)*tcf0(t) endif enddo endif enddo enddo do ical=1,npoints tcf(ical)=(tcf(ical)/(npoints*ntime(t))/(tcf0(ical)/(npoints*ntime(t)) acf(ical)=acf(ical)/(npoints*ntime(t)) write(*,*) ical, tcf(ical) write(*,*) ical, acf(ical) enddo 下面是我的輸出結(jié)果(我只截取了一部分) 0.0000000000000000 1.0000000000000000 0.0000000000000000 1.14207400639561443E-004 1.0000000149011612 0.67655786350148372 1.0000000149011612 7.72679149727596715E-005 2.0000000298023224 0.62686567164179108 2.0000000298023224 7.15926989083817998E-005 3.0000000447034836 0.60360360360360366 3.0000000447034836 6.89359985842397961E-005 4.0000000596046448 0.58610271903323263 4.0000000596046448 6.69372680485647080E-005 5.0000000745058060 0.57012195121951215 5.0000000745058060 6.51121460963353292E-005 6.0000000894069672 0.55828220858895705 6.0000000894069672 6.37599598662582241E-005 7.0000001043081284 0.54629629629629639 7.0000001043081284 6.23910799790196834E-005 8.0000001192092896 0.51552795031055898 8.0000001192092896 5.88771071620099369E-005 9.0000001341104507 0.52187499999999998 9.0000001341104507 5.96019872087711250E-005 10.000000149011612 0.52515723270440251 10.000000149011612 5.99768424742350986E-005 |
木蟲 (著名寫手)
|
問得好。我初學(xué)時(shí)也在這個(gè)問題上糾結(jié)過。后來我寫程序把兩種算法同時(shí)都用了,輸出兩列結(jié)果。經(jīng)比較,二者在數(shù)值上差別是很小的。另外,按Leach的書(molecular modelling...),是對每個(gè)粒子,上下分別對時(shí)間原點(diǎn)求平均后再除,然后再對粒子求和,然后再除以總粒子數(shù),也就是用的你的第一個(gè)方案。 也就是: Cvv=(1/N)*sigma(i 從1到N)( |
銅蟲 (著名寫手)
|
請問老虎大王,我在寫程序的時(shí)候直接把t=0的相關(guān)函數(shù)做分母了,也就是 tcf(delt)=tcf(delt)+tcf(ntel)*tcf0(t)/ tcf0(t)*tcf0(t),可是輸出錯(cuò)誤,請問,我這樣寫為什么不可以呢?應(yīng)該怎樣寫? do i=1,10000 (粒子數(shù)) do ntel=1,npoints (共有npoints個(gè)數(shù)據(jù)) if (確定timeorigin的條件) then t0=t0+1 time0(t0)=ntel tcf0(t0)=tcf(ntel) do t=1,t0 delt=ntel-time0(t)+1 tcf(delt)=tcf(delt)+tcf(ntel)*tcf0(t)/ tcf0(t)*tcf0(t) enddo endif enddo enddo do ical=1,npoints tcf(ical)=tcf(ical)/(npoints*ntime(t)) write(*,*) ical, tcf(ical) enddo |
銅蟲 (著名寫手)
| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研] 282求調(diào)劑 +17 | ycy1201 2026-04-01 | 19/950 |
|
|---|---|---|---|---|
|
[考研] 081200-11408-276學(xué)碩求調(diào)劑 +5 | 崔wj 2026-03-26 | 5/250 |
|
|
[考研] 279求調(diào)劑 +7 | 莫xiao 2026-04-01 | 7/350 |
|
|
[考研] 070300一志愿211,312分求調(diào)劑院校 +14 | 小黃鴨寶 2026-03-30 | 14/700 |
|
|
[考研] 0856初試324分求調(diào)劑 +5 | 想上學(xué)求調(diào) 2026-04-01 | 5/250 |
|
|
[考研] 材料0856 英一數(shù)二 323 求調(diào)劑 +9 | 袁sy 2026-04-01 | 9/450 |
|
|
[考研] 材料專碩322分 +9 | 哈哈哈吼吼吼哈 2026-04-01 | 9/450 |
|
|
[碩博家園] 考研調(diào)劑 +5 | 駱駝男人 2026-04-01 | 5/250 |
|
|
[考研] 考研調(diào)劑 +11 | Amber00 2026-03-31 | 11/550 |
|
|
[考研] 材料與化工調(diào)劑一志愿大連海事085600,349 +9 | 吃的不少 2026-03-30 | 9/450 |
|
|
[考研] 材料調(diào)劑 +10 | Eujd1 2026-03-31 | 11/550 |
|
|
[考研] 一志愿 南京航空航天大學(xué) ,080500材料科學(xué)與工程學(xué)碩 +10 | @taotao 2026-03-31 | 11/550 |
|
|
[考研] 一志愿a區(qū)211,085601-307分求調(diào)劑 +10 | 黨嘉豪 2026-03-31 | 23/1150 |
|
|
[考研] 求調(diào)劑 +8 | 11ggg 2026-03-30 | 8/400 |
|
|
[考研] 286求調(diào)劑 +5 | 丟掉懶惰 2026-03-27 | 8/400 |
|
|
[考研] 總分322求生物學(xué)/生化與分子/生物信息學(xué)相關(guān)調(diào)劑 +6 | 星沉uu 2026-03-26 | 7/350 |
|
|
[考研] 297 地理學(xué)070500 復(fù)試求調(diào)劑 +3 | 小圓圈圈ooo 2026-03-30 | 3/150 |
|
|
[考研] 材料專碩 085600求調(diào)劑 +7 | BBQ233 2026-03-30 | 7/350 |
|
|
[考研] 342求調(diào)劑 +4 | 加油a李zs 2026-03-26 | 4/200 |
|
|
[考研] 打過很多競賽,085406控制工程300分,求調(diào)劑 +3 | askeladz 2026-03-26 | 3/150 |
|