필터 지우기
필터 지우기

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

조회 수: 6 (최근 30일)
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
Alejandra 2014년 6월 27일
편집: Star Strider 2014년 6월 27일
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개)

Arkadiy Turevskiy
Arkadiy Turevskiy 2014년 7월 7일
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

카테고리

Help CenterFile Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by