Convertion of Quadratic form to Cononical form
64 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentario
Debasish Samal
el 24 de Ag. de 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
Respuestas (2)
thode Saiprajwal
el 14 de Abr. de 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
el 22 de Mayo de 2023
Editada: Torsten
el 22 de Mayo de 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 comentarios
Ver también
Categorías
Más información sobre Number Theory en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!