Why do I get different answers for inverse?

2 ビュー (過去 30 日間)
Matlab_DJ
Matlab_DJ 2017 年 3 月 15 日
回答済み: Carlos Felipe Rengifo 2018 年 7 月 6 日
I'm not sure what's going on here. Same numbers, but using inv() gives me different answers than finding the inverse using adjoint over determinate.
clc;clear all;
syms s a
a = [ [0 1 0] ;
[-2 -4 1] ;
[0 0 6];];
matrix = s*eye(3) - a;
xs = inv(matrix) * [0;0;1;] *(1/(s+1))
pretty(xs)
b=adjoint(matrix);
c=det(matrix);
x2s = (b/c)* [0;0;1;] * (1/(s+1)) ;
pretty(x2s)
gives me
xs =
-1/((s + 1)*(- s^3 + 2*s^2 + 22*s + 12))
-s/((s + 1)*(- s^3 + 2*s^2 + 22*s + 12))
1/((s + 1)*(s - 6))
/ 1 \
| - --------------------------------- |
| 3 2 |
| (s + 1) (- s + 2 s + 22 s + 12) |
| |
| s |
| - --------------------------------- |
| 3 2 |
| (s + 1) (- s + 2 s + 22 s + 12) |
| |
| 1 |
| --------------- |
\ (s + 1) (s - 6) /
/ 1 \
| - --------------------------------- |
| 3 2 |
| (s + 1) (- s + 2 s + 22 s + 12) |
| |
| s |
| - --------------------------------- |
| 3 2 |
| (s + 1) (- s + 2 s + 22 s + 12) |
| |
| 2 |
| s + 4 s + 2 |
| - --------------------------------- |
| 3 2 |
\ (s + 1) (- s + 2 s + 22 s + 12) /

採用された回答

Carlos Felipe Rengifo
Carlos Felipe Rengifo 2018 年 7 月 6 日
The variables "xs" and "x2s" contain equivalent mathematical expressions. The variable "xs" is a simplified version of the variable "x2s". You can verify this by writing the following sentence:
>> simplify(xs-x2s)
ans =
0
0
0

その他の回答 (0 件)

カテゴリ

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

製品

Community Treasure Hunt

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

Start Hunting!

Translated by