: .
信号与系统实验实验报告
LT
1. 已知描述连续系统的微分方程为,输入,初始状态,计算该系统的响应,并与理论结果比较,列出系统响应分析的步骤。
实验代码:
a=[1 10];
b=[2];
[A B C D]=tf2ss(b,a);
sys=ss(A,B,C,D);
t=0: :5;
xt=t>0;
sta=[1];
y=lsim(sys,xt,t,sta);
subplot(3,1,1);
plot(t,y);
xlabel('t');
title('系统完全响应 y(t)');
subplot(3,1,2);
plot(t,y,'-b');
hold on
yt=4/5*exp(-10*t)+1/5;
plot(t,yt,' : r');
legend('数值计算','理论计算'); hold off
xlabel('t');
subplot(3, 1 ,3);
k=y'-yt;
plot(t,k);
k(1)
title('误差');
实验结果:
结果分析:
理论值 y(t)=0. 8*exp(-10t)*u(t)+
程序运行出的结果与理论预期结果相差较大误差随时间增大而变小, 初始值相差最大,而后两曲线基本吻合,表明该算法的系统响应在终值附近有很高的契合度,而在初值附近有较大的误差。
2. 已知连续时间系统的系统函数为,求输入分别为,,时,系统地输出,并与理论结果比较。
实验代码:
a=[1,3,2,0]; b=[4,1];
sys=tf(b,a);
t=0: :5;
x1=t>0;
x2=(sin(t)).*(t>0);
x3=(exp(-t)).*(t>0);
y1=lsim(sys,x1,t);
y2=lsim(sys,x2,t);
y3=lsim(sys,x3,t);
subplot(3,1,1);
plot(t,y1);
xlabel('t');
title('X(t)=u(t)');
subplot(3,1,2);
plot(t,y2);
xlabel('t');
title('X(t)=sint*u(t)');
subplot(3, 1 ,3);
plot(t,y3);
xlabel('t');
title('X(t)=exp(-t)u(t)');
实验结果:
结果分析:
a=[1,3,2,0]; b=[4,1];
sys=tf(b,a);
t=0: :5;
x1=t>0;
x2=(sin(t)).*(t>0);
x3=(exp(-t)).*(t>0);
y1=lsim(sys,x1,t);
y2=lsim(sys,x2,t);
y3=lsim(sys,x3,t);
subplot(3,1,1);
plot(t,y1,'-b');
hold on
yt1=5/4+*t.*(t>0)+7/4*exp(-2*t).*(t>0)-3*exp(-t).*(t>0);
plot(t,yt1,' : r');
legend('数值计算','理论计算'); hold off
xlabel('t');
subplot(3,1,2);
plot(t,y2,'-b');
hold on
yt2=+*exp(-t).*(t>0)-*exp(-2*t).*(t>0)-*cos(t).*(t>0)+*sin(t).*(t>0);
plot(t,yt2,' : r');
legend('数值计算','理论计算'); hold off
xlabel('t');
subplot(3,1,3);
plot(t,y3,'-b');
hold on
yt3=-4*exp(-t).*(t>0)+7/2*exp(-2*t).*(t>0)+3*t.*exp(-t).*(t>0);
plot(t,yt3,' : r');
legend('数值计算','理论计算'); hold off
xlabel('t');
可见数值计算和理论计算曲线基本重合。
误差分析:, 计算值与理论值契合度很高。
信号与系统实验实验报告 来自淘豆网www.taodocs.com转载请标明出处.