How to plot the “Response” and the “damping exponential function of the transient solution” on the same figure?

5 次查看(过去 30 天)
how to plot the exponential curve like this pucture on the same figure ?
I have done this part of the code
-------
clear all;close all;
clc;
xss=0.01;
wf=40;
wn=20;
zeta=0.1;
A=0.1; B=0.04;
wd=wn*sqrt(1-zeta^2);
t=0:0.005:4;
X=xss*cos(wf*t)+(A*sin(wd*t)+B*cos(wd*t)).*exp(-zeta*wn*t);
plot(t,X,'r','LineWidth',2)
grid on
and i got this
------
i need it like this

回答(1 个)

Mathieu NOE
Mathieu NOE 2021-4-6
hello
If you have the Signal Processing Tbx, envelope was made for you
clear all;close all;
clc;
xss=0.01;
wf=40;
wn=20;
zeta=0.1;
A=0.1; B=0.04;
wd=wn*sqrt(1-zeta^2);
t=0:0.005:4;
X=xss*cos(wf*t)+(A*sin(wd*t)+B*cos(wd*t)).*exp(-zeta*wn*t);
plot(t,X,'r','LineWidth',2)
grid on
envelope(X, 100, 'peak')

类别

Help CenterFile Exchange 中查找有关 Digital Filter Analysis 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by