using the transfer function for further calculation

조회 수: 1 (최근 30일)
Eliraz Nahum
Eliraz Nahum 2018년 12월 8일
hey
I extracted the transfer function from my state space definition.
now I want to multiply it (transfer function) with my (converted to lalplace) input and get an expression, which will be converted to the time zone (with the ilaplace function). unfortunately I can do nothing with the expression that I get from G=tf(sys). I am attaching the code I wrote and the 2 last rows make troubles...
clear all
close all
clc
syms t u G Y %creating symbolic variable
%defining the ODE that describes the physical behaviour of the system
a=[6,5,1]; %creating a vector that represents the Input function derivatives coefficients - [a0,a1,...,an-1,...,a0] - 6y+5y'+y''
b=[15,0,0]; %creating a vector that represents the Output function derivatives coefficients - [b0,b1,...,bn-1,...,b0] - 15u+0u'+0u''
ode_order=length(a)-1; %determines the system order
u=2*(t^0);
%creating the matrices of the space state y''=-(a1/a2)*y'-(a0/a2)*y+(b0/a0)*u
%X=[x1,x2]=[y,y'] and X'=[x1',x2']=[y',y'']=[x2,-(a0/a2)*x1-(a1/a2)*x2+(b0/a0)*u]
A=zeros(ode_order,ode_order);
for k=[1:1:(ode_order-1)]
A(k,k+1)=1;
end
for k=[1:1:ode_order]
A(ode_order,k)=-(a(k)/a(ode_order+1));
end
B=zeros(ode_order,1);
B(ode_order,1)=b(1);
C=zeros(1,ode_order);
C(1,1)=1;
D=zeros(1,1);
%DEFINING OUR SYSTEM IN TERMS OF STATE SPACE
sys=ss(A,B,C,D);
%FINDING OUR SYSTEM TRANSFER FUNCTION
G=tf(sys)
Y=G*laplace(u);
ilaplace(Y)

답변 (0개)

카테고리

Help CenterFile Exchange에서 Calculus에 대해 자세히 알아보기

태그

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by