How to convert Time function to Laplace function easily

9 visualizzazioni (ultimi 30 giorni)
Y77
Y77 il 21 Ott 2020
Risposto: Altaïr il 6 Giu 2025
How Can I I get the final TF of the sys by using lapalce command as shown in the attached pic..
close all, clc,clear all
syms z t tau x u s
z*(t+tau)==u;
Eq=ans;
Eq2=diff(z);
laplace(Eq)
sys=z/u;
sys=1/(s^2*tau+s)

Risposte (1)

Altaïr
Altaïr il 6 Giu 2025
Hey @Y77,
If the function z(t) is known and then the time delay is applied, MATLAB will impose the time advance property internally. A couple of example can be found at the following links:
If the function z(t) is not known, I had to apply the time advance property manually. Here the complete code to obtain the transfer function:
syms t tau s
syms z(t) u(t) Z(s) U(s)
% Define the differential equation: d/dt[z(t + tau)] = u(t)
eqn = diff(z(t + tau), t) == u(t);
disp(eqn)
% Take Laplace transform of the equation
L_eqn = laplace(eqn, t, s);
disp(L_eqn)
% Substitute laplace(z(t+tau),t,s) with exp(s*tau)*laplace(z(t),t,s)
% (due to time advance property under causality)
L_eqn = subs(L_eqn, laplace(z(t + tau), t, s), exp(s*tau)*laplace(z(t), t, s));
disp(L_eqn)
% Substitute Z(s) and U(s) for readability
L_eqn = subs(L_eqn, [laplace(z(t), t, s), laplace(u(t), t, s)], [Z(s), U(s)]);
disp(L_eqn)
% Set initial condition z(tau) = 0 (from causality)
L_eqn = subs(L_eqn, z(tau), 0);
disp(L_eqn)
% Compute transfer function Z(s)/U(s)
sys = (rhs(L_eqn)/U(s)) / (lhs(L_eqn)/Z(s));
% Display the result
disp('Transfer function Z(s)/U(s):');
Transfer function Z(s)/U(s):
pretty(sys);
exp(-s τ) --------- s

Community Treasure Hunt

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

Start Hunting!

Translated by