Error with basic tf function when num and den data are enormous

I have trouble with the tf function when I write the following code:
G = -G0*((1+Wz1/s)*(1+s/Wz2))/((1+s/Wp1)*(1+s/Wp2));
[n,d]=numden(simplify(G));
numtf = coeffs(n,s);
dentf = coeffs(d,s);
num = [numtf(1,2) numtf(1,1)];
den = [dentf(1,3) dentf(1,2) dentf(1,1)];
H = tf(num, den);
The error is as follows:
??? Error using ==> tf.tf>tf.tf at 293 The values of the "num" and "den" properties must be row vectors or cell arrays of row vectors, where each vector is nonempty and containing numeric data. Type "help tf.num" or "help tf.den" for more information.
I suppose that my num and den arrays are too big, like;
num =
[ -10255136766097329602890536050147357991662675558400, -459832128482391426299493586726723482988006929678529725]
den =
[ 155212291532809910445709165852975169536, 54585058686258589305546999447174307622420480, 4799118359695855171743692191395565126163208601600]
Could you please help to solve the problem?

 채택된 답변

Walter Roberson
Walter Roberson 2017년 10월 2일
You are trying to pass symbolic variables to a routine that needs numeric data.
You could
tf(double(num), double(den))
but you will lose precision if you do that. Your largest value exceeds -2^178 and to represent it without precision loss would require floating point numbers with at least 179 bits of mantissa.

추가 답변 (2개)

Jason Parekh
Jason Parekh 2021년 11월 5일

0 개 추천

clc
num=(1);
dem=[1 3 10 0];
Ls=tf(num,dem);
relocus(Ls)
clc
Error in Matlab (line 4)
Ls=tf(num,dem);

댓글 수: 1

It’s necessary oto have the Control System Toolbox licensed and installed to ues these functions —
num=(1);
dem=[1 3 10 0];
Ls=tf(num,dem);
rlocus(Ls)
.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터 및 File Exchange에서 Dynamic System Models에 대해 자세히 알아보기

태그

질문:

2017년 10월 2일

댓글:

2021년 11월 5일

Community Treasure Hunt

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

Start Hunting!

Translated by