| 5 | 1/1 | 返回列表 |
| 查看: 1635 | 回復(fù): 4 | |||
astringent銅蟲 (著名寫手)
|
[交流]
【求助】相關(guān)函數(shù)歸一化后,輸出值怎么變成NaN了?? 已有3人參與
|
|
我編程計(jì)算相關(guān)函數(shù)時(shí),未歸一化時(shí)求出的相關(guān)函數(shù)趨勢(shì)是對(duì)的,可是我加了歸一化的語(yǔ)句后(也就是程序中的tcf0(delt)=tcf0(delt)+tcf0(t)*tcf0(t)),輸出的相關(guān)函數(shù)的值就變成NaN了,我查了一下,NaN可能是運(yùn)算錯(cuò)誤,請(qǐng)大家?guī)兔纯,是我的歸一化條件加的不對(duì)嗎??先謝謝了 下面是我的程序: 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(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 ] |
金蟲 (正式寫手)

銅蟲 (著名寫手)
|
我原來(lái)的程序是這樣的,此時(shí)沒(méi)出現(xiàn)輸出錯(cuò)誤的問(wèn)題, 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) 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)輸出錯(cuò)誤了,是怎么回事呢? |
木蟲 (著名寫手)
銅蟲 (著名寫手)
| 5 | 1/1 | 返回列表 |
| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研] 317求調(diào)劑 +12 | 申子申申 2026-03-19 | 18/900 |
|
|---|---|---|---|---|
|
[考研] 280分求調(diào)劑 一志愿085802 +4 | PUMPT 2026-03-22 | 7/350 |
|
|
[考研] 環(huán)境學(xué)碩288求調(diào)劑 +6 | 皮皮皮123456 2026-03-22 | 6/300 |
|
|
[考研] 求調(diào)劑 +7 | Auroracx 2026-03-22 | 7/350 |
|
|
[考研] 0805材料320求調(diào)劑 +3 | 深海物語(yǔ) 2026-03-20 | 3/150 |
|
|
[考研] 279分求調(diào)劑 一志愿211 +14 | chaojifeixia 2026-03-19 | 15/750 |
|
|
[考研] 303求調(diào)劑 +5 | 睿08 2026-03-17 | 7/350 |
|
|
[考研] 材料工程(專)一志愿985 初試335求調(diào)劑 +3 | hiloiy 2026-03-17 | 4/200 |
|
|
[考研] 二本跨考鄭大材料306英一數(shù)二 +3 | z1z2z3879 2026-03-17 | 3/150 |
|
|
[考研] 332求調(diào)劑 +4 | ydfyh 2026-03-17 | 4/200 |
|
|
[考研] 一志愿蘇州大學(xué)材料求調(diào)劑,總分315(英一) +5 | sbdksD 2026-03-19 | 5/250 |
|
|
[考研] 一志愿南理工085701環(huán)境302求調(diào)劑院校 +3 | 葵梓衛(wèi)隊(duì) 2026-03-20 | 3/150 |
|
|
[考研] 環(huán)境工程調(diào)劑 +9 | 大可digkids 2026-03-16 | 9/450 |
|
|
[考研] 085601材料工程專碩求調(diào)劑 +10 | 慕寒mio 2026-03-16 | 10/500 |
|
|
[考研] 材料與化工求調(diào)劑 +7 | 為學(xué)666 2026-03-16 | 7/350 |
|
|
[考研] 328求調(diào)劑,英語(yǔ)六級(jí)551,有科研經(jīng)歷 +4 | 生物工程調(diào)劑 2026-03-16 | 12/600 |
|
|
[考研] 344求調(diào)劑 +6 | knight344 2026-03-16 | 7/350 |
|
|
[考研] 0854可跨調(diào)劑,一作一項(xiàng)核心論文五項(xiàng)專利,省、國(guó)級(jí)證書40+數(shù)一英一287 +8 | 小李0854 2026-03-16 | 8/400 |
|
|
[考研] 材料,紡織,生物(0856、0710),化學(xué)招生啦 +3 | Eember. 2026-03-17 | 9/450 |
|
|
[考研] 一志愿南京大學(xué),080500材料科學(xué)與工程,調(diào)劑 +4 | Jy? 2026-03-16 | 4/200 |
|