Extracting coefficient Matrix and vector from available polynomial Expressions with exponential terms

5 ビュー (過去 30 日間)
Hello All,
I have stuck in one problem, where I have variable matrix vector available and I want to extract the coefficient matrix and variable vector from that original polynomial vector matrix. For e.g. if A is matrix as:
and I want to extract its coefficients and variable vector as given below:
So my question is how to compute or Extract Matrix Y and Matrix Z from A which comprises of expressions with exponential terms of eigenvalues of system matrix.
Is there any direct command? I tried commands like - coeffs, sysvar, equationsToMatrix but in all those cases the variables are fixed.
So, please help me in solving this above problem.
Thank You.

採用された回答

Star Strider
Star Strider 2019 年 5 月 12 日
You have not shown what you already tried or what the results were.
In R2019a, this is possible with a for loop (since coeffs apparently doesn’t like matrices):
syms lambda1 lambda2 t
A = [exp(-lambda1*t)+3*exp(-lambda2*t); -2*exp(-lambda1*t)+4*exp(-lambda2*t)];
for k = 1:size(A,1)
[Ac{k},trm{k}] = coeffs(A(k,:));
end
Cfs = [Ac{1}; Ac{2}]
Trm = [trm{1}; trm{2}]
producing:
Cfs =
[ 1, 3]
[ -2, 4]
Trm =
[ exp(-lambda1*t), exp(-lambda2*t)]
[ exp(-lambda1*t), exp(-lambda2*t)]
That may be the best you can hope for.
  13 件のコメント
Rajani Metri
Rajani Metri 2021 年 3 月 25 日
😃😉 Ok, Thank You STAR
I am entering that Cfs matrix manually now, may be that is what I have to continue.
Thank you again 😊.

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

その他の回答 (1 件)

Rajani Metri
Rajani Metri 2019 年 5 月 15 日
If the coefficients of lyamda in A matrix are either 0 (ZERO) or if the eigenvalues are repeated then there will be t term along with exponential term (For e.g. e^(-2t) and t.e^(-2t). So in these two cases Z Matrix is not correctly computed.
Apart from these two cases the above program given by Star Strider work.
Thank You.

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by