I Have problems with the function ss2tf, matlab say me: Undefined function 'max' for input arguments of type 'sym'.

I want obtain the transfer function with the matrix A,B,C,D but I have problems. I don´t know if this problem is by my matlab R2013a, because in other matlab version 2011 works well. Thanks

댓글 수: 2

Alejandra, could you please post your code?
clf;close all;clc;clear all;format short
%%Variables Simbolicas
syms x1 x2 x3 V g K M R L
%%Sistema de Ecuaciones
F1=x2;
F2=g-(K*x3^2)/(M*x1);
F3=(V/L)-((R*x3)/L);
F=[F1;F2;F3]
%%variables de estado
X=[x1;x2;x3];
%%Puntos de equilibrio del sistema
Xe=solve(F,x1,x2,x3);
disp('Los puntos de equilibrio del sistema son:')
Pe=[Xe.x1 Xe.x2 Xe.x3]
%Entrada
Pv=[V];
%Parametros del Sistema
Pf=[M;K;L;g;R];
%%valores de parametros
M=0.05;
K=0.0001;
L=0.01;
R=1;
g=9.81;
V=7;
%
PD=[V;M;K;L;g;R];
Pe=subs(Pe,[Pv;Pf],PD);
%%salidas del sistema
G=X(1);
%%linealizacion
Ao=jacobian(F,X);
A=subs(Ao,[X;Pv;Pf],[Pe';PD]);
E=eig(A)
%
Bo=jacobian(F,Pv);
B=subs(Bo,[X;Pv;Pf],[Pe';PD]);
%
Co=jacobian(G,X);
C=subs(Co,[X;Pv;Pf],[Pe';PD]);
%
Do=jacobian(G,Pv);
D=subs(Do,[X;Pv;Pf],[Pe';PD]);
[num,den]=ss2tf(A,B,C,D) %HERE IS THE PROBLEM
max=double(max)
%num=[-1962/7];
FT=tf(num,den)
pzmap(FT)
figure(2)
step(FT)
axis([0 0.4 -2 0.4])
xlabel('t')
ylabel('Altura del Balón')

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

답변 (1개)

The first problem with your code is that A,B,C,and D matrices are symbolic, but you re trying to use ss2tf function that works on numeric matrices.
If you don't mind the loss of symbolic nature of your matrices, you can convert them to numeric:
A=double(A);
B=double(B);
C=double(C);
D=double(D);
Then your calculations should work

카테고리

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

질문:

2014년 6월 27일

댓글:

2014년 7월 8일

Community Treasure Hunt

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

Start Hunting!

Translated by