0×1 empty double column vector

20 次查看(过去 30 天)
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 CenterFile Exchange 中查找有关 Plot Customization 的更多信息

产品


版本

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by