Re: [問題] c++寫false position method

看板C_and_CPP (C/C++)作者 (香港3345678)時間16年前 (2009/10/02 17:33), 編輯推噓-1(013)
留言4則, 3人參與, 最新討論串2/4 (看更多)
恩.我把algorithm拉出來給大家想想 f(x)=0 .x介於[p0.p1] step1. i=2;q0=f(p0),q1=f(p1) step2.while i小於等於n0 do step 3-7 step3.set p=p1-q1(p1-p0)/(q1-q0) . [compute p_i] step4. if abs[p-p_i] < TOL then OUTPUT(P); STOP step5.set i=i+1 ; q=f(p) step6 if q*q1<0 then set p0 =p1;q0=q1. step7 set p1=p;q1=q. step8 output;stop 各位大大要的是這個嗎 @@? -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 113.61.179.15 ※ 編輯: coolbetter33 來自: 113.61.179.15 (10/02 17:37)

10/02 17:37, , 1F
歐歐歐 這用Fortran正好寫
10/02 17:37, 1F

10/02 19:21, , 2F
2的n0、3的compute p_i、4的TOL不懂指的是什麼 orz
10/02 19:21, 2F

10/02 19:47, , 3F
找什麼藉口,這跟寫完也沒太大差別
10/02 19:47, 3F

10/02 19:47, , 4F
自己寫一寫,沒有什麼難的
10/02 19:47, 4F
文章代碼(AID): #1AnSZtul (C_and_CPP)
文章代碼(AID): #1AnSZtul (C_and_CPP)