Borrar filtros
Borrar filtros

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

5 visualizaciones (últimos 30 días)
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 comentarios
Alejandra
Alejandra el 27 de Jun. de 2014
Editada: Star Strider el 27 de Jun. de 2014
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')

Iniciar sesión para comentar.

Respuestas (1)

Arkadiy Turevskiy
Arkadiy Turevskiy el 7 de Jul. de 2014
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

Categorías

Más información sobre Symbolic Math Toolbox en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by