finding variables in polynomial expressions
이전 댓글 표시
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

채택된 답변
추가 답변 (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)
카테고리
도움말 센터 및 File Exchange에서 Calculus에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!