フィルターのクリア

Using solution from vpasolve and syms for another function

1 回表示 (過去 30 日間)
Justin
Justin 2022 年 11 月 2 日
コメント済み: Torsten 2022 年 11 月 2 日
A =[ 0 0 0 1.0000 0 0
0 0 0 0 1.0000 0
0 0 0 0 0 1.0000
0 6.5000 -10.0000 -17.5000 0 0
-21.1185 18.1040 5.1540 -3.6920 -2.8128 0.3159
5.0000 -3.6000 0 0 0 -10.9545]
B = [ 0 0
0 0
0 0
26.5000 11.2000
5.5907 -1.6525
40.0000 57.3000]
C = [ 1 0 0 0 0 0
0 1 0 0 0 0
0 0 1 0 0 0]
syms T1 T2 T3 T4 T5 T6
T = [T1 T2 T3 T4 T5 T6];
d = -5;
G = [10 1 5];
vpasolve([T*A - d*T == G*C])
After solving for the values of T1 to T6, i want to use those values to solve for another equation, but when I input T1,T2... into the other equation, it returns the answer in terms of T1 - T6 instead of actual values
e = T*B
how do i get it to return the actual numbers instead of in terms of T1 etc.?

採用された回答

KSSV
KSSV 2022 年 11 月 2 日
A =[ 0 0 0 1.0000 0 0
0 0 0 0 1.0000 0
0 0 0 0 0 1.0000
0 6.5000 -10.0000 -17.5000 0 0
-21.1185 18.1040 5.1540 -3.6920 -2.8128 0.3159
5.0000 -3.6000 0 0 0 -10.9545] ;
B = [ 0 0
0 0
0 0
26.5000 11.2000
5.5907 -1.6525
40.0000 57.3000] ;
C = [1 0 0 0 0 0
0 1 0 0 0 0
0 0 1 0 0 0] ;
syms T1 T2 T3 T4 T5 T6
T = [T1 T2 T3 T4 T5 T6];
d = -5;
G = [10 1 5];
s = vpasolve([T*A - d*T == G*C]) ;
T = [double(s.T1) double(s.T2) double(s.T3) double(s.T4) double(s.T5) double(s.T6)];
e = T*B
e = 1×2
12.7215 13.2144
  2 件のコメント
Justin
Justin 2022 年 11 月 2 日
thank you!
Torsten
Torsten 2022 年 11 月 2 日
You don't need symbolic computations.
A =[ 0 0 0 1.0000 0 0
0 0 0 0 1.0000 0
0 0 0 0 0 1.0000
0 6.5000 -10.0000 -17.5000 0 0
-21.1185 18.1040 5.1540 -3.6920 -2.8128 0.3159
5.0000 -3.6000 0 0 0 -10.9545] ;
B = [ 0 0
0 0
0 0
26.5000 11.2000
5.5907 -1.6525
40.0000 57.3000] ;
C = [1 0 0 0 0 0
0 1 0 0 0 0
0 0 1 0 0 0] ;
d = -5;
G = [10 1 5];
T = ((A.'-d*eye(6))\(G*C).').';
e = T*B
e = 1×2
12.7215 13.2144

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeConversion Between Symbolic and Numeric についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by