Solve a system of differential equations which has blkdiag
2 ビュー (過去 30 日間)
古いコメントを表示
I want to solve following equation:
with
Matrices A and C are defined.
I want use ode45 to solve, but I don't know to define matrix B.
function dpdt = control_law(t,xe)
global A C
x = xe(1:2*n,1);
y = xe(2*n+1:end,1);
dxdt = Ax +By (????????)
dydt = C*x;
dpdt = [dxdt;dydt];
end
I tried some of the analysis but to no avail
0 件のコメント
回答 (3 件)
Luca Ferro
2023 年 2 月 21 日
編集済み: Luca Ferro
2023 年 2 月 21 日
given i as identity with coeherent dimensions to x:
blkdiag(x'.*i)
edit: to create i use the eye(n) function, where n is the dimensions
参考
カテゴリ
Help Center および File Exchange で Ordinary Differential Equations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!