finding variables in polynomial expressions
Afficher commentaires plus anciens
Hi, have an issue i cant solve with matlab, i wish to get matlab to solve this equation for k1 k2 and ke.
Have tried res = solve((a-b),[k1 k2 ke]) but does not give the results im looking for
clc
clear, close all;
syms s k1 k2 ke
A = [0 -83.33; 500 -10];
B = [166.67; 0];
C= [0 1];
K = [k1 k2];
A2 = [A-B*K B*ke; -C 0];
a = det(s*eye(3)-A2);
b = (s+1600)*(s^2+160*s+30790);
how i do it by hand

Réponse acceptée
Plus de réponses (1)
A = [0 -83.33; 500 -10];
B = [166.67; 0];
C = [0 1];
K = @(k1,k2)[k1 k2];
A2 = @(k1,k2,ke) [A-B*K(k1,k2) B*ke; -C 0];
a = @(k1,k2,ke,s) det(s*eye(3)-A2(k1,k2,ke));
b = @(s)(s+1600)*(s^2+160*s+30790);
fun = @(k1,k2,ke)[a(k1,k2,ke,-1)-b(-1);a(k1,k2,ke,0)-b(0);a(k1,k2,ke,1)-b(1)];
sol = fsolve(@(k)fun(k(1),k(2),k(3)),[0;0;0]);
k1 = sol(1)
k2 = sol(2)
ke = sol(3)
1 commentaire
fredrik s
le 16 Mar 2022
Catégories
En savoir plus sur Calculus dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!