How to find state transition matrix with symbolic parameters efficiently

236 ビュー (過去 30 日間)
xianjie Zhou
xianjie Zhou 2016 年 2 月 17 日
移動済み: Dyuman Joshi 2023 年 12 月 23 日
Hi
I am going to find the state transition matrix of a 4x4 system. But matlab ran for a long time without giving a solution. Is there any other ways to find the solution?
Thanks
syms t
A=[-2.1 -0.98 -0.158 -2.05
2.22 -11.03 0 0
-27.64 0.19 -6.39 -82.6
0 0 1 0]
TM=expm(A*t)

採用された回答

Arnab Sen
Arnab Sen 2016 年 2 月 23 日
Hi xianjie,
I tried to execute the code you provided and found the same issue that it's running long time without giving the output. I investigated into it and found that the function 'expm' is defined as:
>> [V,D] = eig(X)
>> expm(X) = V*diag(exp(diag(D)))/V
Now I found that the right matrix division 'mrdivide'('/') is taking long time. I am not sure why it's taking so long. However, right matrix division '/' can be approximated as matrix inverse 'inv' followed by matrix multiplication. That is, A/B can be approximated by the operation A*inv(B). So, as a workaround, you may consider the following code snippet to achieve the same functionality:
>>syms t;
>>A=[-2.1 -0.98 -0.158 -2.05
2.22 -11.03 0 0
-27.64 0.19 -6.39 -82.6
0 0 1 0];
>>X=A*t;
>>[V,D]=eig(X);
>>TM=(V*diag(exp(diag(D))))* inv(V)
For more details, refer to the following link:
  3 件のコメント
khaled elmoshrefy
khaled elmoshrefy 2020 年 7 月 3 日
移動済み: Dyuman Joshi 2023 年 12 月 23 日
hi, what is t in the exp ?
ISLAM (伊兰沐)
ISLAM (伊兰沐) 2023 年 12 月 23 日
編集済み: ISLAM (伊兰沐) 2023 年 12 月 23 日
Thank you so much! I tried 2x2 matrix I am pasting my code here.
syms t;
A=[0 1; -4 -5];
%State Transition matrix
X=A*t;
[V,D]=eig(X);
STM=(V*diag(exp(diag(D))))* inv(V)
Output
[ (4*exp(-t))/3 - exp(-4*t)/3, exp(-t)/3 - exp(-4*t)/3]
[(4*exp(-4*t))/3 - (4*exp(-t))/3, (4*exp(-4*t))/3 - exp(-t)/3]
Its correct!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLinear Algebra についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by