0×1 empty double column vector

20 vues (au cours des 30 derniers jours)
Tenzing Thiley
Tenzing Thiley le 14 Fév 2022
Commenté : Walter Roberson le 27 Fév 2022
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 commentaires
Matt J
Matt J le 14 Fév 2022
There's nothing obviously invalid about the answer. Maybe the solution set is truly empty.
Tenzing Thiley
Tenzing Thiley le 14 Fév 2022
no it is not if I type A(1) it is giving value

Connectez-vous pour commenter.

Réponse acceptée

Walter Roberson
Walter Roberson le 14 Fév 2022
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 commentaires
Tenzing Thiley
Tenzing Thiley le 27 Fév 2022
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 le 27 Fév 2022
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

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Plot Customization dans Help Center et File Exchange

Produits


Version

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by