.


:




:

































 

 

 

 


,




Scilab

Inttrap(x,y),

x , y , x.

, :

x =2:0.01:5.3 y =2*x./(sin(x)+1.5) integral = inttrap(x,y)disp(integral) 30.436962

Integrate(fun, x, a, b,,er1,er2),

fun , x , a, b , er1,er2 ( ).

, :

z=integrate('2*x./(sin(x)+1.5)', 'x', 2, 5.3)disp(z) 30.437056

:

[integral,err]=intg(a, b, name,er1,er2),

a, b , name ( ), er1,er2 ( ). intg (integral) (err).

deff (' = ()', ' ') , deff('y=F(x)', 'y=2*x./(sin(x)+1.5)').

function = (- )

,

endfunction , function y=f(t) y=t^2/sqrt(3+sin(t)) endfunction function y=f(t),y=t^2/sqrt(3+sin(t)),endfunction

.

function y=f(x) y=2*x./(sin(x)+1.5)endfunctionz=intg(2,5.3,f), disp(z)   30.437056

Scilab

Fsolve(x0,f),

x0 , f , f(x)=0.

, :

  deff('y=F(x)', 'y=sin(2*x)-cos(3*x.^2)-sin(3*x)')root=fsolve(7,F)disp(root)   6.9755674

roots(a),

n+1(n ).

n.

.

  v=[3 1 -10 -8]R=roots(v)disp(R)   2. - 1.3333333 - 1.

 

.

v=[3 1 -10 8]R=roots(v)disp(R) - 2.2935835 0.9801251 + 0.4494650i 0.9801251 - 0.4494650i

 

roots , poly :

Poly(a, x, f1),

a , x - , f1 , 'c' 'r' ( roots coeff ).

, ,

p=poly([3 -2 1 0 4],'x','c')disp(p)

 

:

p=poly([-8 -10 1 3],'x','c')R=roots(p)disp(R) 2. - 1.3333333 - 1.

 

Scilab :

- ;

- .

:

AX=B,

, , :

= \ B

, :

X=inv(A)*B

,

:

A=[3 1;-3 5]; B=[-4;36]; X=inv(A)*B, disp(X) X1=A\B, disp(X1) - 3.1111111 5.3333333

 

 

Fsolve(x0,f),

x0 , f ,

, :

function [y]=fun(x) y(1)=2*x(1)+x(2)-6 y(2)=x(1)^2+x(2)^2-14endfunctionX0=[1;1]R=fsolve(X0,fun)disp(R) 1.2338096 3.5323808

 

 

1.

. , intg.

1. X, 2,1 4,3 0.01.

2. Y, .

3. inttrap(X, Y).

4. integrate, .

5. deff function

6. , disp.

X =2.1:0.01:4.3 Y =sin(X)/1.5 integral_1 = inttrap(X,Y)integral_2=integrate('sin(x)/1.5', 'x', 2.1, 4.3)disp(integral_1)disp(integral_2)   - 0.0693640 - 0.0693646
deff('y=F(x)','y=sin(x)/1.5'); integral_3=intg(2.1,4.3,F)function y= f (x) y=sin(x)/1.5endfunctionintegral_4=intg(2.1,4.3, f)disp(integral_3)disp(integral_4) - 0.0693646 - 0.0693646

3.4.

 

3.4

     
     
     
     
     

2. ,

. . .

1. deff function

2. fsolve, .

3. , disp.

4. . , . plot. y=0 , , , .

deff('y=F(x)', 'y=sin(x)-cos(x.^2)-sin(2*x)')root=fsolve(1,F)disp(root)x=0.5:0.01:2.5 plot (x,F(x),'-b',root,F(root),'xr',x,0,'-k')   1.1695683

3.5

 

3.5

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.

 

3. ,

. . .

1. ( poly)

2. roots.

3. , disp.

4. . , . plot. y=0 , , , .

v=[2 0 4 -6 -3]R=roots(v)disp(R)root=R(3)x=0.5:0.01:2y=2*x.^4+4*x.^2-6*x-3F_root=2*root^4+4*root^2-6*root-3plot(x,y,'-b',root,F_root,'xr',x,0,'-k')   - 0.4129576 + 1.7282075i - 0.4129576 - 1.7282075i 1.2164706 - 0.3905555

3.6.

 

3.6

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.

 

4.

. .

1.

2. .

3. , , ( ).

4. , disp.

 

A=[3 1 1;-3 5 6;1 -4 -2]; B=[-4;36;-19]; X=inv(A)*B disp(X) - 3. 3. 2.  

3.7.

 

 

3.7

1. 2.
3. 4.
5. 6.
7. 8.
9. 10.
11. 12.
13. 14.
15. 16.

 





:


: 2017-02-28; !; : 1140 |


:

:

.
==> ...

1275 - | 1260 -


© 2015-2024 lektsii.org - -

: 0.049 .