Convertion of Quadratic form to Cononical form
64 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Using MATLAB code to transform the quadratic form 3*(x1)^2 + 5*(x2)^2 + 3*(x3)^2 − 2*(x2)*(x3) +2*(x3)*(x1) − 2*(x1)*(x2) to canonical form and specify the matrix of transformation.
1 Kommentar
Debasish Samal
am 24 Aug. 2020
Hello Sai,
You can use the Symbolic math toolbox to solve this problem.
>> Q = 3*(x1)^2 + 5*(x2)^2 + 3*(x3)^2 - 2*(x2)*(x3) +2*(x3)*(x1) - 2*(x1)*(x2);
>> X = [x1 x2 x3];
>> H = hessian(Q)/2;
H =
[ 3, -1, 1]
[ -1, 5, -1]
[ 1, -1, 3]
Please refer the URL below for proper explantion:
https://www.mathworks.com/matlabcentral/answers/445266-polynomial-to-matrix-form-canonical-form?s_tid=answers_rc1-2_p2_MLT
Antworten (2)
thode Saiprajwal
am 14 Apr. 2021
clc
clear
syms x1 x2 x3 y1 y2 y3
q=input('enter a quadratic form in terms of x1,x2,x3');
a11=(diff(diff(q,x1),x1))/2;
a22=(diff(diff(q,x2),x2))/2;
a33=(diff(diff(q,x3),x3))/2;
a12=(diff(diff(q,x1),x2))/2;
a13=(diff(diff(q,x1),x3))/2;
a23=(diff(diff(q,x2),x3))/2;
A=[a11,a12,a13;a12,a22,a23;a13,a23,a33];
[m,d]=eig(A);
disp('eigen values of A are :')
disp(d)
disp('orthogonal matrix:')
disp(m)
disp('canonical form of q is :')
disp(d(1,1)*(y1)^2+d(2,2)*(y2)^2+d(3,3)*(y3)^2)
Jayashree
am 22 Mai 2023
Bearbeitet: Torsten
am 22 Mai 2023
clc
clear
syms x1 x2 x3 y1 y2 y3
%q=input('enter a quadratic form in terms of x1,x2,x3');
q=3*(x1)^2 + 5*(x2)^2 + 3*(x3)^2 - 2*(x2)*(x3)+2*(x3)*(x1) - 2*(x1)*(x2);
a11=(diff(diff(q,x1),x1))/2;
a22=(diff(diff(q,x2),x2))/2;
a33=(diff(diff(q,x3),x3))/2;
a12=(diff(diff(q,x1),x2))/2;
a13=(diff(diff(q,x1),x3))/2;
a23=(diff(diff(q,x2),x3))/2;
A=[a11,a12,a13;a12,a22,a23;a13,a23,a33];
[m,d]=eig(A);
disp('eigen values of A are :')
disp(d)
disp('orthogonal matrix:')
disp(m)
disp('canonical form of q is :')
disp(d(1,1)*(y1)^2+d(2,2)*(y2)^2+d(3,3)*(y3)^2)
0 Kommentare
Siehe auch
Kategorien
Mehr zu Number Theory finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!