| 5 | 1/1 | 返回列表 |
| 查看: 1636 | 回復(fù): 4 | |||
astringent銅蟲 (著名寫手)
|
[交流]
【求助】相關(guān)函數(shù)歸一化后,輸出值怎么變成NaN了?? 已有3人參與
|
|
我編程計算相關(guān)函數(shù)時,未歸一化時求出的相關(guān)函數(shù)趨勢是對的,可是我加了歸一化的語句后(也就是程序中的tcf0(delt)=tcf0(delt)+tcf0(t)*tcf0(t)),輸出的相關(guān)函數(shù)的值就變成NaN了,我查了一下,NaN可能是運(yùn)算錯誤,請大家?guī)兔纯矗俏业臍w一化條件加的不對嗎??先謝謝了 下面是我的程序: do i=1,10000 (粒子數(shù)) do ntel=1,npoints (共有npoints個數(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(delt)=tcf0(delt)+tcf0(t)*tcf0(t) enddo endif enddo enddo do ical=1,npoints tcf(ical)=tcf(ical)/tcf0(ical) [ Last edited by ghcacj on 2010-12-8 at 09:28 ] |
金蟲 (正式寫手)

銅蟲 (著名寫手)
|
我原來的程序是這樣的,此時沒出現(xiàn)輸出錯誤的問題, do i=1,10000 (粒子數(shù)) do ntel=1,npoints (共有npoints個數(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) enddo endif enddo enddo do ical=1,npoints tcf(ical)=tcf(ical)/nparticle*ntime(t) enddo 但是我需要算歸一化的相關(guān)函數(shù),于是我就把tcf(delt)=tcf(delt)+tcf(ntel)*tcf0(t) 改成了tcf(delt)=tcf(delt)+(tcf(ntel)*tcf0(t))/(tcf0(t)*tcf0(t) ) ,就出現(xiàn)輸出錯誤了,是怎么回事呢? |
木蟲 (著名寫手)
銅蟲 (著名寫手)
| 5 | 1/1 | 返回列表 |
| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研] 291 求調(diào)劑 +4 | 化工2026屆畢業(yè)?/a> 2026-03-21 | 4/200 |
|
|---|---|---|---|---|
|
[考研] 284求調(diào)劑 +6 | Zhao anqi 2026-03-22 | 6/300 |
|
|
[考研] 276求調(diào)劑 +3 | YNRYG 2026-03-21 | 4/200 |
|
|
[考研] 能源材料化學(xué)課題組招收碩士研究生8-10名 +5 | 脫穎而出 2026-03-16 | 17/850 |
|
|
[考研] 生物學(xué)一志愿985,分?jǐn)?shù)349求調(diào)劑 +4 | zxts12 2026-03-21 | 7/350 |
|
|
[考研] 資源與環(huán)境 調(diào)劑申請(333分) +5 | holy J 2026-03-21 | 5/250 |
|
|
[考研] 廣西大學(xué)材料導(dǎo)師推薦 +3 | 夏夏夏小正 2026-03-17 | 5/250 |
|
|
[考研] 一志愿深大,0703化學(xué),總分302,求調(diào)劑 +4 | 七月-七七 2026-03-21 | 4/200 |
|
|
[考研] 070300化學(xué)319求調(diào)劑 +7 | 錦鯉0909 2026-03-17 | 7/350 |
|
|
[考研] 一志愿中國石油大學(xué)(華東) 本科齊魯工業(yè)大學(xué) +3 | 石能偉 2026-03-17 | 3/150 |
|
|
[考研] 一志愿南昌大學(xué),327分,材料與化工085600 +9 | Ncdx123456 2026-03-19 | 9/450 |
|
|
[考研] 一志愿西南交通 專碩 材料355 本科雙非 求調(diào)劑 +5 | 西南交通專材355 2026-03-19 | 5/250 |
|
|
[考研] 一志愿西安交通大學(xué) 學(xué)碩 354求調(diào)劑211或者雙一流 +3 | 我想要讀研究生 2026-03-20 | 3/150 |
|
|
[考研] 材料與化工專碩調(diào)劑 +7 | heming3743 2026-03-16 | 7/350 |
|
|
[考研] 081700化工學(xué)碩調(diào)劑 +3 | 【1】 2026-03-16 | 3/150 |
|
|
[考研] 【同濟(jì)軟件】軟件(085405)考研求調(diào)劑 +3 | 2026eternal 2026-03-18 | 3/150 |
|
|
[考研] 材料,紡織,生物(0856、0710),化學(xué)招生啦 +3 | Eember. 2026-03-17 | 9/450 |
|
|
[碩博家園] 湖北工業(yè)大學(xué) 生命科學(xué)與健康學(xué)院-課題組招收2026級食品/生物方向碩士 +3 | 1喜春8 2026-03-17 | 5/250 |
|
|
[考研] 283求調(diào)劑 +3 | 聽風(fēng)就是雨; 2026-03-16 | 3/150 |
|
|
[考研]
|
zhouzhen654 2026-03-16 | 3/150 |
|