急!!!关于matlab的电路实现问题

核心提示节点电压G1=1/10;G2=1/20;G3=1/10;G4=1/10;us=20;is=1;Gn=[G1+G2+G3 -G3;-(G3+2*G4) G3+G4]In=[G1*us+is;-is];Un=inv(Gn)*In戴维南clear

节点电压

G1=1/10;G2=1/20;G3=1/10;G4=1/10;

us=20;is=1;

Gn=[G1+G2+G3 -G3;-(G3+2*G4) G3+G4]

In=[G1*us+is;-is];

Un=inv(Gn)*In

戴维南

clear,format compact

R1=4;R2=2;R3=4;R4=8; %设置元件参数

is1=2;is2=0.5; %按A*X=B*is列出此电路的矩阵方程。其中X=[u1;u2;ua],is=[is1;is2;ia]

a11=1/R1+1/R4;a12=-1/R1;a13=-1/R4; %设置系数矩阵A

a21=-1/R1;a22=1/R1+1/R2+1/R3;a23=-1/R3;

a31=-1/R4;a32=-1/R3;a33=1/R3+1/R4;

A=[a11,a12,a13;a21,a22,a23;a31,a32,a33];B=[1,1,0;0,0,0;0,-1,1]; %设置系数矩阵B

X1=AB*[is1;is2;0];Uoc=X1(3)

X2=AB*[0;0;1];Req=X2(3)

RL=Req;P=Uoc^2*RL/(Req+RL)^2 %求其最大功率

RL=0:0.01:10;P=(RL*Uoc./(Req+RL)).*Uoc./(Req+RL); %设RL序列求其功率

figure(1),plot(RL,P), grid %画出功耗随RL变化的曲线

卷积

>> p=0.1;

t=0:p:10;

f1=exp(-2*t).*u(t);

f2=u(t)-u(t-4);

f=conv(f1,f2);

subplot(1,3,1);

plot(t,f1,'r');

title('f1(t)=e^-2*t*u(t)');

xlabel('t(sec)');

ylabel('f1(t)');

subplot(1,3,2);

plot(t,f2,'g');

title('f2(t)=u(t)-u(t-4)');

xlabel('t(sec)');

ylabel('f2(t)');

subplot(1,3,3);

plot(f);

title('f(t)=f1(t)*f2(t)');

xlabel('t(sec)');

ylabel('f(t)');

一阶动态

1,RC串联零输入响应

U0=2;R=2;C=0.5; %输入给定参数

U1=3;R1=3;C1=0.5; %输入给定参数

t=[0:0.1:5]; %确定时间范围

Uc1=U0*exp(-t/(R*C));Uc2=U1*exp(-t/(R*C)); %计算电容电压值

Ur1=U0*exp(-t/(R*C));Ur2=U1*exp(-t/(R*C)); %计算电阻电压值

I1=U0/R*exp(-t/(R*C));I2=U1/R*exp(-t/(R*C)); %计算电流值

Pc1=U0^2/R*exp(-2*t/(R*C));Pc2=U1^2/R*exp(-2*t/(R*C)); %计算电容功率值

Pr1=U0^2/R*exp(-2*t/(R*C));Pr2=U1^2/R*exp(-2*t/(R*C)); %计算电阻功率值

figure

subplot(5,1,1);plot(t,Uc1,t,Uc2)

title('Uc(t)的波形图')

subplot(5,1,2);plot(t,Ur1,t,Ur2)

title('Ur(t)的波形图')

subplot(5,1,3);plot(t,I1,t,I2)

title('I(t)的波形图')

subplot(5,1,4);plot(t,Pc1,t,Pc2)

title('Pc(t)的波形图')

subplot(5,1,5);plot(t,Pr1,t,Pr2)

title('Pr(t)的波形图')

2,RL并联零输入响应

I0=2;R=2;L=0.5; %输入给定参数

I1=3;R1=3;L1=0.5; %输入给定参数

t=[0:0.05:1.5]; %确定时间范围

IL1=I0*exp(-t*R/L);IL2=I1*exp(-t*R/L); %计算电感电流值

Ir1=I0*exp(-t*R/L);Ir2=I1*exp(-t*R/L); %计算电阻电流值

U1=I0*R*exp(-t*R/L);U2=I1*R*exp(-t*R/L); %计算电压值

PL1=I0^2*R*exp(-2*t*R/L);PL2=I1^2*R*exp(-2*t*R/L); %计算电感功率值

Pr1=I0^2*R*exp(-2*t*R/L);Pr2=I1^2*R*exp(-2*t*R/L); %计算电阻功率值

figure(1)

subplot(5,1,1);plot(t,IL1,t,IL2)

title('IL(t)的波形图')

subplot(5,1,2);plot(t,Ir1,t,Ir2)

title('Ir(t)的波形图')

subplot(5,1,3);plot(t,U1,t,U2)

title('U(t)的波形图')

subplot(5,1,4);plot(t,PL1,t,PL2)

title('PL(t)的波形图')

subplot(5,1,5);plot(t,Pr1,t,Pr2)

title('Pr(t)的波形图')

3,RC串联零状态响应

Us=2;R=2;C=0.5; %输入给定参数

Us1=3;R1=3;C1=0.5;

t=[0:0.1:10];

Uc1=Us*(1-exp(-t/(R*C)));Uc2=Us1*(1-exp(-t/(R*C)));

Ur1=Us*exp(-t/(R*C));Ur2=Us1*exp(-t/(R*C));

I1=Us/R*exp(-t/(R*C));I2=Us1/R*exp(-t/(R*C));

Pc1=Us^2/R*(exp(-t/(R*C))-exp(-2*t/(R*C)));

Pc2=Us1^2/R*(exp(-t/(R*C))-exp(-2*t/(R*C)));

Pr1=Us^2/R*exp(-2*t/(R*C));Pr2=Us1^2/R*exp(-2*t/(R*C));

figure

subplot(5,1,1);plot(t,Uc1,t,Uc2)

title('Uc(t)的波形图')

subplot(5,1,2);plot(t,Ur1,t,Ur2)

title('Ur(t)的波形图')

subplot(5,1,3);plot(t,I1,t,I2)

title('I(t)的波形图')

subplot(5,1,4);plot(t,Pc1,t,Pc2)

title('Pc(t)的波形图')

subplot(5,1,5);plot(t,Pr1,t,Pr2)

title('Pr(t)的波形图')

4,RL并联零状态响应

Is=2;R=2;L=0.5; %输入给定参数

Is1=3;R1=3;L1=0.5;

t=[0:0.05:1.5];

IL1=Is*(1-exp(-t*R/L));IL2=Is1*(1-exp(-t*R/L));

Ir1=Is*exp(-t*R/L);Ir2=Is1*exp(-t*R/L);

U1=Is*R*exp(-t*R/L);U2=Is1*R*exp(-t*R/L);

PL1=Is^2*R*(exp(-t*R/L)-exp(-2*t*R/L));PL2=Is1^2*R*(exp(-t*R/L)-exp(-2*t*R/L));

Pr1=Is^2*R*exp(-2*t*R/L);Pr2=Is1^2*R*exp(-2*t*R/L);

figure

subplot(5,1,1);plot(t,IL1,t,IL2)

title('IL(t)的波形图')

subplot(5,1,2);plot(t,Ir1,t,Ir2)

title('Ir(t)的波形图')

subplot(5,1,3);plot(t,U1,t,U2)

title('U(t)的波形图')

subplot(5,1,4);plot(t,PL1,t,PL2)

title('PL(t)的波形图')

subplot(5,1,5);plot(t,Pr1,t,Pr2)

title('Pr(t)的波形图')

5,RC串联全响应

U0=2;Us=3;R=2;C=0.5; %输入给定参数

U1=2.5;Us1=3;R1=3;C1=0.5;

t=[0:0.1:5];

Uc1=U0*exp(-t/(R*C))+Us*(1-exp(-t/(R*C)));

Uc2=U1*exp(-t/(R*C))+Us1*(1-exp(-t/(R*C)));

Ur1=Us*exp(-t/(R*C))-U0*exp(-t/(R*C));

Ur2=Us1*exp(-t/(R*C))-U1*exp(-t/(R*C));

I1=(Us-U0)/R*exp(-t/(R*C));I2=(Us1-U1)/R*exp(-t/(R*C));

figure(1)

subplot(3,1,1);plot(t,Uc1,t,Uc2)

title('Uc(t)的波形图')

subplot(3,1,2);plot(t,Ur1,t,Ur2)

title('Ur(t)的波形图')

subplot(3,1,3);plot(t,I1,t,I2)

title('I(t)的波形图')

6,RL并联全响应

I0=2;Is=3;R=2;L=0.5; %输入给定参数

I1=2.5;Is1=3;R1=3;L1=0.5;

t=[0:0.01:1.5];

IL1=I0*exp(-t*R/L)+Is*(1-exp(-t*R/L));

IL2=I1*exp(-t*R/L)+Is1*(1-exp(-t*R/L));

Ir1=Is*exp(-t*R/L)-I0*exp(-t*R/L);

Ir2=Is1*exp(-t*R/L)-I1*exp(-t*R/L);

U1=(Is-I0)*R*exp(-t*R/L);U2=(Is1-I1)*R*exp(-t*R/L);

figure(1)

subplot(3,1,1);plot(t,IL1,t,IL2)

title('IL(t)的波形图')

subplot(3,1,2);plot(t,Ir1,t,Ir2)

title('Ir(t)的波形图')

subplot(3,1,3);plot(t,U1,t,U2)

title('U(t)的波形图')

7,全响应分解

U0=2.5;Us=3.5;I0=2;Is=3;R=2;L=0.5;C=1; %输入给定参数

t=[0:0.01:10];

Uc=U0*exp(-t/(R*C))+Us*(1-exp(-t/(R*C)));

Uc1=U0*exp(-t/(R*C)); Uc2=Us*(1-exp(-t/(R*C)));

Uc3=Us; Uc4=(U0-Us)*exp(-t/(R*C));

IL=I0*exp(-t*R/L)+Is*(1-exp(-t*R/L));

IL1=I0*exp(-t*R/L);IL2=Is*(1-exp(-t*R/L));

IL3=Is; IL4=(I0-Is)*exp(-t*R/L);

figure(1)

subplot(4,1,1);plot(t,Uc,t,Uc1,t,Uc2)

title('Uc(t)全响应=零输入+零状态')

subplot(4,1,2);plot(t,IL,t,IL1,t,IL2)

title('IL(t)全响应=零输入+零状态')

subplot(4,1,3);plot(t,Uc,t,Uc3,t,Uc4)

title('Uc(t全响应=暂态分量+稳态分量')

subplot(4,1,4);plot(t,IL,t,IL3,t,IL4)

title('IL(t)全响应=暂态分量+稳态分量')

8,RC串联正弦激励零状态响应

Usm=2;w=pi;R=2;C=0.5;h=atan(w*C*R);z=sqrt((w*R*C)^2+1); %输入给定参数

t=[0:0.01:4];

Us=Usm*cos(w*t+pi/2);

Uc=Usm/z*cos(w*t+pi/2-h)-Usm/z*cos(pi/2-h)*exp(-t/(R*C));

Uc1=-Usm/z*cos(pi/2-h)*exp(-t/(R*C));

Uc2=Usm/z*cos(w*t+pi/2-h);

Ur=1/(R*C)*Usm/z*cos(pi/2-h)*exp(-t/(R*C))-Usm*sin(h)*sin(w*t+pi/2-h);

Ur1=1/(R*C)*Usm/z*cos(pi/2-h)*exp(-t/(R*C));

Ur2=-Usm*sin(h)*sin(w*t+pi/2-h);

I=Ur/R;I1=Ur1/R;I2=Ur2/R;

figure(1)

subplot(2,1,1);plot(t,Uc,t,Uc1,t,Uc2)

title('Uc(t)的波形')

subplot(2,1,2);plot(t,Ur,t,Ur1,t,Ur2)

title('Ur(t)的波形')

subplot(4,1,3);plot(t,I,t,I1,t,I2)

title('I(t)的波形')

subplot(4,1,4);plot(t,Us)

title('Us(t)的波形')

9,RL并联正弦激励零状态响应

Ism=2;w=pi;R=2;L=0.5;h=atan(w*L/R);z=sqrt((w*L)^2+R^2); %输入给定参数

t=[0:0.01:4];

Is=Ism*cos(w*t+pi/2);

IL=Ism*R/z*cos(w*t+pi/2-h)-Ism*R/z*cos(pi/2-h)*exp(-t*R/L);

IL1=Ism*R/z*cos(w*t+pi/2-h);

IL2=-Ism*R/z*cos(pi/2-h)*exp(-t*R/L);

Ir=R*Ism/z*cos(pi/2-h)*exp(-t*R/L)-w*L*Ism/z*sin(w*t+pi/2-h);

Ir1=R*Ism/z*cos(pi/2-h)*exp(-t*R/L);

Ir2=-w*L*Ism/z*sin(w*t+pi/2-h);

U=Ir*R;U1=Ir1*R;U2=Ir2*R;

figure(1)

subplot(4,1,1);plot(t,IL,t,IL1,t,IL2)

title('IL(t)的波形')

subplot(4,1,2);plot(t,Ir,t,Ir1,t,Ir2)

title('Ir(t)的波形')

subplot(4,1,3);plot(t,U,t,U1,t,U2)

title('U(t)的波形')

subplot(4,1,4);plot(t,Is)

title('Is(t)的波形')

10,正弦激励零状态响应分解

Usm=3;Ism=2;w=pi;R=2;C=0.5;L=0.5;h1=atan(w*R*C);h2=atan(w*L/R); %输入给定参数

z1=sqrt((w*R*C)^2+1);z2=sqrt((w*L)^2+R^2);

t=[0:0.01:4];

Uc=Usm/z1*cos(w*t+pi/2-h1)-Usm/z1*cos(pi/2-h1)*exp(-t/(R*C));

Uc1=-Usm/z1*cos(pi/2-h1)*exp(-t/(R*C));

Uc2=Usm/z1*cos(w*t+pi/2-h1);

IL=Ism*R/z2*cos(w*t+pi/2-h2)-Ism*R/z2*cos(pi/2-h2)*exp(-t*R/L);

IL1=Ism*R/z2*cos(w*t+pi/2-h2);

IL2=-Ism*R/z2*cos(pi/2-h2)*exp(-t*R/L);

figure(1)

subplot(2,1,1);plot(t,Uc,t,Uc1,t,Uc2)

title('Uc(t)的正弦零状态响应=暂态分量+稳态分量')

subplot(2,1,2);plot(t,IL,t,IL1,t,IL2)

title('IL(t)的正弦零状态响应=暂态分量+稳态分量')

11.,RC串联冲激响应

R=2;C=0.5; %输入给定参数

t=[0:0.01:4];

Uc=1/(R*C)*exp(-t/(R*C));

I=-1/(R^2*C)*exp(-t/(R*C));

figure(1)

subplot(2,1,1);plot(t,Uc)

title('Uc(t)的波形')

subplot(2,1,2);plot(t,I)

title('I(t)的波形')

12,RL并联冲激响应

R=2;L=0.5; %输入给定参数

t=[0:0.01:4];

IL=R/L*exp(-t*R/L);

U=-R^2/L*exp(-t*R/L);

figure(1)

subplot(2,1,1);plot(t,IL)

title('IL(t)的波形')

subplot(2,1,2);plot(t,U)

title('U(t)的波形')

 
友情链接
鄂ICP备19019357号-22