.


:




:

































 

 

 

 


Mat Lab




.

1. :

,

,

n .

2. .

3. .

1. .

2. .

3. fzero.

4. .

5. .

6. .

7. .

1. .

- mat- f1 ()

function f1=fun1(x1); % fun1.m

f1=1.8*x1^4-sin(10*x1);

end;

- mat- ;

function pol_d=p_delen(a,b,E); % p_delen.m

L=b-a; %

while(L>E) % , ...

c=(a+b)/2;

if fun1(c)*fun1(a)>0 %

a=c; % "" "

else %

b=c; % "" "

end; %

L=b-a;

end; % end of while

pol_d=c; %

- mat- ;

function iter=prost_it(a,b,E); % prost_it.m

ic=0; %

while(fun1(a)*fun1(b)<0) % , ,...

if (fun1((a+b)/2)<0) %

a=(a+b)/2; % "" "

else %

b=(a+b)/2; % "" "

end; %

ic=ic+1; %

if (ic>100) % 100

break; %

end; %

if (abs(a-b)<E) %

break; %

end; %

end; % end of while

- iter=a; %

 

- mat- .

function graf=grafi(a,b,n); % grafi.m

dx=(a+b)/n;

for i=1:n %

x(i)=a+(i-1)*dx; %

y(i)=fun1(x(i)); %

i=i+1;

end; %

plot(x,y) %

grid on

- . , . .

- y(x)=f1(x) XY . ()=0. , .

- , fzero.

: x= fzero(fun, x0, options, P1, P2, )

- .

 

% 1 uravnen.m

%

clc

clear

n=30;

a=0.12; % ""

E=10^(-5); %

b=2; % ""

iter1=prost_it(a,b,E); %

pol_d1=p_delen(a,b,E); %

fz=fzero('fun1',[a,b]); % fzero

%

fprintf('\n\t \n\t ')

fprintf('\n\t\t = %f', iter1)

fprintf('\n\t\t = %f',pol_d1)

fprintf('\n\t\t fzero = %f',fz)

%

grafi(a,b,n);

%

Result=strcat('x1=',num2str(iter1),' x2=',num2str(pol_d1),' x3=',num2str(fz));

%

title(Result)

/
1. 3 sin Ö x + 0,35x 3,8 = 0 [ 2; 3] 2,2985 0,0001
2. 0,25x3 + x 1,2502 = 0 [ 0; 2] 1,0001 0,0001
3. [ 0,4; 1] 0,7376 0,0001
4. [ 0; 0,85] 0,2624 0,0001
5. 0,1 x2 x ln x = 0 [ 1; 2] 1,1183 0,0001
6. tg x 1/3 tg3 x + 1/5 tg5 x 1/3 = 0 [ 0; 0,8] 0,3333 0,0001
7. [ 0; 1] 0,5629 0,0001
8. 3 x 4 ln x 5 = 0 [ 2; 4] 3,2300 0,0001
9. cos 2/x 2 sin 1/x + 1/x = 0 [ 1; 2] 1,8756 0,0001
10. [ 0; 1] 0,7672 0,0001
11. ex e-x 2 = 0 [ 0; 1] 0,8814 0,0001
12. sin (ln x) cos (ln x) + 2 ln x = 0 [ 1; 3] 1,3749 0,0001
13. x 2 + sin 1/x = 0 [ 1,2; 2] 1,3077 0,0001
14. ex + ln x 10x = 0 [ 3; 4] 3,5265 0,0001
15. [ 1; 2] 1,0804 0,0001
16. 1 x + sin x ln (1 + x) = 0 [ 0; 1,5] 1,1474 0,0001
17. 3 x 14 + ex e-x = 0 [ 1; 3] 2,0692 0,0001
18. [ 0; 1] 0,5768 0,0001
19. x + cos (x0,52 +2) = 0 [ 0,5; 1] 0,9892 0,0001
20. 3 ln(2 x) +6 ln x 5 = 0 [ 1; 3] 1,8832 0,0001
21. sin x2 + cos x2 - 10 x = 0 [ 0; 1] 0,1010 0,0001
22. x2 ln(1 + x) 3 = 0 [ 2; 3] 2,0267 0,0001
23. 2x sin x cos x = 0 [ 0,4; 1] 0,6533 0,0001
24. [ -1; 0] -0,2877 0,0001
25. ln x x + 1,8 = 0 [ 2; 3] 2,8459 0,0001
26. x tg x 1/3 = 0 [ 0,2; 1] 0,5472 0,0001
27. tg x/2 ctg x/2 + x = 0 [ 1; 2] 1,0769 0,0001
28. 0,4 + arctgÖ x x = 0 [ 1; 2] 1,2388 0,0001
29. [ 0; 1] 0,4538 0,0001
30. 0,6 * 3x 2,3 x 3 = 0 [ 2; 3] 2,4200 0,0001

 


 

6





:


: 2016-10-06; !; : 544 |


:

:

- , - .
==> ...

1712 - | 1641 -


© 2015-2024 lektsii.org - -

: 0.015 .