- •Contents
- •1 LAboratory work # 1
- •Mathematical model
- •Stages of a program elaboration
- •Call Desktop matlab
- •Script-files and Function-files
- •Enter of input data by awarding method. Comments
- •Organization of enter of the input data by a dialogue mode
- •Creation of Function-file
- •Graphical output
- •2 LAboratory work # 2
- •Debugging and verification of programs
- •Search of syntactic mistakes
- •Debugging with the help of Editor/Debugger
- •Verification of results of calculation
- •3 LAboratory work # 3
- •The task for fulfillment
- •Individual tasks
- •4 LAboratory work # 4
- •Mathematical model
- •The block-diagram of algorithm of calculation according to mathematical model
- •The task for fulfillment
- •5 LAboratory work # 5
- •The task for fulfillment
- •Individual tasks
- •6 LAboratory work # 6
- •Mathematical model
- •Determination of zero approximation
- •Program of calculation in matlab environment
- •Results of calculation
- •Individual tasks
- •The task for fulfillment
- •7 LAboratory work # 7
- •Mathematical model
- •Program of calculation at matlab environment
- •Results of calculation
- •Individual tasks
- •The task for fulfillment
- •8 LAboratory work # 8
- •Mathematical model
- •Results of calculation
- •Improvement of convergence of the Newton method
- •The task for fulfillment
- •9 LAboratory work # 9
- •Mathematical model
- •The program of calculation in matlab environment
- •Results of calculation
- •The task for fulfillment
- •10 LAboratory work # 10
- •The task for fulfillment
- •Individual tasks
- •LIst of literature
Determination of zero approximation
Let zero approximation of the current through the circuit is I0=0, then at the first iteration step difference between initial and following approximation will be:
I1 - I0= f (I0)/ f'(I0)= -10/∞ =0,
i.e, accord to given approximation process is been divergent.
Let zero approximation I0=1, then:
I1 - I0= f (I0)/ f'(I0)= -7.91/1.03=-7.68.
Hence, I0=1 could be taken as a zero approximation
Program of calculation in matlab environment
Main program (script-file):
% Caculation of the simple circuit by the Newton method
% Newt1
% Initial data
E=10; R=0.5; a=4^(1/3);
% Number of iterations
N=20;
% Initial approach
k=1;
I(k)=1;
% Iterative process
for k=2:N
fk_1=fun1(I(k-1),R,a,E); % call of f(i)
dfdIk=dfdI(I(k-1),R,a); % call of f'(i)
I(k)=I(k-1)-0.5*fk_1/dfdIk; % calculation of the next approach
end
% display of iterative process
plot(I);
Subroutine-function (function-file) of calculation f(i):
% calculation of f(i)
function f=fun1(I,R,a,E)
f=R*I+a*I^0.333-E;
Subroutine-function (function-file) of calculation f’(i):
% calculation of f'(i)
function der1=dfdI(I,R,a)
der1=R+a/(3*I^(2/3));
Results of calculation
In the figure 6.2 graphical dependence of calculated current through the given circuit (fig. 6.1.) accord to the every iteration step is represented.
The above represented curve I(n) demonstrates that practically it is enough of 12 iteration steps for satisfactory accuracy of solution.
Figure 6.2 – Graphical dependence I(n)
Individual tasks
Calculate the current through the circuit (fig.6.1), if the VACH of nonlinear element is given accord to table 6.1.
The task for fulfillment
· Study items 6.1 – 6.3.
· Repeat the program adduced in item 6.4. and arrive at result dependence I(n) (fig.6.2);
For the given function of VACH of nonlinear resistor Rn:
· Develop mathematical model of calculation of the current through the circuit (fig.6.1);
· Make the program realizing developed algorithm;
· Organize graphical output of the calculated function of current 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.
Table 6.1
# of variant |
VACH of nonlinear element Rn
|
# of variant
|
VACH of nonlinear element Rn
|
1 |
I=2.5U3 |
16 |
I=3U2 sign(U) |
2 |
I=6U2sign(U) |
17 |
I=0.5U4 sign(U) |
3 |
I=2Ö|U| sign(U) |
18 |
I=5Uarctg(U) |
4 |
I=3U5 |
19 |
I=0.2arctg(U) |
5 |
I=3[logaU-1] |
20 |
I=8.6U2 sign(U) |
6 |
I=3U3 |
21 |
I=3.5[exp(bU)-1] |
7 |
I=argtg(U/5) |
22 |
I=2arctg(U) |
8 |
I=5U2 sign(U) |
23 |
I= 9.4U2sign(U) |
9 |
I=8|U|4/3 sign(U) |
24 |
I=1.7U3 |
10 |
I=7U3 |
25 |
I=8U3 |
11 |
I=6.1U2 sign(U) |
26 |
I=6.9[exp(U)-1] |
12 |
I=5.2U3 |
27 |
I=6.9U3 |
13 |
I=9.3[lnU-1] |
28 |
I=2[exp(U/2)-1] |
14 |
I=0.5U4 sign(U) |
29 |
I= 7[logaU-1] |
15 |
I=8|U|3/2 sign(U) |
30 |
I=5.5[lnU-1] |