solve:
:
solve(expr1, expr2,..., exprN, var1, var2,..., varN)
:
solve var1, , expr1. , expr1=0.
:
- ;
- ;
solve , .
:
x3 - 1=0 (8)
:
>> syms x
>> y=x^3-1;
>> S=solve(y,x)
S =
[ 1]
[ -1/2+1/2*i*3^(1/2)]
[ -1/2-1/2*i*3^(1/2)]
x1, x2, x3, S(1), S(2), S(3) S.
3.4 diff
Matlab , :
- diff(S) S ;
- diff(S, v) S v;
- diff(S, n) diff(S, v, n) n S;
- diff .
:
diff.
:
y6=sin(x+h);
diff(y6)
ans =
cos(x+h)
3.5 dsolve
, . , dsolve ( ).
[-0.5, 7].
% sdif1:
%
x1=dsolve('Dx=-0.5*x','x(0)=10')
ezplot(x1,[-0.5,7]), grid, title('.')
%
[-0.5, 13].
% sdif2:
[x1,x2]=dsolve('Dx1=-.5*x2','Dx2=3*x1','x1(0)=0','x2(0)=1');
ezplot(x1,0,13), grid, hold on, ezplot(x2,[0,13]), title (' 2- ')
3.6 int
int, : int (f), int (f, [u]), int (f, [u, a, b ]),
f - , :
u - ,
- ,
b - .
:
|
|
% :
int(x^2)
ans =
1/3*x^3
:
% :
y7=int(x^2*sin(x),1,2*pi)
vpa(y7,5)
ans =
-39.702
4
4.1
:
-
َ , . - , ( , ).
, . , , , .
, , . .
(9)
, , , .
[6]:
(10)
, , :
, (11)
Matlab () . , . ,
(12)
:
>> n = [2 4]
n =
2 4
>> d = [1 1.5 1.5 1]
d =
1.0000 1.5000 1.5000 1.0000
>> f = tf (n, d)
Transfer function:
2 s + 4
-------------------------
s^3 + 1.5 s^2 + 1.5 s + 1
, :
>> f = tf ([2 4], [1 1.5 1.5 1]);
tf, . .
-
>> f_zpk = zpk(f)
Zero/pole/gain:
2 (s+2)
-----------------------
(s+1) (s^2 + 0.5s + 1)
, . . .
( ) [6]:
(13)
, ( ) . , . , , , . .
|
|
>> f_ss = ss (f)
a =
x1 x2 x3
x1 -1.5 -0.1875 -0.03125
x2 8 0 0
x3 0 4 0
b =
u1
x1 0.5
x2 0
x3 0
c =
x1 x2 x3
y1 0 0.5 0.25
d =
u1
y1 0
,
, , , .
, , , . ,
(14)
, .
, , . , , , ( ).
(static gain, DC-gain). , . .
. (15)
( ) ,
. (16)
.
, , . :
. (17)
:
. (18)
( ), , , , .
. Matlab
.
, , :
, (19)
. (20)
, , . , , , , , .
f Matlab,
>> k = dcgain (f)
( ) (- ) . - [6]:
, . (21)
, , . - . ( 12)
12 - -
, [6]:
. (22)
.
- , , .
( ) ( ) ( ) ( 13) [6]:
. (23)
:
|
|
, . (24)
. ( ) .
13
:
. (25)
, .
(overshoot) (settling time). ( 14)
:
, (26)
, .
, , ( Matlab 2%).
14
() ( ), , , .
. . - ().
() ( 15), () () [6]:
. (27)
, , .
15
, . , ( ) (, ). .
, 0 ( 1, ), .
, -3 ( , 0.708), . :
>> b = bandwidth (f)
, . , , . :
. (28)
. , .
Matlab, . linspace ( ) logspace ( ). :
>> w = linspace (0, 10, 100);
100 0 10,
>> w = logspace (-1, 2, 100);
|
|
100 .
w f( , -) freqresp:
>> r = freqresp(f, w);
freqresp . , ( ), . , .
>> r = r(:);
Matlab
>> plot (w, abs(r));
>> semilogx (w, abs(r));
>> loglog (w, abs(r));
, (), . ( ) :
>> phi = angle(r)*180/pi;
, :
>> semilogx (w, phi);
(, , ) (, , ).
. , : .
. , , .
, . (natural frequency), (damping factor). , . , . , .