Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
МІНІСТЕРСТВО ОСВІТИ І НАУКИ УКРАЇНИ.doc
Скачиваний:
2
Добавлен:
04.11.2018
Размер:
2.01 Mб
Скачать

Program of calculation at matlab environment

Main program (script-file):

% Calculation of the direct current circuit by the Newton method

% with application of discrete current models of nonlinear resistance

% Newt2

% Initial data

global a

R1=2; R2=3; E1=10; E2=5; I0=0.8; N=10;

a=10^(1/3);

% Initial approximation

I(1,1)=I0;

% Iterative process

for k=2:N

U=Uf(I(1,k-1)); % call function, calculating Uf(I) accord to previous % iterative step K-1

G=dIf(U); % call function, calculating dIf(U)(conductance)

% accord to previous iterative step K-1

J=I(1,k-1)-U*G; % equivalent source current according to previous

% iterative step K-1

phi1=(E1/R1+E2/R2-J)/(1/R1+1/R2+G); % potential of the node 1

I(1,k)=J+phi1*G; % current through the nonlinear resistor Rn

I(2,k)=(E1-phi1)/R1; % current through the resistor R1

I(3,k)=(E2-phi1)/R2; % current through the resistor R2

end

% Display of iterative process

p=1:10;

plot (p,I(1,p),p,I(2,p),p,I(3,p));

Subroutine-function (function-file) of calculation Uf(I):

% Calculation the voltage across Rn as current function

function f=Uf(I)

global a

f=a*I^(1/3);

Subroutine-function (function-file) of calculation dI/dU):

% Calculation the derivative I with respect to U

function dI=dIf(U)

dI=0.3*U^2;

Results of calculation

Graphical dependences of calculated currents through the branches of the given circuit (fig. 7.1.) accord to the every iteration step is represented in the figure 7.3.

The schedule of dependences of branches currents from number of iterations shows confident convergence of a method.

Figure 7.3 – Graphical dependences of calculated currents through the branches

Individual tasks

Calculate the current through the branches of the circuit (fig.7.1), if the VACH of nonlinear elements are given accord to table 7.1.

The task for fulfillment

 Study item 7.1.

 Repeat the program adduced in item 7.2 and arrive at result dependence in figure 7.3;

For the given function of VACH of nonlinear resistor Rn and values of parameters of resisters R1 and R2:

 Develop mathematical model of calculation of the currents through the branches of the circuit (fig.7.1);

 Make the program realizing developed algorithm;

 Organize graphical output of the calculated functions of currents accord to the every iteration step as function of step number I(n);

 Debug the program;

 Save the results of the work (the program, listing of calculation, graphics) at your personal file;

  • Draw up report on the laboratory work.

Number

of variant

VACH of nonlinear element Rn

R1,

Ohm

R2,

Ohm

E1,

V

E2,

V

1

I=5.5[lnU-1]

5

5

40

7

2

I= 7[logaU-1]

6

8

15

20

3

I=2[exp(U/2)-1]

7

7.1

5

13

4

I=6.9U3

3

8

8

10

5

I=6.9[exp(U)-1]

2

8.5

13

14

6

I=8U3

8

4.1

5.5

6.6

7

I=0.5U4 sign(U)

7

8

8.9

8.5

8

I=5U2 sign(U)

5

3

20

3.8

9

I=9.3[lnU-1]

9

9.9

13

8.9

10

I=7U3

2

10

6.9

8.3

11

I=0.5U4 sign(U)

5

7.4

3.8

19

12

I=3|U|4/3 sign(U)

1

1.9

7

8.6

13

I=5.2U3

6

25

9

6.8

14

I=6.1U2 sign(U)

7.1

8.8

8.7

4.9

15

I=8|U|4/3 sign(U)

9.7

8.3

4.8

3.9

16

I=3U2 sign(U)

5.9

7.1

20

25

17

I=5Uarctg(U)

3.7

8.2

30

40

18

I=argtg(U/5)

7

9.5

8

71

19

I=0.2arctg(U)

20

1.8

5.9

9

20

I=8.6U2 sign(U)

5.4

7.4

50

28

21

I=3.5[exp(bU)-1]

4.0

8.5

41

52

22

I=2arctg(U)

22

4.8

17

7

23

I= 9.4U2sign(U)

13

5.9

5.9

12

24

I=1.7bU3

3.5

6

8.9

35

25

I=3U3

2.1

8

26

23

26

I=3[logaU-1]

4.8

4

13

9

27

I=3U5

6.1

9

4

10

28

I=2|U| sign(U)

8.2

5

46

13

29

I=6U2sign(U)

5

3.9

11

12

30

I=2.5U3

9

8.2

45

50

Table 7.1