Borrar filtros
Borrar filtros

Using ss2tf when your matrices are variables without values yet

82 visualizaciones (últimos 30 días)
Wynand
Wynand el 10 de Ag. de 2024 a las 12:37
Comentada: Sam Chak el 15 de Ag. de 2024 a las 13:21
syms m b k
A = [0 (1/m+1/b);-k (-k/m-k/b)]
B = [0;k]
C = [0 1]
D = [0]
[b,a] = ss2tf(A,B,C,D)
I would like to get the transfer function of those matrices but the ss2tf function requires the matrices to be numerical. Is there a way to get a symbolic answer or am I looking at the wrong function?
  2 comentarios
Walter Roberson
Walter Roberson el 11 de Ag. de 2024 a las 1:00
To be explicit:
ss2tf() does not work on symbolic variables. Very few of the functions in the Control System Toolbox will work with symbolic variables (the ones that do work are more or less by accident.)
Paul
Paul el 11 de Ag. de 2024 a las 2:25
Editada: Paul el 11 de Ag. de 2024 a las 13:49
ss2tf is not listed on the Control System Toolbox Functions page nor (very surprisingly to me) on the Signal Processing Toolbox Functions page. It's been out of vogue from the CST for so long that I'm always a bit surprised when I see it brought up and wonder why users are asking about it. Not sure when it was taken of the SPT doc; maybe that's been more recent and the reason users still try to use it.
FWIW, tf2ss is still a documented function in the SPT, and it does happen to work with symbolic inputs.

Iniciar sesión para comentar.

Respuesta aceptada

Star Strider
Star Strider el 10 de Ag. de 2024 a las 13:13
Editada: Star Strider el 10 de Ag. de 2024 a las 13:55
I would not use the Symbolic Math Toolbox for this!
For undefined variables, use anonymous functions for them, and then pass the arguments to them later —
A = @(b,k,m) [0 (1/m+1/b);-k (-k/m-k/b)]
A = function_handle with value:
@(b,k,m)[0,(1/m+1/b);-k,(-k/m-k/b)]
B = @(k) [0;k]
B = function_handle with value:
@(k)[0;k]
C = [0 1]
C = 1x2
0 1
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
D = [0]
D = 0
[n,d] = ss2tf(A(1,2,3),B(2),C,D)
n = 1x3
0 2 0
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
d = 1x3
1.0000 2.6667 2.6667
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
EDIT — (10 Aug 2024 at 13:55)
Also —
A = @(b,k,m) [0 (1/m+1/b);-k (-k/m-k/b)]
A = function_handle with value:
@(b,k,m)[0,(1/m+1/b);-k,(-k/m-k/b)]
B = @(k) [0;k]
B = function_handle with value:
@(k)[0;k]
C = [0 1]
C = 1x2
0 1
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
D = [0]
D = 0
TFfcn = @(b,k,m) ss2tf(A(b,k,m),B(k),C,D);
b = 1;
k = 2;
m = 3;
[n,d] = TFfcn(b,k,m)
n = 1x3
0 2 0
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
d = 1x3
1.0000 2.6667 2.6667
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
.

Más respuestas (1)

Paul
Paul el 10 de Ag. de 2024 a las 14:09
Hi Wynand,
For a low-order problem like this, you can use the Symbolic toolbox to evaluate the equtation that computes the transfer function from the state space matrices. If you try it without success, feel free to post back here showing the code you tried and what the problem is.
Also, assuming this model represents some sort of mass-spring-damper system, I suggest reviewing the derivation of the state space matrices, because the A and B matrices don't look correct. For example, 1/b does not have the same units as 1/m.
syms m b k
A = [0 (1/m+1/b);-k (-k/m-k/b)]
A = 
B = [0;k]
B = 
C = [0 1];
D = [0];
%[b,a] = ss2tf(A,B,C,D)
  8 comentarios
Wynand
Wynand el 15 de Ag. de 2024 a las 11:35
Editada: Wynand el 15 de Ag. de 2024 a las 11:37
Good day @Sam Chak
I redid my work and go to this transfer function
syms k m b s
T = k/(m*s^2+b*s+k)
T = 
This seems to be inline with the equation you have as well. Thank you for you engagement
Sam Chak
Sam Chak el 15 de Ag. de 2024 a las 13:21
Please note that your transfer function does not include the gravity term 'mg'. Either you did not account for the effect of gravity, or you canceled out the effect of gravity in the force term , as follows:
which results in
.
If the latter is the case, then the transfer function is valid:
.
Your next step is to design a stabilizing equation such that the elevator reaches the target floor at the desired settling time without overshoot. Note that if you use the popular unconstrained Proportional–Derivative equation, the elevator will reach all target floors at the same settling time. For high-rise buildings, this assumption is somewhat unrealistic.
Additionally, please consider researching Otis Elevator, Kone Elevator, Toshiba Elevator, and Schindler's Lifts if possible.

Iniciar sesión para comentar.

Community Treasure Hunt

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

Start Hunting!

Translated by