How to find the determinant of 15 X 15 symbolic matrix?

5 ビュー (過去 30 日間)
Vijay Maraviya
Vijay Maraviya 2018 年 4 月 20 日
回答済み: laith saadi 2022 年 2 月 1 日
I am trying to solve the problem which involves manipulations of symbolic equations to get a 15 X 15 matrix ( Sylvester matrix). each term of matrix is a polynomial in one variable, say x. The determinant of this matrix suppose to give 40 degree polynomial equation in x.
As I tried to find determinant using ' det() ' function, computation exceeds the size of memory (8 GB)and computer hung in between.
Is there any other way to compute a determinant of such a big matrix in symbolic form?or else is there any way to get the polynomial (numerical methods)?
Thanks.

回答 (3 件)

Sergey Kasyanov
Sergey Kasyanov 2018 年 4 月 24 日
Hi,
I encountered the similar problem recently and I wrote a simple script for this task. It's designed for parallel computing of Gauss elimination but it will be usefull for you too.
Check this.
You should use function GaussElminitaion:
ADet=det(GaussElimination(AMatrix));
  6 件のコメント
Murthy MVVS
Murthy MVVS 2021 年 4 月 17 日
編集済み: Walter Roberson 2022 年 1 月 25 日
I have a 13 x 13 matrix given as M. I am using Matlab 2021a
If I use your code as detM = prod(diag(GaussElimination(M,'NULL')))
I am getting error as,
Error: File: GaussElimination.m Line: 55 Column: 13
Unable to classify the variable 'A1' in the body of the parfor-loop. For more information, see Parallel for
Loops in MATLAB, "Solve Variable Classification Issues in parfor-Loops".
And
If I use the matlab 'det' as detM = det(M)
I am getting error as,
detM =
Warning: Unable to display symbolic object because 'symengine' was reset. Repeat commands to regenerate
result.
> In sym/disp (line 44)
In sym/display>displayVariable (line 89)
In sym/display (line 51)
In det_m (line 37)
The matlab script file is,
%%%%%%%%% det_m.m %%%%%%%%%
clear all;
clc;
syms a1 a3 a7 a9 a10 a11;
syms b2 b3 b8 b12 b13;
syms c1 c3 c4 c7 c9 c10 c11;
syms d4 d6 d7 d9 d10 d11;
syms e5 e6 e8 e12 e13;
syms f4 f6 f7 f9 f10 f11;
syms g1 g3 g4 g6 g7 g9 g10 g11 g12;
syms h2 h5 h8 h9 h11 h12 h13;
syms i1 i3 i4 i6 i7 i8 i9 i10 i11 i13;
syms j1 j3 j4 j6 j7 j8 j9 j10 j11 j13;
syms k1 k3 k4 k6 k7 k8 k9 k10 k11 k13;
syms l2 l5 l7 l8 l10 l12 l13;
syms m2 m5 m8 m9 m11 m12 m13;
M = [
[ a1, 0, a3, 0, 0, 0, a7, 0, a9, a10, a11, 0, 0]
[ 0, b2, b3, 0, 0, 0, 0, b8, 0, 0, 0, b12, b13]
[ c1, 0, c3, 0, 0, 0, c7, 0, c9, c10, c11, 0, 0]
[ 0, 0, 0, d4, 0, d6, d7, 0, d9, d10, d11, 0, 0]
[ 0, 0, 0, 0, e5, e6, 0, e8, 0, 0, 0, e12, e13]
[ 0, 0, 0, f4, 0, f6, f7, 0, f9, f10, f11, 0, 0]
[ g1, 0, g3, g4, 0, g6, g7, 0, g9, g10, g11, g12, 0]
[ 0, h2, 0, 0, h5, 0, 0, h8, h9, 0, h11, h12, h13]
[ i1, 0, i3, i4, 0, i6, i7, i8, i9, i10, i11, 0, i13]
[ j1, 0, j3, j4, 0, j6, j7, j8, j9, j10, j11, 0, j13]
[ k1, 0, k3, k4, 0, k6, k7, k8, k9, k10, k11, 0, k13]
[ 0, l2, 0, 0, l5, 0, l7, l8, 0, l10, 0, l12, l13]
[ 0, m2, 0, 0, m5, 0, 0, m8, m9, 0, m11, m12, m13]
]
detM = prod(diag(GaussElimination(M,'NULL')))
% detM = det(M)
%%%%%%%%% End det_m.m %%%%%%%%%
Walter Roberson
Walter Roberson 2021 年 4 月 17 日
You need about 8 terabytes of memory (or more) to store the determinant of that matrix.

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


laith saadi
laith saadi 2022 年 1 月 25 日
編集済み: Walter Roberson 2022 年 1 月 25 日
clear all;
clc;
syms a1 a3 a7 a9 a10 a11;
syms b2 b3 b8 b12 b13;
syms c1 c3 c4 c7 c9 c10 c11;
syms d4 d6 d7 d9 d10 d11;
syms e5 e6 e8 e12 e13;
syms f4 f6 f7 f9 f10 f11;
syms g1 g3 g4 g6 g7 g9 g10 g11 g12;
syms h2 h5 h8 h9 h11 h12 h13;
syms i1 i3 i4 i6 i7 i8 i9 i10 i11 i13;
syms j1 j3 j4 j6 j7 j8 j9 j10 j11 j13;
syms k1 k3 k4 k6 k7 k8 k9 k10 k11 k13;
syms l2 l5 l7 l8 l10 l12 l13;
syms m2 m5 m8 m9 m11 m12 m13;
M = [
[ a1, 0, a3, 0, 0, 0, a7, 0, a9, a10, a11, 0, 0]
[ 0, b2, b3, 0, 0, 0, 0, b8, 0, 0, 0, b12, b13]
[ c1, 0, c3, 0, 0, 0, c7, 0, c9, c10, c11, 0, 0]
[ 0, 0, 0, d4, 0, d6, d7, 0, d9, d10, d11, 0, 0]
[ 0, 0, 0, 0, e5, e6, 0, e8, 0, 0, 0, e12, e13]
[ 0, 0, 0, f4, 0, f6, f7, 0, f9, f10, f11, 0, 0]
[ g1, 0, g3, g4, 0, g6, g7, 0, g9, g10, g11, g12, 0]
[ 0, h2, 0, 0, h5, 0, 0, h8, h9, 0, h11, h12, h13]
[ i1, 0, i3, i4, 0, i6, i7, i8, i9, i10, i11, 0, i13]
[ j1, 0, j3, j4, 0, j6, j7, j8, j9, j10, j11, 0, j13]
[ k1, 0, k3, k4, 0, k6, k7, k8, k9, k10, k11, 0, k13]
[ 0, l2, 0, 0, l5, 0, l7, l8, 0, l10, 0, l12, l13]
[ 0, m2, 0, 0, m5, 0, 0, m8, m9, 0, m11, m12, m13]
]
M = 
detM = prod(diag(GaussElimination(M,'NULL')))
Unrecognized function or variable 'GaussElimination'.
% detM = det(M)
  1 件のコメント
Murthy MVVS
Murthy MVVS 2022 年 1 月 26 日
Use that function provided by Sergey Kasyanov, which can be downloaded from the given link below.
https://in.mathworks.com/matlabcentral/fileexchange/90661-gausselimination

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


laith saadi
laith saadi 2022 年 2 月 1 日
clear all;
clc;
syms a1 a3 a7 a9 a10 a11;
syms b2 b3 b8 b12 b13;
syms c1 c3 c4 c7 c9 c10 c11;
syms d4 d6 d7 d9 d10 d11;
syms e5 e6 e8 e12 e13;
syms f4 f6 f7 f9 f10 f11;
syms g1 g3 g4 g6 g7 g9 g10 g11 g12;
syms h2 h5 h8 h9 h11 h12 h13;
syms i1 i3 i4 i6 i7 i8 i9 i10 i11 i13;
syms j1 j3 j4 j6 j7 j8 j9 j10 j11 j13;
syms k1 k3 k4 k6 k7 k8 k9 k10 k11 k13;
syms l2 l5 l7 l8 l10 l12 l13;
syms m2 m5 m8 m9 m11 m12 m13;
M = [
[ a1, 0, a3, 0, 0, 0, a7, 0, a9, a10, a11, 0, 0]
[ 0, b2, b3, 0, 0, 0, 0, b8, 0, 0, 0, b12, b13]
[ c1, 0, c3, 0, 0, 0, c7, 0, c9, c10, c11, 0, 0]
[ 0, 0, 0, d4, 0, d6, d7, 0, d9, d10, d11, 0, 0]
[ 0, 0, 0, 0, e5, e6, 0, e8, 0, 0, 0, e12, e13]
[ 0, 0, 0, f4, 0, f6, f7, 0, f9, f10, f11, 0, 0]
[ g1, 0, g3, g4, 0, g6, g7, 0, g9, g10, g11, g12, 0]
[ 0, h2, 0, 0, h5, 0, 0, h8, h9, 0, h11, h12, h13]
[ i1, 0, i3, i4, 0, i6, i7, i8, i9, i10, i11, 0, i13]
[ j1, 0, j3, j4, 0, j6, j7, j8, j9, j10, j11, 0, j13]
[ k1, 0, k3, k4, 0, k6, k7, k8, k9, k10, k11, 0, k13]
[ 0, l2, 0, 0, l5, 0, l7, l8, 0, l10, 0, l12, l13]
[ 0, m2, 0, 0, m5, 0, 0, m8, m9, 0, m11, m12, m13]
]
detM = prod(diag(GaussElimination(M,'NULL')))
% detM = det(M)

カテゴリ

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