ํ•„ํ„ฐ ์ง€์šฐ๊ธฐ
ํ•„ํ„ฐ ์ง€์šฐ๊ธฐ

This question determine the static error constants, ๐พ๐‘, ๐พ๐‘ฃ, and ๐พ๐‘Ž of all the open-loop systems below and then determine the system types. But i keep getting an error.

์กฐํšŒ ์ˆ˜: 38 (์ตœ๊ทผ 30์ผ)
Sachini Perera
Sachini Perera 2021๋…„ 10์›” 6์ผ
๋Œ“๊ธ€: Sachini Perera 2021๋…„ 10์›” 6์ผ
and below is the MATLAB i wrote.
a = [1,12];
b = [1,15,54];
rt = tf(a,b);
syms s; % Symbolic variable
num = a;
den = poly2sym(b,s);
gs = num/den; % Symbolic representation of OLTF
Kp = lim(gs); % Position constant, Kp
Kv = lim(s*gs); % Velocity constant, Kv
Ka = lim(s^2*gs); % Acceleration constant, Ka
fprintf('\nc) Determine the static error constants:\n\t\t Kp = %.3f,\n\t\t Kv = %.3f,\n\t\t Ka = %.3f\n', Kp, Kv, Ka)
checkSystemType(Kp,Kv,Ka);
disp (' ') % New line
%% User-defined functions
function y = lim(f)
syms s;
y = limit(f,s,0);
if isnan(y)
y = inf;
end
end
function checkSystemType(Kp,Kv,Ka)
if ~isinf(Kp) && Kv == 0 && Ka == 0
disp('System type: 0');
elseif isinf(Kp) && ~isinf(Kv) && Ka == 0
disp('System type: 1');
elseif isinf(Kp) && isinf(Kv) && ~isinf(Ka)
disp('System type: 2');
end
end
  ๋Œ“๊ธ€ ์ˆ˜: 1
Sachini Perera
Sachini Perera 2021๋…„ 10์›” 6์ผ
thank you soo much for your valuble feedback

๋Œ“๊ธ€์„ ๋‹ฌ๋ ค๋ฉด ๋กœ๊ทธ์ธํ•˜์‹ญ์‹œ์˜ค.

๋‹ต๋ณ€ (1๊ฐœ)

Walter Roberson
Walter Roberson 2021๋…„ 10์›” 6์ผ
You missed that a represents a polynomial.
a = [1,12];
b = [1,15,54];
rt = tf(a,b);
syms s; % Symbolic variable
num = poly2sym(a, s)
numย =ย 
den = poly2sym(b,s)
denย =ย 
gs = num/den % Symbolic representation of OLTF
gsย =ย 
Kp = lim(gs) % Position constant, Kp
Kpย =ย 
Kv = lim(s*gs) % Velocity constant, Kv
Kvย =ย 
0
Ka = lim(s^2*gs) % Acceleration constant, Ka
Kaย =ย 
0
fprintf('\nc) Determine the static error constants:\n\t\t Kp = %.3f,\n\t\t Kv = %.3f,\n\t\t Ka = %.3f\n', Kp, Kv, Ka)
c) Determine the static error constants: Kp = 0.222, Kv = 0.000, Ka = 0.000
checkSystemType(Kp,Kv,Ka);
System type: 0
disp (' ') % New line
%% User-defined functions
function y = lim(f)
syms s;
y = limit(f,s,0);
if isnan(y)
y = inf;
end
end
function checkSystemType(Kp,Kv,Ka)
if ~isinf(Kp) && Kv == 0 && Ka == 0
disp('System type: 0');
elseif isinf(Kp) && ~isinf(Kv) && Ka == 0
disp('System type: 1');
elseif isinf(Kp) && isinf(Kv) && ~isinf(Ka)
disp('System type: 2');
end
end

์นดํ…Œ๊ณ ๋ฆฌ

Help Center ๋ฐ File Exchange์—์„œ Assumptions์— ๋Œ€ํ•ด ์ž์„ธํžˆ ์•Œ์•„๋ณด๊ธฐ

์ œํ’ˆ


๋ฆด๋ฆฌ์Šค

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by