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 Center および File ExchangeDigital Filter Analysis についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by