[問題]用ode45解非線性方程式出現錯誤已回收
各為板上前輩你們好~
最近使用ode45搭配最小平方法(像是lsqcurvefit這類功能)做ode裡參數最佳化
在做最佳化過程中都會初下列訊息
Warning: Failure at t=1.000000e+000. Unable to meet integration
tolerances without reducing the step size below the smallest value
allowed (3.552714e-015) at time t.
> In ode45 at 371
這問題我google過,不過每個回答都不太一樣
不過我試過將ode裡的參數做調整,改成較大的參數值,這問題就不會出現
如果只單純跑ode45,不使用最佳化功能,原本很小的參數值都可以跑出正確數值
想請問這是什麼原因??
另外想請問兩個跟標題稍微無關的問題
一、為什麼在使用lsqcurvefit功能時,有時會出現
??? Error using ==> eig
Input to EIG must not contain NaN or Inf.
可是我將這些參數只用ode45計算,出來的數據都是有限值,無NaN及Inf
二、如果在最佳化過程中都沒出現錯誤,結束後會顯示
Optimization terminated: first-order optimality less than OPTIONS.TolFun,
and no negative/zero curvature detected in trust region model.
出現這訊息是最後的正確結果嗎??
(因為最後出來的參數跟我的初始猜測值是一樣的 電腦不知道在蝦跑個什麼勁 囧)
以上麻煩板上前輩解答了~謝謝!!
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 122.126.69.2