• Non ci sono risultati.

echo on

N/A
N/A
Protected

Academic year: 2021

Condividi "echo on"

Copied!
7
0
0

Testo completo

(1)

echo on

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%% Laplace transforms of time signals x(t)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

syms t n a b c w J s %%% "syms"

defines symbolic variables

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%% "laplace" computes the Laplace transform of the given function x(t)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

disp(laplace(t^n*exp(-a*t))) %%% Time function t^n*exp(a*t):

pretty(laplace(sym(1))) %%%

Unitary step function:

pretty(laplace(t)) %%%

Unitary ramp function:

pretty(laplace(t^2/2)) %%%

Unitary parabola function:

pretty(laplace(exp(-a*t))) %%%

Exponential function:

pretty(laplace(sin(w*t))) %%% Sin function:

pretty(laplace(cos(w*t))) %%% Cos function:

pause %%% Press a keybord key to continue

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%% Laplace transforms of other funcitons

(2)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

pretty(simplify(laplace(exp(-a*t)*cos(w*t))))

%%% Exponential-cosinus function:

pretty(simplify(laplace((1-exp(-b*t/J))/b)))

%%% Time function:

pretty(laplace(2*(1+t^2)*exp(5*t)))

%%% Time function:

pretty(laplace(4+3*exp(-3*t)*sin(7*t)))

%%% Time function:

pretty(laplace(2*exp(5*t)*sin(8*t)))

%%% Time function:

pretty(laplace(2*t^2*exp(-4*t)))

%%% Time function:

pause %%% Press a keybord key to continue

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%% "step" computes the step response of the given s function

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

s=tf('s'); %%%

Defines "s" as the Laplace variable

Gs=(3*s^2+5*s+2)/(s^3+4*s^2+3*s+1) %%%

Defines the Gs function:

figure(1) %%% Open a new figure

step(Gs) %%%

Compute the step response of function Gs

grid on %%% Add

the grid to the figure

(3)

%%% See the figure.

pause %%% Press a keybord key to continue

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Gs=(6*s+8)/(2*s+1) %%%

Defines the Gs function:

figure(1) %%% Open a new figure

step(Gs) %%%

Compute the step response of function Gs

grid on %%% Add the grid to the figure

ylim([0 10]) %%%

Defines the limits of the y axis

%%% See the figure.

pause %%% Press a keybord key to continue

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%% "ilaplace(Ys)" computes the inverse Laplace transform of function Ys

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

syms s t %%%

Defines the symbolic variable s

Ys=(5*s+3)/((s+1)*(s+2)*(s+3)) %%%

Defines the Ys function:

yt=ilaplace(Ys); %%%

Inverse Laplace transform y(t):

pretty(yt) %%% Nice

graphical representation

(4)

%%%%%%

Ys=(7*s^2-8*s+5)/(s^3+2*s^2+5*s) %%%

Defines the Ys function:

yt=ilaplace(Ys); %%%

Inverse Laplace transform y(t):

pretty(yt) %%% Nice graphical representation

%%%%%%

Ys=1/(s+2)/(s+1)^2 %%%

Defines the Ys function:

yt=ilaplace(Ys); %%%

Inverse Laplace transform y(t):

pretty(yt) %%% Nice graphical representation

pause %%% Press a keybord key to continue

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%% Two functions plotted on the same figure

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

figure(2); clf %%% Open a new figure

t=(0:0.01:1)*5; %%%

Defines the time axis

yt=6*exp(-t).*(cos(2*t) - (4*sin(2*t))/3) + 1; %%% Defines the y(t) function

y1t=1+10*exp(-t).*cos(2*t+atan(4/3));

%%% Defines the y1(t) function

plot(t,yt,'b') %%% Plot in blue the y(t) function

hold on %%%

Mantains the previous plots

(5)

plot(t,y1t,'r.') %%% Plot in red the points of function y1(t)

grid on %%% Add the grid to the figure

pause %%% Press a keybord key to continue

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%% The impulsive response is equal to the inverse Laplace transform

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

syms s t %%%

Defines the symbolic variable s

Ys=(5*s+3)/((s+1)*(s+2)*(s+3)) %%%

Defines the Ys function:

yt=ilaplace(Ys); %%%

Inverse Laplace transform y(t):

%%%%%%

s=tf('s'); %%%

Defines "s" as the Laplace variable

Y1s=(5*s+3)/((s+1)*(s+2)*(s+3)) %%%

Defines the Ys function:

figure(3); clf %%% Open a new figure

impulse(Y1s) %%%

Compute the impulse response of function Y1s hold on %%%

Mantains the previous plots

V=axis; %%% Read the ranges of the axis

t=(0:0.005:1)*V(2); %%%

Defines the time axis

(6)

yt=eval(yt); %%%

Defines the time axis

plot(t,yt,'r.') %%% Plot in red the points of function y1(t)

grid on %%% Add the grid to the figure

pause %%% Press a keybord key to continue

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%% Dominant poles

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

syms s t %%%

Defines the symbolic variable s

Ys=(s+37)*(s+225)/((s+350)*(10*s+15)*(s^2+2*s +20)*(40*s+2)*s);

yt=ilaplace(Ys) y0=sym(111/2800);

y1=- (313*exp(-350*t))/16639696400880;

y2=(10579*exp(-(3*t)/2))/7782005;

y3=(111656197*exp(-t)*(cos(19^(1/2)*t) +

(5150758*19^(1/2)*sin(19^(1/2)*t))/111656197) )/746752945400;

y4=- (66495220*exp(-t/20))/1615852131;

figure(3); clf %%% Open a new figure

t=(0:0.002:1)*60;

plot(t,eval(yt),'r') hold on

plot(t,eval(y0)+0*t,'m') plot(t,eval(y1),'b')

plot(t,eval(y2),'b')

(7)

plot(t,eval(y3),'b') plot(t,eval(y4),'m') grid on

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

 

Riferimenti

Documenti correlati

The fact that polarized users tend to remain confined within groups of very few pages even when the corresponding neighborhoods are active on several news sources, suggests that

Terminal deletions can be repaired and stabilized through the synthesis of a new telomere (telomere healing), demonstrated through sequence analysis of terminal deletions that showed

Il testo greco conserva maggiori dettagli ri- spetto al testo latino e in particolare precisa che Caius Pinarius apparte- neva alla quinta coorte della legione XXII, centuria

We used LPDS as LCAT source, and effective involve- ment of this enzyme in the 24(S)OH-C esterification was supported by different experimental approaches including failure to

Our analysis demonstrates that in a population-based study with initially normal left ventricular ejection fraction (LVEF), reduced myocardial mechano-energetic efficiency for each g

To investigate this concept, we compared the outcome of ambulatory patients with chronic HF and reduced or mildly reduced LV ejection fraction (EF) divided according to

Los par´ ametros gr´ aficos pueden indicarse de dos modos; bien de modo permanente, lo que afectar´ a a todas las funciones gr´ aficas que accedan al dispositivo gr´ afico, bien

• second step: before eliminating the second column, look for the coefficient of the column biggest in absolute value, starting from the second row; if r is the row where the pivot