MATLAB Matlab transfer function problem

AI Thread Summary
The user is experiencing issues with defining a transfer function H(s) in MATLAB, where the expression H(s) = L(s)/(1+L(s)) yields unexpected results, such as additional poles and zeros. The correct formulation should be H(s) = A(s) / (B(s) + A(s)), which can be achieved using MATLAB's tfdata function. The user suggests that the problem may stem from the way Ls is defined, noting that the syntax used may not be valid in MATLAB. A proper definition of Ls is recommended to ensure accurate calculations. Ultimately, the discussion highlights potential pitfalls in MATLAB's handling of transfer functions and the importance of correct syntax.
MechatronO
Messages
30
Reaction score
1
I have a transfer function

L(s) = A(s)/B(s)

that I call Ls.

However, when defining

H(s)= L(s)/(1+L(s))

by

Code:
%%
Ls =
 
  -70.6s^2 - 2003 s + 3375
  --------------------------
   s^3 + 119.6 s^2 + 2806 s

%%

Hs = Ls / (1+Ls)

things go wild. The highest exponent power doubles or so and I get several extra poles or zeros. What I should get is

H(s) = A(s) / ( B(s)+A(s) )

which is the exact result. This I can achieve in MATLAB by

Code:
[As,Bs] = tfdata(Ls,'v');

Hs= tf(As,Bs+As)

and the result from this are exactly the expected.

However, why won't

Code:
 Hs = Ls / (1+Ls)

work?

Are matlabs routines that bad? Or am I doing something wrong?
 
Physics news on Phys.org
Is s a vector?
 
No,

s= tf('s');
 
MechatronO said:
Code:
%%
Ls =
 
  -70.6s^2 - 2003 s + 3375
  --------------------------
   s^3 + 119.6 s^2 + 2806 s

%%
[/QUOTE]
This doesn't look like a valid Matlab statement to me. I would write it as 
Ls = ( -70.6s^2 - 2003 s + 3375 ) / ( s^3 + 119.6 s^2 + 2806 s );
(It presumes that s has already been defined earlier.)
 

Similar threads

Replies
8
Views
3K
Replies
11
Views
3K
Replies
3
Views
1K
Replies
1
Views
2K
Replies
2
Views
6K
Replies
6
Views
6K
Replies
2
Views
9K
Back
Top