3 equations 4 unknowns

3 Ansichten (letzte 30 Tage)
Jens Petit-jean
Jens Petit-jean am 13 Dez. 2020
Kommentiert: Jens Petit-jean am 13 Dez. 2020
hello,
How do you make a matrix M 3x3 so the system is =k.MX (with X a 3x1 matrix [x,y,z] I think.)
x=k.(1.y+6.z)
y=k.(4.x+4z)
z=k.(0.x+1.y)
  2 Kommentare
Cris LaPierre
Cris LaPierre am 13 Dez. 2020
Bearbeitet: Cris LaPierre am 13 Dez. 2020
Does a period (1.y) mean multiplication (1*y)?
Also, I see 4 unknowns (k, x, y, z).
Jens Petit-jean
Jens Petit-jean am 13 Dez. 2020
yes the point means * sorry
and yes made a mistake I mean 4

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 13 Dez. 2020
%x=k.(1.y+6.z)
%y=k.(4.x+4z)
%z=k.(0.x+1.y)
syms x y z k
X = [x; y; z];
eqn = X == k * [0 1 6; 4 0 4; 0 1 0] * X
eqn = 
sol = solve(eqn, [x, y, z])
sol = struct with fields:
x: [1×1 sym] y: [1×1 sym] z: [1×1 sym]
sol.x
ans = 
0
sol.y
ans = 
0
sol.z
ans = 
0

Weitere Antworten (1)

Bruno Luong
Bruno Luong am 13 Dez. 2020
Bearbeitet: Bruno Luong am 13 Dez. 2020
>> M=[0 1 6; 4 0 4; 0 1 0];
>> [X,K]=eig(M);
>> k=1./diag(K);
% select 3rd eigen vector for example
>> X(:,3)
ans =
0.5508
0.8070
0.2131
>> k(3)*M*X(:,3)
ans =
0.5508
0.8070
0.2131

Kategorien

Mehr zu Numerical Integration and Differential Equations finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by