How to do Z transform with Z^-1 format?

185 ビュー (過去 30 日間)
Diego Marvid
Diego Marvid 2020 年 9 月 27 日
編集済み: Walter Roberson 2024 年 1 月 21 日
I want to do the Z transform of which theoretically is .
However, Matlab's Z transform function (ztrans) gives it in Z format and not in Z^-1 format.
The equation that ztrans(f) gives me is: .
I want to know if there is a clean way to get the Z transform in Z^-1 format as shown above.
If the code is generic and not specific to this example will help a lot.

採用された回答

Star Strider
Star Strider 2020 年 9 月 27 日
The only option I can think of has nothing to do with the Symbolic Math Toolbox, and is instead the Variable argument in the Control System Toolbox. That will allow you to specify z^-1 as the variable.
Since it woulld be best to use the Control System Toolbox anyway (the Symbolic Math Toolbox is not designed for efficient transfer function analysis), that would be my option.
  9 件のコメント
Star Strider
Star Strider 2020 年 9 月 27 日
The heaviside function may not be correct. The delta function would be more likely to be correct. Consider the Laplace and z-transform versions of both. (Those are the bases of my preferences.)
Paul
Paul 2023 年 2 月 23 日
The problem is that sym2poly returns the polynomial coefficient is descending powers of z. So the tf needs be created in z, and then changed to z^-1. Two step process:
syms x n
v = 1;
sympref('HeavisideAtOrigin', v);
x = heaviside(n-1);
H = ztrans(x)
H = 
[num, den] = numden(H);
H = tf(sym2poly(num), sym2poly(den), -1)
H = 1 ----- z - 1 Sample time: unspecified Discrete-time transfer function.
H.Variable = 'z^-1'
H = z^-1 -------- 1 - z^-1 Sample time: unspecified Discrete-time transfer function.

サインインしてコメントする。

その他の回答 (2 件)

Vinit
Vinit 2023 年 11 月 2 日
編集済み: Walter Roberson 2024 年 1 月 21 日
clear all
close all
clc
V = 220;
R = 10;
L = 0.051;
dt = le-3;
t = 0:dt:0.05;
y = [0];
for k =1:length(t)-1
y (K+1)=(1-R*dt/L)*y(k)+dt*(1/L)*V;
end
figure(1)
plot(t,y)
grid on
xlabel ('time (s)')
ylabel ('current (Amp)')

Vinit
Vinit 2023 年 11 月 2 日
編集済み: Walter Roberson 2024 年 1 月 21 日
The solution of equation (5) & (8) is obtainedby using MATLABProgram to solve difference equations
%%Program to plot the difference equation to verify
%Results with time domain equations
%Considering the systemof RL Circuit
% The expression is V=Ri+L(di/dt) clear all
close all clc
%System Parameters
V=220; % Maximum valueof the voltage (Volt)
R=10; % Resistance Value(Ohm)
L=0.051; % Inductor value(Henry)
dt=1e-3; % Time period (T)
t=0:dt:0.05; % Samples, k
y=[0]; % Output stack
fork=1:length(t)-1
y(k+1)=(1-R*dt/L)*y(k)+dt*(1/L)*V; end
figure(1)plot(t,y) grid on
xlabel ('Time (s)') ylabel('Current(Amp)')

カテゴリ

Help Center および File ExchangeSymbolic Math Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by