| 5 | 1/1 | 返回列表 |
| 查看: 1546 | 回復(fù): 4 | ||
| 當(dāng)前只顯示滿足指定條件的回帖,點(diǎn)擊這里查看本話題的所有回帖 | ||
fgwei2000銅蟲 (正式寫手)
|
[求助]
我編的Simpson積分法fortran程序給不出結(jié)果,大俠們看看哪里出了問題?
|
|
|
如題:我編的Simpson積分法fortran程序給不出結(jié)果,大俠們看看哪里出了問題? 線性函數(shù)f=x在區(qū)間【0,1】上的積分,結(jié)果0.5.[ Last edited by fgwei2000 on 2011-10-29 at 23:07 ] |
銅蟲 (正式寫手)
金蟲 (正式寫手)
迷途書蟲

金蟲 (正式寫手)
迷途書蟲
|
建議參考下列代碼 Program Simpsons implicit none real, Parameter :: a=0,b=1 integer :: n_points integer :: k,i real :: approx real :: del_x, height, area, t,x real :: n_points_1 Write(*,*)'Enter number of points' Read(*,*)n_points n_points_1 = real(n_points) del_x = abs(b-a)/(n_points_1-1.) approx = 0 t = a do k=1, n_points-1 x = t + del_x/2 area = del_x/6 * ( 4*functio_n ( x ) + functio_n(t) + functio_n(t+del_x) ) t = t + del_x approx = approx + area end do Write(*,*)approx Contains Real Function functio_n(x) Real, Intent(in) :: x functio_n=exp(-x) end function end program |

銅蟲 (正式寫手)
| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研] 考研化學(xué)學(xué)碩調(diào)劑,一志愿985 +5 | 張vvvv 2026-03-15 | 7/350 |
|
|---|---|---|---|---|
|
[考研] 311求調(diào)劑 +12 | 冬十三 2026-03-15 | 13/650 |
|
|
[考研] 求調(diào)劑 +5 | 十三加油 2026-03-21 | 5/250 |
|
|
[考研] 322求調(diào)劑 +3 | X123- 2026-03-14 | 3/150 |
|
|
[考研] 311求調(diào)劑 +3 | 勇敢的小吳 2026-03-20 | 3/150 |
|
|
[考研] 296求調(diào)劑 +4 | www_q 2026-03-20 | 4/200 |
|
|
[考研] 一志愿華中科技大學(xué)071000,求調(diào)劑 +3 | 沿岸有貝殼6 2026-03-21 | 3/150 |
|
|
[考研] 一志愿山大07化學(xué) 332分 四六級已過 本科山東雙非 求調(diào)劑! +3 | 不想理你 2026-03-16 | 3/150 |
|
|
[考研] 307求調(diào)劑 +10 | 冷笙123 2026-03-17 | 10/500 |
|
|
[考研] 華東師范大學(xué)-071000生物學(xué)-293分-求調(diào)劑 +3 | 研究生何瑤明 2026-03-18 | 3/150 |
|
|
[考研] 一志愿華中科技大學(xué),080502,354分求調(diào)劑 +5 | 守候夕陽CF 2026-03-18 | 5/250 |
|
|
[考研] 22408 344分 求調(diào)劑 一志愿 華電計(jì)算機(jī)技術(shù) +4 | solanXXX 2026-03-20 | 4/200 |
|
|
[考研] 南京大學(xué)化學(xué)376求調(diào)劑 +3 | hisfailed 2026-03-19 | 6/300 |
|
|
[考研] 0817 化學(xué)工程 299分求調(diào)劑 有科研經(jīng)歷 有二區(qū)文章 +22 | rare12345 2026-03-18 | 22/1100 |
|
|
[論文投稿]
申請回稿延期一個(gè)月,編輯同意了。但系統(tǒng)上的時(shí)間沒變,給編輯又寫郵件了,沒回復(fù)
10+3
|
wangf9518 2026-03-17 | 4/200 |
|
|
[考研] 085600材料與化工調(diào)劑 324分 +10 | llllkkkhh 2026-03-18 | 12/600 |
|
|
[考研] 302求調(diào)劑 +4 | 小賈同學(xué)123 2026-03-15 | 8/400 |
|
|
[考研] 一志愿,福州大學(xué)材料專碩339分求調(diào)劑 +3 | 木子momo青爭 2026-03-15 | 3/150 |
|
|
[考研] 333求調(diào)劑 +3 | 文思客 2026-03-16 | 7/350 |
|
|
[考研] 085601材料工程315分求調(diào)劑 +3 | yang_0104 2026-03-15 | 3/150 |
|