Error: File: untitled7 Line: 78 Column: 14 Function ‘lim’ has already been declared within this scope.
disp(‘Problem 1’)
disp(‘Part A’)
b = 5;
a = [1 6 11];
G_e = tf(b,a)
% Open-loop transfer function (OLTF)
T_e = feedback(G_e,1)
syms s;
num = b;
den = poly2sym(a,s);
Gs_e = num/den
% b) Steady-state error
es = 8/(1+lim(Gs_e))
er = 8/lim(s*Gs_e)
% a) Closed-loop transfer function (CLTF)
% Symbolic representation of OLTF
% b) Steady-state error with step input
% b) Steady-state error with ramp input
ep = 8/lim(s^2*Gs_e)
% b) Steady-state error with parabola input
% c) Static error constants
Kp = lim(Gs_e)
Kv = lim(s*Gs_e)
Ka = lim(s^2*Gs_e)
% c) Position constant, Kp
% c) Velocity constant, Kv
% c) Acceleration constant, Ka
% d) Determine system type
checkSystemType(Kp,Kv,Ka);
% 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
%%
%% Example 2
disp(‘Example2’);
b = 12;
a = conv([1 6],[1 9]);
G_e = tf(b,a)
% Open-loop transfer function (OLTF)
T_e = feedback(G_e,1)
syms s;
num = b;
den = poly2sym(a,s);
Gs_e = num/den
% b) Steady-state error
es = 8/(1+lim(Gs_e))
er = 8/lim(s*Gs_e)
% a) Closed-loop transfer function (CLTF)
% Symbolic representation of OLTF
% b) Steady-state error with step input
% b) Steady-state error with ramp input
ep = 8/lim(s^2*Gs_e)
% b) Steady-state error with parabola input
% c) Static error constants
Kp = lim(Gs_e)
Kv = lim(s*Gs_e)
Ka = lim(s^2*Gs_e)
% c) Position constant, Kp
% c) Velocity constant, Kv
% c) Acceleration constant, Ka
% d) Determine system type
checkSystemType(Kp,Kv,Ka);
% 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 disp(‘Problem 1’)
disp(‘Part A’)
b = 5;
a = [1 6 11];
G_e = tf(b,a)
% Open-loop transfer function (OLTF)
T_e = feedback(G_e,1)
syms s;
num = b;
den = poly2sym(a,s);
Gs_e = num/den
% b) Steady-state error
es = 8/(1+lim(Gs_e))
er = 8/lim(s*Gs_e)
% a) Closed-loop transfer function (CLTF)
% Symbolic representation of OLTF
% b) Steady-state error with step input
% b) Steady-state error with ramp input
ep = 8/lim(s^2*Gs_e)
% b) Steady-state error with parabola input
% c) Static error constants
Kp = lim(Gs_e)
Kv = lim(s*Gs_e)
Ka = lim(s^2*Gs_e)
% c) Position constant, Kp
% c) Velocity constant, Kv
% c) Acceleration constant, Ka
% d) Determine system type
checkSystemType(Kp,Kv,Ka);
% 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
%%
%% Example 2
disp(‘Example2’);
b = 12;
a = conv([1 6],[1 9]);
G_e = tf(b,a)
% Open-loop transfer function (OLTF)
T_e = feedback(G_e,1)
syms s;
num = b;
den = poly2sym(a,s);
Gs_e = num/den
% b) Steady-state error
es = 8/(1+lim(Gs_e))
er = 8/lim(s*Gs_e)
% a) Closed-loop transfer function (CLTF)
% Symbolic representation of OLTF
% b) Steady-state error with step input
% b) Steady-state error with ramp input
ep = 8/lim(s^2*Gs_e)
% b) Steady-state error with parabola input
% c) Static error constants
Kp = lim(Gs_e)
Kv = lim(s*Gs_e)
Ka = lim(s^2*Gs_e)
% c) Position constant, Kp
% c) Velocity constant, Kv
% c) Acceleration constant, Ka
% d) Determine system type
checkSystemType(Kp,Kv,Ka);
% 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
Error: File: untitled7 Line: 78 Column: 14
Function ‘lim’ has already been declared within this scope.disp(‘Problem 1’)
disp(‘Part A’)
b = 5;
a = [1 6 11];
G_e = tf(b,a)
% Open-loop transfer function (OLTF)
T_e = feedback(G_e,1)
syms s;
num = b;
den = poly2sym(a,s);
Gs_e = num/den
% b) Steady-state error
es = 8/(1+lim(Gs_e))
er = 8/lim(s*Gs_e)
% a) Closed-loop transfer function (CLTF)
% Symbolic representation of OLTF
% b) Steady-state error with step input
% b) Steady-state error with ramp input
ep = 8/lim(s^2*Gs_e)
% b) Steady-state error with parabola input
% c) Static error constants
Kp = lim(Gs_e)
Kv = lim(s*Gs_e)
Ka = lim(s^2*Gs_e)
% c) Position constant, Kp
% c) Velocity constant, Kv
% c) Acceleration constant, Ka
% d) Determine system type
checkSystemType(Kp,Kv,Ka);
% 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
%%
%% Example 2
disp(‘Example2’);
b = 12;
a = conv([1 6],[1 9]);
G_e = tf(b,a)
% Open-loop transfer function (OLTF)
T_e = feedback(G_e,1)
syms s;
num = b;
den = poly2sym(a,s);
Gs_e = num/den
% b) Steady-state error
es = 8/(1+lim(Gs_e))
er = 8/lim(s*Gs_e)
% a) Closed-loop transfer function (CLTF)
% Symbolic representation of OLTF
% b) Steady-state error with step input
% b) Steady-state error with ramp input
ep = 8/lim(s^2*Gs_e)
% b) Steady-state error with parabola input
% c) Static error constants
Kp = lim(Gs_e)
Kv = lim(s*Gs_e)
Ka = lim(s^2*Gs_e)
% c) Position constant, Kp
% c) Velocity constant, Kv
% c) Acceleration constant, Ka
% d) Determine system type
checkSystemType(Kp,Kv,Ka);
% 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 disp(‘Problem 1’)
disp(‘Part A’)
b = 5;
a = [1 6 11];
G_e = tf(b,a)
% Open-loop transfer function (OLTF)
T_e = feedback(G_e,1)
syms s;
num = b;
den = poly2sym(a,s);
Gs_e = num/den
% b) Steady-state error
es = 8/(1+lim(Gs_e))
er = 8/lim(s*Gs_e)
% a) Closed-loop transfer function (CLTF)
% Symbolic representation of OLTF
% b) Steady-state error with step input
% b) Steady-state error with ramp input
ep = 8/lim(s^2*Gs_e)
% b) Steady-state error with parabola input
% c) Static error constants
Kp = lim(Gs_e)
Kv = lim(s*Gs_e)
Ka = lim(s^2*Gs_e)
% c) Position constant, Kp
% c) Velocity constant, Kv
% c) Acceleration constant, Ka
% d) Determine system type
checkSystemType(Kp,Kv,Ka);
% 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
%%
%% Example 2
disp(‘Example2’);
b = 12;
a = conv([1 6],[1 9]);
G_e = tf(b,a)
% Open-loop transfer function (OLTF)
T_e = feedback(G_e,1)
syms s;
num = b;
den = poly2sym(a,s);
Gs_e = num/den
% b) Steady-state error
es = 8/(1+lim(Gs_e))
er = 8/lim(s*Gs_e)
% a) Closed-loop transfer function (CLTF)
% Symbolic representation of OLTF
% b) Steady-state error with step input
% b) Steady-state error with ramp input
ep = 8/lim(s^2*Gs_e)
% b) Steady-state error with parabola input
% c) Static error constants
Kp = lim(Gs_e)
Kv = lim(s*Gs_e)
Ka = lim(s^2*Gs_e)
% c) Position constant, Kp
% c) Velocity constant, Kv
% c) Acceleration constant, Ka
% d) Determine system type
checkSystemType(Kp,Kv,Ka);
% 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
Error: File: untitled7 Line: 78 Column: 14
Function ‘lim’ has already been declared within this scope. disp(‘Problem 1’)
disp(‘Part A’)
b = 5;
a = [1 6 11];
G_e = tf(b,a)
% Open-loop transfer function (OLTF)
T_e = feedback(G_e,1)
syms s;
num = b;
den = poly2sym(a,s);
Gs_e = num/den
% b) Steady-state error
es = 8/(1+lim(Gs_e))
er = 8/lim(s*Gs_e)
% a) Closed-loop transfer function (CLTF)
% Symbolic representation of OLTF
% b) Steady-state error with step input
% b) Steady-state error with ramp input
ep = 8/lim(s^2*Gs_e)
% b) Steady-state error with parabola input
% c) Static error constants
Kp = lim(Gs_e)
Kv = lim(s*Gs_e)
Ka = lim(s^2*Gs_e)
% c) Position constant, Kp
% c) Velocity constant, Kv
% c) Acceleration constant, Ka
% d) Determine system type
checkSystemType(Kp,Kv,Ka);
% 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
%%
%% Example 2
disp(‘Example2’);
b = 12;
a = conv([1 6],[1 9]);
G_e = tf(b,a)
% Open-loop transfer function (OLTF)
T_e = feedback(G_e,1)
syms s;
num = b;
den = poly2sym(a,s);
Gs_e = num/den
% b) Steady-state error
es = 8/(1+lim(Gs_e))
er = 8/lim(s*Gs_e)
% a) Closed-loop transfer function (CLTF)
% Symbolic representation of OLTF
% b) Steady-state error with step input
% b) Steady-state error with ramp input
ep = 8/lim(s^2*Gs_e)
% b) Steady-state error with parabola input
% c) Static error constants
Kp = lim(Gs_e)
Kv = lim(s*Gs_e)
Ka = lim(s^2*Gs_e)
% c) Position constant, Kp
% c) Velocity constant, Kv
% c) Acceleration constant, Ka
% d) Determine system type
checkSystemType(Kp,Kv,Ka);
% 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 disp(‘Problem 1’)
disp(‘Part A’)
b = 5;
a = [1 6 11];
G_e = tf(b,a)
% Open-loop transfer function (OLTF)
T_e = feedback(G_e,1)
syms s;
num = b;
den = poly2sym(a,s);
Gs_e = num/den
% b) Steady-state error
es = 8/(1+lim(Gs_e))
er = 8/lim(s*Gs_e)
% a) Closed-loop transfer function (CLTF)
% Symbolic representation of OLTF
% b) Steady-state error with step input
% b) Steady-state error with ramp input
ep = 8/lim(s^2*Gs_e)
% b) Steady-state error with parabola input
% c) Static error constants
Kp = lim(Gs_e)
Kv = lim(s*Gs_e)
Ka = lim(s^2*Gs_e)
% c) Position constant, Kp
% c) Velocity constant, Kv
% c) Acceleration constant, Ka
% d) Determine system type
checkSystemType(Kp,Kv,Ka);
% 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
%%
%% Example 2
disp(‘Example2’);
b = 12;
a = conv([1 6],[1 9]);
G_e = tf(b,a)
% Open-loop transfer function (OLTF)
T_e = feedback(G_e,1)
syms s;
num = b;
den = poly2sym(a,s);
Gs_e = num/den
% b) Steady-state error
es = 8/(1+lim(Gs_e))
er = 8/lim(s*Gs_e)
% a) Closed-loop transfer function (CLTF)
% Symbolic representation of OLTF
% b) Steady-state error with step input
% b) Steady-state error with ramp input
ep = 8/lim(s^2*Gs_e)
% b) Steady-state error with parabola input
% c) Static error constants
Kp = lim(Gs_e)
Kv = lim(s*Gs_e)
Ka = lim(s^2*Gs_e)
% c) Position constant, Kp
% c) Velocity constant, Kv
% c) Acceleration constant, Ka
% d) Determine system type
checkSystemType(Kp,Kv,Ka);
% 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
Error: File: untitled7 Line: 78 Column: 14
Function ‘lim’ has already been declared within this scope. error MATLAB Answers — New Questions