, ...
This presentation is the property of its rightful owner.
Sponsored Links
1 / 114

Интерактивна система за технически изчисления, визуализиране и програмиране ( MATLAB ) Приложение PowerPoint PPT Presentation


  • 153 Views
  • Uploaded on
  • Presentation posted in: General

Интерактивна система за технически изчисления, визуализиране и програмиране ( MATLAB ) Приложение математически изчисления; разработка на алгоритми; моделиране, симулиране и създаване на прототипи; представяне, визуализиране и анализ на данни; графика;

Download Presentation

Интерактивна система за технически изчисления, визуализиране и програмиране ( MATLAB ) Приложение

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Matlab

  • , (MATLAB)

  • ;

  • ;

  • ,

    ;

  • , ;

  • ;

  • .

  • (toolboxes) , , , .


Matlab

  • MATLAB

  • MATLAB ;

    • : , , ,

    • /, -

    • ;

  • MATLAB , ; -, MATLAB .

  • , , ; .


Matlab

  • , , , , , .

  • , C, C++, Java Fortran MATLAB.


Matlab

MATLAB

StartPrograms MATLAB 6.5


Matlab

-

,


Matlab

MATLAB

;

ans

=

fun()

...


Matlab

2+3

ans =

5

x=sin(0.5)

x =

0.4794

V=[1 2 3 4];

sin(V)

ans =

0.8415 0.9093 0.1411 -0.7568

exp(V)

ans =

2.7183 7.3891 20.0855 54.5982

magic(3)

ans =

8 1 6

3 5 7

4 9 2

MAGIC(N) NxN 1N2 , , N>0 N=2.


Matlab

15 a ( )

.

.

.

1x1 .


Matlab


Matlab

A=[7 2;4 3];

B=[1 4;6 7];

A+B

ans =

8 6

10 10

A*B

ans =

19 42

22 37

%

A.*B

ans =

7 8

24 21

A.^B

ans =

7 16

4096 2187

%

A\B

ans =

-0.6923 -0.1538

2.9231 2.5385

inv(A)*B

ans =

-0.6923 -0.1538

2.9231 2.5385

%

B/A

ans =

-1.0000 2.0000

-0.7692 2.8462

B*inv(A)

ans =

-1.0000 2.0000

-0.7692 2.8462

inv(A) .


Matlab

:==B --, A B , A B .

A=[1 2 3;4 5 6;7 8 9];

B=[1 5 10;2 5 8;4 7 9];

A==B

ans =

1 0 0

0 1 0

0 0 1


Matlab

  • 3.1.

  • =[0 1 1 0 1];

  • B=[1 1 0 0 1];


Matlab

3.2.

=28;% 11100

B=21;% 10101


Matlab

3.3. ( )

=28;

B=-21;


Matlab

; , .

  • ;

  • , , (_), MATLAB 31 ;

  • .

  • A=10% 1x1 10

  • =

  • 10


Matlab

  • (16 , 10-308 10+308).

    :

  • ;

  • , 10 ;

  • ij.

    10 -430.001

    3.4632987 1.63-201.43i


Matlab

  • ()

  • m=abs(z) () z

  • theta=angle(z) z

  • z=3+j*4;

  • % z

  • A=abs(z)

  • A =

  • 5

  • theta=angle(z)

  • theta =

  • 0.9273

  • % z=x+jy

  • z=A*exp(j*theta)

  • z =

  • 3.0000 + 4.0000i


Matlab

  • , .

  • %.

  • A=[ ;]% 2x7

  • =

  • ;

  • ;

  • .


Matlab

4.1. :

a:b -,

a b 1.

a:c:b -,

a b c.

1:10% 1

ans =

1 2 3 4 5 6 7 8 9 10

100:-10:50% -10

ans =

100 90 80 70 60 50


Matlab

  • bs

  • sqrt

  • xp

  • sin

  • clear

  • clear all ,

  • ,

  • close

  • close all

  • help

  • format

  • :

  • pi3.1459265

  • i -1

  • j -1

  • help elfun%

  • help specfun%

  • help elmat%


Matlab

format short% 5

format long% 15

format hex%

format rat%


Matlab

:

s=(1+sqrt(10))/2

s =

2.0811

n=1:5% : -> -

n =

1 2 3 4 5

n=n'% ' () -> -

n =

1

2

3

4

5

x=n.^2% .^ ( )

x =

1

4

9

16

25


Matlab


Matlab

___

r- +

b-- o

g-. *

w. .

k: x

c none

m

y


Matlab

: .

t=0:pi/100:2*pi;

y=sin(t);

plot(t,y)

polar(t,y)


Matlab

: .

t=-pi:pi/100:pi;

y=sin(t);

plot(t,y);

axis([-pi pi -1 1]);

xlabel('-\pi \leq \itt \leq \pi');

ylabel('\itsin(t)');

title(' ');

grid on

\pi

\leq

\it


Matlab

:

.

x=0.1:0.1:100;

loglog(x,exp(x)),grid on

:

.

x = 0:.1:10;

semilogy(x,10.^x)


Matlab

y1=sin(t);

y2=cos(t);

subplot(211),plot(t,y1)

subplot(212),plot(t,y2)

subplot(111)


Matlab

plot(t,y1,t,y2)


Matlab

t = 0:pi/100:10*pi;

y1=sin(t);

y2=cos(t);

plot3(y1,y2,t);

grid on;


Matlab

: y[x].

x=1:5;

y=[1 2 3 4 5];

stem(x,y)

stem(x,y,'filled')

stem(x,y,'--')


Matlab

:

x[n], :

x[0]=1, x[1]=2, x[2]=1, x[3]=0, x[4]=-1, x[n]=0

n. n

-2 6s

1s.

n=-2:6;

x=[0 0 1 2 1 0 -1 0 0];

stem(n,x,'filled')

xlabel('n')

ylabel('x[n]')


Matlab

:

,

.

,

n=...,-2,-1,0,1,2,...,

. =1s, n[0,30] x[-1,1].

n=0:30;

t=0:30;

x=exp(-0.1*t).*sin(2/3*t);

axis([0 30 -1 1])

stem(n,x,'filled')

xlabel('n')

ylabel('x[n]')


Matlab

  • :

    • : 1=/3 2=1,

  • =0, =1. n[-10,30] x[-1.5,1.5];

  • .

  • n=-10:30;

  • OMEGA1=pi/3;

  • OMEGA2=1;

  • x1=cos(OMEGA1*n);

  • x2=cos(OMEGA2*n);

  • subplot(211),stem(n,x1,'filled')

  • xlabel('n')

  • ylabel('x[n]')

  • axis([-10 30 -1.5 1.5])

  • subplot(212),stem(n,x2,'filled')

  • xlabel('n')

  • ylabel('x[n]')

  • axis([-10 30 -1.5 1.5])

  • subplot(111)


Matlab

  • .

  • 1x1 .

  • .

  • .

  • =[16 3 2 13;5 10 11 8;9 6 7 12;4 15 14 1]

  • A =

  • 16 3 2 13

  • 5 10 11 8

  • 9 6 7 12

  • 4 15 14 1


Matlab

  • .

  • A =

  • 16 3 2 13

  • 5 10 11 8

  • 9 6 7 12

  • 4 15 14 1

  • - ans.

  • sum()

  • ans =

  • 34 34 34 34


Matlab

  • -.

  • :

  • ( );

  • ;

  • .

  • ans =

  • 16 5 9 4

  • 3 10 6 15

  • 2 11 7 14

  • 13 8 12 1

  • sum()

  • ans =

  • 34

  • 34

  • 34

  • 34


Matlab

  • .

  • diag()

  • ans =

  • 16

  • 10

  • 7

  • 1

  • sum(diag())

  • ans =

  • 34

  • .

  • sum(diag(fliplr()))

  • ans =

  • 34

  • fliplr .


Matlab

  • i j A(i,j).

  • )

  • (4,2)

  • ans =

  • 15

  • ) 4-

  • (1,4)+A(2,4)+A(3,4)+A(4,4)

  • ans =

  • 34

  • ) -; . A(4,2):

  • (8)

  • ans =

  • 15


Matlab

  • :

  • sum(A(1:4,4))% 4-

  • ans =

  • 34

  • sum(A(:,end))%

  • ans =

  • 34


Matlab

  • inv

  • A=pascal(3)

  • A =

  • 1 1 1

  • 1 2 3

  • 1 3 6

  • inv(A)

  • ans =

  • 3 -3 1

  • -3 5 -2

  • 1 -2 1


Matlab

  • zeros 0;

  • ones 1;

  • rand ;

  • randn ;

  • magic N NxN

  • 1

  • N2 ,

  • ,

  • , N(N2+1)/2;

  • pascal N:

  • ,

  • (

  • 1,

  • ).


Matlab

o=ones(2,4)

o =

1 1 1 1

1 1 1 1

A=magic(3)

A =

8 1 6

3 5 7

4 9 2

A=pascal(3)

A =

1 1 1

1 2 3

1 3 6


Matlab

  • []

  • A=magic(3)

  • A =

  • 8 1 6

  • 3 5 7

  • 4 9 2

  • B=[A A+5;A+10 A+20]

  • B =

  • 8 1 6 13 6 11

  • 3 5 7 8 10 12

  • 4 9 2 9 14 7

  • 18 11 16 28 21 26

  • 13 15 17 23 25 27

  • 14 19 12 24 29 22


Matlab

  • []

  • A=magic(3)

  • A =

  • 8 1 6

  • 3 5 7

  • 4 9 2

  • A(2,:)=[]%

  • A =

  • 8 1 6

  • 4 9 2

  • A(:,2)=[]%

  • A =

  • 8 6

  • 4 2


Matlab

  • n=(0:9)';% -

  • pows = [n n.^2]% 2

  • pows =

  • 0 0

  • 1 1

  • 2 4

  • 3 9

  • 4 16

  • 5 25

  • 6 36

  • 7 49

  • 8 64

  • 9 81


Matlab

  • /

  • input;

  • A=[1 2 3 4 5];

  • A(6)=input('Enter A[6]=')

  • Enter A[6]=6

  • A =

  • 1 2 3 4 5 6

  • name=input('Ime=','s')

  • Ime=Ivan

  • name =

  • Ivan


Matlab

  • disp;

  • disp(A(6))

  • 6

  • disp(name)

  • Ivan


Matlab

  • , , .

  • .

[Y][U]=[I][Y] ,

[U]=[Y]-1[I][U] , [I]

U=Y\I % U=inv(Y)*I

[Z][I]=[U][Z]

[I]=[Z]-1[U]

I=Z\U % I=inv(Z)*U


Matlab

: RB .

Z

I

U


Matlab

% ZI=U

% Z

Z=[40 -10 -30;-10 30 -5;-30 -5 65];

% U

U = [10;0;0];

% I

I=Z\U % I=inv(Z)*U

IRB=I(3)-I(2)% RB

P=I(1)*10%

I =

0.4753

0.1975

0.2346

IRB =

0.0370

P =

4.7531


Matlab

  • MATLAB

  • :

  • .mat , .

  • .mat

  • save

  • .mat

  • load


Matlab

  • .m , .

  • - MATLAB:

    • ;

    • ;

  • - :

    • m- ;

    • , .


Matlab

  • .m

    • FileNew M-file

  • .m

    • FileSave As

  • .m

  • FileSet Path


Matlab

:

- my.m

FileNew M-file

A=[

16.0 3.0 2.0 13.0

5.0 10.0 11.0 8.0

9.0 6.0 7.0 12.0

4.0 15.0 14.0 1.0];

FileSave As my

MATLAB , .

  • .m

  • my

  • A

  • A =

  • 16 3 2 13

  • 5 10 11 8

  • 9 6 7 12

  • 4 15 14 1

my my.m ,

.


Matlab

:

- my.m

FileNew M-file

function y=my()

y=[...

16.0 3.0 2.0 13.0

5.0 10.0 11.0 8.0

9.0 6.0 7.0 12.0

4.0 15.0 14.0 1.0];

FileSave As my

FileCompile

my, .

.m

A=my

A =

16 3 2 13

5 10 11 8

9 6 7 12

4 15 14 1

my , .


Matlab

  • global X

  • X ;

    • X global, X;

    • .


Matlab

:

.

- vcos.m:

function u = vcos(t)

global FI%

uA=0.33E-3;% =0.33mV

f=50;% =50HzFigure No. 1

u=uA*cos(2*pi*f*t+FI);

figure(1);

t=0:0.001:0.2;

global FI

FI=0;

u=vcos(t);

plot(t,u);

hold on;

FI=45;

u=vcos(t);

plot(t,u);


Matlab

  • if

    • if

    • elseif

    • else

    • end

  • switch

    • switchswitch_

    • casecase_,

    • ,,

    • case {case_,...,case_}

    • ,,

    • ...

    • otherwise

    • ,,

    • end


Matlab

3. for

for=::,

end

4. while

while

end

5. break

while for.


Matlab

for k=1:10,

x(k)=cos(k);

nd

x

x =

0.5403 -0.4161 -0.9900 -0.6536 0.2837 0.9602 0.7539 -0.1455 -0.9111 -0.8391

k=1:10;

x=cos(k);

x

a=2;

b=5;

if(a>b) c=a;

else c=b;

end

c

c =

5


Matlab

: 3- /D

x y

:

- AD3.m:

function y=AD3(x)

if x<-2.5y=0;

elseif x<-1.5y=1;

elseif x<-0.5y=2;

elseif x<0.5y=3;

elseif x<1.5y=4;

elseif x<2.5y=5;

elseif x<3.5y=6;

else

y=7;

end

y1=AD3(-1.25)

y1 =

2

y2=AD3(2.57)

y2 =

6

y3=AD3(6.0)

y3 =

7


Matlab

. .


Matlab


Matlab


Matlab

I.

n- n , , :

ode45, ode23, ode113, ode15s, ode23s, ode23t, ode23tb y'=f(t,y);

ode15s, ode23s, ode23t ode23tb my'=f(t,y), ode23s m(t)y'=f(t,y).


Matlab

[t,y]=ode_function('f',tspan,yo)

[t,y]=ode_function('f',tspan,yo,options)

[t,y]=ode_function('f',tspan,yo,options,p1,p2,...)

f .m , f(t,y) -;

:

function dydt = f(t,y)

t , dydty -.

tspan , [t0 tfinal];

yo , ;

options , odeset;

p1,p2,... , f;

[t,y] .


Matlab

:

:

1 :

:


Matlab

-vdp.m:

function dy=vdp(t,y) % u=1

dy=zeros(2,1);

dy(1)=y(2);

dy(2)=(1-y(1)^2)*y(2)-y(1);

% t=0 20s

t0=0; tfinal=20;

y0=[2; 0];%

[t,y]=ode45('vdp',[t0 tfinal],y0);

plot(t,y(:,1),'b',t,y(:,2),'r')

-vdp.m:

function dy=vdp(t,y,options,u)

dy=zeros(2,1);

dy(1)=y(2);

dy(2)=u*(1-y(1)^2)*y(2)-y(1);

% t=0 20s

t0=0; tfinal=20;

y0=[2; 0];%

[t,y]=ode45('vdp',[t0 tfinal],y0,[],5);

plot(t,y(:,1),'b',t,y(:,2),'r')


Matlab

  • RC

  • )

  • ,

  • :


Matlab

)

, .. ,

:


Matlab

: t=0 RC

.

,

R=10, C=10F

I=1A.


Matlab

  • -

  • RC1diff.m

  • function duc=RC1diff(t,uc,options,I,R,C)

  • tau=R*C;

  • duc(1)=-uc(1)/tau+I/C;

  • RC1.m

  • function u=RC1(R,C,I,t)

  • tau=R*C;

  • u=I*R*(1-exp(-t/tau))


Matlab

% RC

t0=0;%

tfinal=0.003;%

uc0=0;% uc(t=0)=0

I=1;C=10e-6;R=10;

[t1,uc1]=ode45('RC1diff',[t0 tfinal],[uc0],[],I,R,C);%

u1=RC1(R,C,I,t1);%

% uc=f(t)

subplot(121),plot(t1,uc1)

axis([0 0.003 0 12])

xlabel('t[s]'),ylabel('uC[V]')

subplot(122),plot(t1,u1)

axis([0 0.003 0 12])

xlabel('t[s]'),ylabel('uC[V]')


Matlab

: RC

5V

0.5s.

R=2.5

R=10, C=10F.

.


Matlab

  • -

  • RCDdiff.m

  • function duc=RCDdiff(t,uc,options,Um,R,C)

  • tau=R*C;

  • duc(1)=-uc(1)/tau;

  • RCD.m

  • function u=RCD(R,C,Um,t)

  • tau=R*C;

  • u=Um*exp(-t/tau)

  • RCdiff.m

  • function duc=RCdiff(t,uc,options,E,R,C)

  • tau=R*C;

  • duc(1)=-uc(1)/tau+E/tau;

  • RC.m

  • function u=RC(R,C,E,t)

  • tau=R*C;

  • u=E*(1-exp(-t/tau))


Matlab

% RC

t0=0;%

tfinal=0.5;%

uc0=0;% uc(t=0)=0

E=5;%

C=10e-6;

R=2.5e3;

%

[t11,uc11]=ode45('RCdiff',[t0 tfinal],[uc0],[],E,R,C);% C

Um=uc11(end);%

[t12,uc12]=ode45('RCDdiff',[t0 tfinal],[Um],[],Um,R,C);% C

%

u11=RC(R,C,E,t11);% C

Um=u11(end);%

u12=RCD(R,C,Um,t12);% C


Matlab

R=10e3;

%

[t21,uc21]=ode45('RCdiff',[t0 tfinal],[uc0],[],E,R,C);% C

Um=uc21(end);%

[t22,uc22]=ode45('RCDdiff',[t0 tfinal],[Um],[],Um,R,C);% C

%

u21=RC(R,C,E,t21);% C

Um=u21(end);%

u22=RCD(R,C,Um,t22);% C

% uc=f(t)

subplot(211),plot(t11,uc11,'b',t12+0.5,uc12,'b',t21,uc21,'r',t22+0.5,uc22,'r')

axis([0 1 0 6]),xlabel('t[s]'),ylabel('uC[V]')

text(0.4, 2.0, 'R=2.5K'),text(0.6, 2.0, 'R=10K')

% uc=f(t)

subplot(212),plot(t11,u11,'b',t12+0.5,u12,'b',t21,u21,'r',t22+0.5,u22,'r')

axis([0 1 0 6]),xlabel('t[s]'),ylabel('uC[V]')

text(0.4, 2.0, 'R=2.5K'),text(0.6, 2.0, 'R=10K')


Matlab

  • RL

  • )

  • ,

  • :


Matlab

)

0,

, :


Matlab

: 0.

t=0 1,

1s. 1s

1 2,

.

E=40V.

: R1=50, R2=50,

R3=150, L=200H.

.


Matlab

-

1.

RLDdiff.m

function diL=RLDdiff(t,iL,options,Im,R,L)

tau=L/R;

diL(1)=-iL(1)/tau;

RLD.m

functioni=RLD(R,L,Im,t)

tau=L/R;

i=Im*exp(-t/tau)

2.

RLdiff.m

function diL=RLdiff(t,iL,options,E,R,L)

tau=L/R;

diL(1)=-iL(1)/tau+E/L;

RL.m

function i=RL(R,L,E,t)

tau=L/R;

i=E/R*(1-exp(-t/tau))


Matlab

% RL

R1=50;R2=50;R3=150;L=200;E=40;

R=R1+R2;% 1 L

t0=0;%

tfinal=1;%

iL0=0;% iL(t=0)=0

[t1,iL1]=ode45('RLdiff',[t0 tfinal],[iL0],[],E,R,L);%

i1=RL(R,L,E,t1);%

R=R2+R3;% 2 L

t0=0;%

tfinal=5;%

Im=iL1(end);%

[t2,iL2]=ode45('RLDdiff',[t0 tfinal],[Im],[],Im,R,L);%

Im=i1(end);%

i2=RLD(R,L,Im,t2);%

% iL=f(t)

subplot(121),plot(t1,iL1,'r',t2+1,iL2,'r')

axis([0 6 0 0.18]),xlabel('t[s]'),ylabel('i[A]'),title('RL')

% iL=f(t)

subplot(122),plot(t1,i1,'b',t2+1,i2,'b')

axis([0 6 0 0.18]),xlabel('t[s]'),ylabel('i[A]'),title('RL')


Matlab

  • RLC


Matlab

: t=0 RLC

.

, R=10, L=10mH, C=100F

U=50V.


Matlab

- RLC.m RLC

function dy=RLC(t,y,options,u,R,L,C)

dy=zeros(2,1);

a=1/L;b=R/L;c=1/C;

dy(1)=a*u-b*y(1)-a*y(2);

dy(2)=c*y(1);

% RLC

U=50;R=10;L=10e-3;C=100e-6;

t0=0;%

tfinal=30e-3;%

iL0=0;% iL(t=0)=0

uC0=0;% uC(t=0)=0

[t,x]=ode45('RLC',[t0 tfinal],[iL0 uC0],[],U,R,L,C);%

plot(t,x(:,1),'b',t,x(:,2),'r')

axis([0 30e-3 -10 60]),xlabel('t[s]')

text(0.015, 2, 'iL(t)'),text(0.015, 52, 'uC(t)')


Matlab

II.

f(x), [a,b], .. :

quad('f',a,b) f(x) a b 1-3, Simpson;

'f' , ;

, ;

q=inf, .


Matlab

quad('f',a,b,tol) , tol; tol=[_, ].

quad('f',a,b,tol,trace) tol trace , .

quad('f',a,b,tol,trace,p1,p2,...) p1,p2,... f(x,p1,p2,...); tol trace, [ ].

quad f(x,p1,p2,...) , .. ; f .m , .


Matlab

  • .

q=quad('sin',0,pi,[],1)

q =

2.0000


Matlab

  • .

  • q=quad('sin',0,2*pi,[],1)

  • q =

  • 0


Matlab

-p.m:

function y=p(x)

y=4./(1.+x.^2);

q=quad('p',0,1);

q

q =

3.1416


Matlab

  • r=roots(p)

  • p-,

  • r -, p

  • :

  • p=[1 -6 -72 -27];

  • r=roots(p)

  • r =

  • 12.1229

  • -5.7345

  • -0.3884


Matlab

  • p=poly(r)

  • r-,

  • p -,

  • : 12.1229, -5.7345

  • -0.3884

  • r=[12.1229 -5.7345 -0.3884]';

  • p=poly(r)

  • p =

  • 1.0000 -6.0000 -72.0000 -27.0011


Matlab

  • y=polyval(p,s)

  • p - n+1,

  • s -, ,

  • y -,

  • : s=1, 2 3

  • p=[1 -6 -72 -27];

  • s=[1 2 3];

  • y=polyval(p,s)

  • y =

  • -104 -187 -270


Matlab

  • p=polyfit(x,y,n)

  • x,y ,

  • n

  • p - n+1, , p(x(i)) y(i)


Matlab

: 6

t=0:0.1:2.5;

i=[0 0.1125 0.2227 0.3286 0.4284 0.5205 0.6039 ...

0.6778 0.7421 0.7969 0.8427 0.8802 0.9103 0.9340 ...

0.9523 0.9661 0.9763 0.9838 0.9891 0.9928 0.9953 ...

0.9970 0.9981 0.9989 0.9993 0.9996];

p=polyfit(t,i,6)

plot(t,i,'ro',t,polyval(p,t))

:

p =

0.0084 -0.0985 0.4222 -0.7440 0.1475 1.1064 0.0005


Matlab

  • T:

Z -


Matlab

:

:


Matlab

: , , ( ), .

-

voltage.m

function u2=voltage(t)

u2=(10*cos(120*pi*t+60*pi/180)).^2;

current.m

function i2=current(t)

i2=(6*cos(120*pi*t+30*pi/180)).^2;

power_average.m

function p=power_average(t)

i=6*cos(120*pi*t+30.0*pi/180);

u=10*cos(120*pi*t+60.0*pi/180);

p=i.*u;


Matlab

w=120*pi;%

T=2*pi/w;%

%

a=0; %

b=T; %

u=quad('voltage',a,b);

Ueff=sqrt(u/T);

i=quad('current',a,b);

Ieff=sqrt(i/T);

p=quad('power_average',a,b);

P=p/T;

pf=P/(Ueff*Ieff);

%

Ueffa=10/sqrt(2);

Ieffa=6/sqrt(2);

Pa=Ueffa*Ieffa*cos(30*pi/180);

pfa=cos(30*pi/180);

%

disp('Ueff'),disp(Ueff),disp(Ueffa);

disp('Ieff'),disp(Ieff), disp(Ieffa);

disp('P'), disp(P),disp(Pa);

disp('pf'),disp(pf),disp(pfa);

:

Ueff

7.0711

7.0711

Ieff

4.2426

4.2426

P

25.9808

25.9808

pf

0.8660

0.8660


Matlab

  • , ,

  • .

  • ,


Matlab


Matlab

[r,p,k]=residue(num,den)

num-,

-

den -,

-

r-,

numden

p-,

k-,


Matlab

: RLC :

  • ;

  • ;

  • , .

=>


Matlab

R=10;L=10e-3;C=100e-6;

%

num=[R/L 0];

den=[1 R/L 1/(L*C)];

z=roots(num);%

p=roots(den);%

disp('z'),disp(z);%

disp('p'),disp(p);

[r,p,k]=residue(num,den);% disp('r'),disp(r);%

disp('p'),disp(p);

disp('k'),disp(k);

%

s=-3+j*2;%

n=polyval(num,s);

d=polyval(den,s);

%

Uout=10*exp(j*40*pi/180)*n/d;%

Um=abs(Uout);%

fi=angle(Uout)*180/pi;%

disp('Um'), disp(Um);

disp('fi'),disp(fi);


Matlab

:

z

0

p

1.0e+002 *

-5.0000 + 8.6603i

-5.0000 - 8.6603i

r

1.0e+002 *

5.0000 + 2.8868i

5.0000 - 2.8868i

p

1.0e+002 *

-5.0000 + 8.6603i

-5.0000 - 8.6603i

k

Um

0.0362

fi

-173.8043


Matlab

  • -

  • -

: RLC -

-

: R=10

R=0.5.


Matlab

- transfer.m

function h=transfer(w,R,L,C)

h=(j*w*(R/L))./((j*w).^2+j*w*(R/L)+1/(R*C));

L=10e-3;C=100e-6;

w=[0.1:0.1:10^4];

R=10;

H1=transfer(w,R,L,C);

R=0.5;

H2=transfer(w,R,L,C);

f=w/(2*pi);

% - RLC

subplot(221),loglog(f,abs(H1),'b'),grid on,ylabel('|H(j\omega)'),xlabel('f[Hz]');

subplot(222),loglog(f,abs(H2),'r'),grid on,ylabel('|H(j\omega)'),xlabel('f[Hz]');

% - RLC

subplot(223),semilogx(f,angle(H1)*180/pi,'b'),grid on;

ylabel('\angleH(j\omega)(\circ)'),xlabel('f[Hz]');

subplot(224),semilogx(f,angle(H2)*180/pi,'r'),grid on;

ylabel('\angleH(j\omega)(\circ)'),xlabel('f[Hz]'); ,


Matlab

R 10 0.5 - .


  • Login