0×1 empty double column vector

16 ビュー (過去 30 日間)
Tenzing Thiley
Tenzing Thiley 2022 年 2 月 14 日
コメント済み: Walter Roberson 2022 年 2 月 27 日
My Code -
disp("Break Away Point")
syms sigma omega k f real
s = sigma+j*omega;
fx = (s^3)+(3*s^2)+(2*s)+k;
f = expand(fx);
f1 = real(f);
f2 = imag(f);
A = jacobian([f1,f2],[sigma omega]);
omega = 0;
sigma = vpasolve(det(eval(A)),sigma)
A2 = eval(f1);
k = double(vpasolve(A2,k))
k =
0×1 empty double column vector
any suggestion how to fix it?
  3 件のコメント
Matt J
Matt J 2022 年 2 月 14 日
There's nothing obviously invalid about the answer. Maybe the solution set is truly empty.
Tenzing Thiley
Tenzing Thiley 2022 年 2 月 14 日
no it is not if I type A(1) it is giving value

サインインしてコメントする。

採用された回答

Walter Roberson
Walter Roberson 2022 年 2 月 14 日
There are multiple solutions, but your code was trying to find a single k value that satisfied all of the possibilites at the same time.
Also, do not eval() a symbolic expression. eval() of a symbolic expression gives an undefined result.
disp("Break Away Point")
Break Away Point
syms sigma omega k f real
s = sigma+j*omega;
fx = (s^3)+(3*s^2)+(2*s)+k;
f = expand(fx);
f1 = real(f)
f1 = 
f2 = imag(f)
f2 = 
A = jacobian([f1,f2],[sigma omega])
A = 
Omega = 0;
Sigma = solve(det(subs(A, omega, Omega)),sigma)
Sigma = 
A2 = subs(f1, {sigma, omega}, {Sigma, Omega})
A2 = 
k = arrayfun(@(expr) solve(expr,k), A2)
k = 
  40 件のコメント
Tenzing Thiley
Tenzing Thiley 2022 年 2 月 27 日
Do you know how should I use tiledlayout for multiple graph in one page as in this cases I am getting error
Error using DynamicSystem/rlocus (line 65)
This functionality is not supported in TiledChartLayout
%root locus
tiledlayout(2,2)
nexttile
pitch1 = -pitch/(s+10);
rlocus(pitch1);
v = [-4 4 -4 4]; axis(v)
grid
title('Root-Locus Plot of Pitch displacement Auto pilot]');
xlabel('Real Axis')
ylabel('Imag Axis')
%Bode plot
k = 45;
pitch2 = k*pitch1;
margin(pitch2)
grid on;
title('Bode Plot Pitch of displacement Auto pilot');
tiledlayout(1,2)
sys_cl = feedback(pitch2,1);
step(0.2*sys_cl), grid
ylabel('pitch angle (rad)');
title('Closed-loop Step Response')
Walter Roberson
Walter Roberson 2022 年 2 月 27 日
You could try using subplot() instead of tiled layout. However, some of the plots in that toolbox need a complete figure to draw in, because the plots they draw are interactive plots instead of static plots

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangePlot Customization についてさらに検索

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by