微分方程式のパラメー​タを推定する方法はあ​りますか?

3 views (last 30 days)
MathWorks Support Team
MathWorks Support Team on 28 Mar 2011
MATLABファイルで記述した微分方程式において、パラメータを推定する方法を教えてください。

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 28 Mar 2011
手順としては、微分方程式をモデリングし、実験データと計算によるデータの差が最小になるよう FMINSEARCH 関数で最適化を行います。
以下にメイン関数および、評価関数の例を示します。
詳細については、関連ドキュメントにありますプログラムをダウンロードしてください。
% メイン関数
% 最適化処理
F = @(x) costfcn(x); % コスト関数の定義
x0 = [1 1]; % パラメータの初期値設定
[x,fval] = fminsearch(F,x0,options); % 最適化
% 評価関数
x0 = [0 0]; % 初期状態量
[t1,y1] = ode45(@samp_ode,Time,x0); % 微分方程式の計算
Y = y1(:,1); % 計算データ
out = norm(OutData-Y); % 実験データと計算データのノルム
function dydt = samp_ode(t,y)
% x'' = -a*x'-b*x + u(t)
% a, bを実験データから推定
% 時間tにおける入力の実験データをINTERP1で補間
u = interp1(Time,InData,t);
% 微分方程式 
dydt = [y(2); -param(1)*y(2)-param(2)*y(1)+u];
end

More Answers (0)

Categories

Find more on 最適化 in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!