Professional Documents
Culture Documents
a=
-6 -11
-6
>> A=a
A=
-6 -11
-6
>> eig(A)
ans =
-1.0000
-2.0000
-3.0000
X=
-1
-2
-3
>> Xi=inv(X)
Xi =
5.0000
2.0000
>> Xi*AX
Undefined function or variable 'AX'.
>> Xi*A*X
ans =
3.0000
X=
-1
-2
-3
>> Xi=inv(X)
Xi =
3.0000
2.5000
0.5000
1.5000
0.5000
>> Xi*A*X
ans =
-1.0000
0.0000 -0.0000
0.0000 -2.0000
0.0000
>> syms t
>> phid=[exp(-t) 0 0;0 exp(-2t) 0;0 0 exp(-3t)]
phid=[exp(-t) 0 0;0 exp(-2t) 0;0 0 exp(-3t)]
|
Error: Unexpected MATLAB expression.
phid =
[ exp(-t),
0,
0, exp(-2*t),
0,
0]
0]
0, exp(-3*t)]
>> Phi=X*phid*Xi
Phi =
>> pretty(phi)
Undefined function or variable 'phi'.
+-
-+
#4
exp(-t)
exp(-3 t) |
#1 - #3 + --,
------- - exp(-2
|
|
#2
|
6 exp(-2 t) - 3 exp(-t) - #4,
------- - -- |
|
exp(-t) #4
8 exp(-2 t) - #1 - --,
2
2 exp(-2 t) 2
|
|
27 exp(-3 t)
exp(-t)
#2
|
|
3 exp(-t) - 12 exp(-2 t) + #2,
#3 + -|
|
#1 - 16 exp(-2 t) + ------------,
2
+-
------- |
-+
where
5 exp(-t)
#1 == --------2
#2 == 9 exp(-3 t)
#3 == 4 exp(-2 t)
#4 == 3 exp(-3 t)
>> A=[0 1;-2 -3]
A=
-2
-3
X=
-1
-2
>> Xi=inv(X)
Xi =
-1
-1
>> Ad=Xi*AX
Undefined function or variable 'AX'.
>> Ad=Xi*A*X
Ad =
-1
-2
|
Error: Unexpected MATLAB operator.
phid =
[ exp(-t),
[
0]
0, exp(exp(-2*t))]
>> Phi=X*phid*Xi
Phi =
>> pretty(Phi)
+-
-+
-+
>> X
X=
-1
-2
>> Xi
Xi =
-1
-1
>> Phi=X*phid*Xi
Phi =
>> pretty(Phi)
+-
-+
ans =
exp(exp(t))
>> exp(exp(1))
ans =
15.1543
-+
phid =
[ exp(-t),
[
0]
0, exp(-2*t)]
>> Phi=X*phid*Xi
Phi =
>> pretty(Phi)
+-
-+
Xo =
-1
2
>> B=[0; 1]
B=
-+
0
1
>> C=[1 0]
C=
>> D=0
D=
>> sys=ss(A,B,C,D)
sys =
a=
x1 x2
x1 0 1
x2 -2 -3
b=
u1
x1 0
x2 1
c=
x1 x2
y1 1 0
d=
u1
y1 0
Overloaded methods:
DynamicSystem/initial
xregusermod/initial
localusermod/initial
localtruncps/initial
localsurface/initial
localpspline/initial
localpoly/initial
localbspline/initial
>> t=0;0.1;6;
>> initial(sys,Xo;t)
initial(sys,Xo;t)
|
>> initial(sys,Xo,t)
Error using DynamicSystem/initial (line 85)
In time response commands, the final time must be a positive scalar.
>> initial(sys,Xo,t)
Error using DynamicSystem/initial (line 85)
In time response commands, the final time must be a positive scalar.
>> SYS=ss(A,B,C,D)
SYS =
a=
x1 x2
x1 0 1
x2 -2 -3
b=
u1
x1 0
x2 1
c=
x1 x2
y1 1 0
d=
u1
y1 0
>> initial(SYS,Xo,t)
Error using DynamicSystem/initial (line 85)
In time response commands, the final time must be a positive scalar.
>> t=0:0.1;6;
>> t=0:0.1:6;
>> initial(SYS,Xo,t)
>> [Y,T,X]=initial
Error using initial (line 73)
Not enough input arguments.
>> [Y,T,X]=initial(SYS,Xo,t)
Y=
-1.0000
-0.8187
-0.6703
-0.5488
-0.4493
-0.3679
-0.3012
-0.2466
-0.2019
-0.1653
-0.1353
-0.1108
-0.0907
-0.0743
-0.0608
-0.0498
-0.0408
-0.0334
-0.0273
-0.0224
-0.0183
-0.0150
-0.0123
-0.0101
-0.0082
-0.0067
-0.0055
-0.0045
-0.0037
-0.0030
-0.0025
-0.0020
-0.0017
-0.0014
-0.0011
-0.0009
-0.0007
-0.0006
-0.0005
-0.0004
-0.0003
-0.0003
-0.0002
-0.0002
-0.0002
-0.0001
-0.0001
-0.0001
-0.0001
-0.0001
-0.0000
-0.0000
-0.0000
-0.0000
-0.0000
-0.0000
-0.0000
-0.0000
-0.0000
-0.0000
-0.0000
T=
0
0.1000
0.2000
0.3000
0.4000
0.5000
0.6000
0.7000
0.8000
0.9000
1.0000
1.1000
1.2000
1.3000
1.4000
1.5000
1.6000
1.7000
1.8000
1.9000
2.0000
2.1000
2.2000
2.3000
2.4000
2.5000
2.6000
2.7000
2.8000
2.9000
3.0000
3.1000
3.2000
3.3000
3.4000
3.5000
3.6000
3.7000
3.8000
3.9000
4.0000
4.1000
4.2000
4.3000
4.4000
4.5000
4.6000
4.7000
4.8000
4.9000
5.0000
5.1000
5.2000
5.3000
5.4000
5.5000
5.6000
5.7000
5.8000
5.9000
6.0000
X=
-1.0000
2.0000
-0.8187
1.6375
-0.6703
1.3406
-0.5488
1.0976
-0.4493
0.8987
-0.3679
0.7358
-0.3012
0.6024
-0.2466
0.4932
-0.2019
0.4038
-0.1653
0.3306
-0.1353
0.2707
-0.1108
0.2216
-0.0907
0.1814
-0.0743
0.1485
-0.0608
0.1216
-0.0498
0.0996
-0.0408
0.0815
-0.0334
0.0667
-0.0273
0.0546
-0.0224
0.0447
-0.0183
0.0366
-0.0150
0.0300
-0.0123
0.0246
-0.0101
0.0201
-0.0082
0.0165
-0.0067
0.0135
-0.0055
0.0110
-0.0045
0.0090
-0.0037
0.0074
-0.0030
0.0061
-0.0025
0.0050
-0.0020
0.0041
-0.0017
0.0033
-0.0014
0.0027
-0.0011
0.0022
-0.0009
0.0018
-0.0007
0.0015
-0.0006
0.0012
-0.0005
0.0010
-0.0004
0.0008
-0.0003
0.0007
-0.0003
0.0005
-0.0002
0.0004
-0.0002
0.0004
-0.0002
0.0003
-0.0001
0.0002
-0.0001
0.0002
-0.0001
0.0002
-0.0001
0.0001
-0.0001
0.0001
-0.0000
0.0001
-0.0000
0.0001
-0.0000
0.0001
-0.0000
0.0000
-0.0000
0.0000
-0.0000
0.0000
-0.0000
0.0000
-0.0000
0.0000
-0.0000
0.0000
-0.0000
0.0000
-0.0000
0.0000
>> plot(T,X)
>> grid
>> legend('X1','X2')
>> legend('X_1','X_2')
>> Phi
Phi =
>> x=Phi*Xo
x=
-exp(-2*t)
2*exp(-2*t)
>> x(1)
ans =
-exp(-2*t)
>> hold on
>> plot(t,x(1),'r*')
Error using plot
Conversion to double from sym is not possible.
>> plot(x(1),t,'r*')
Error using plot
Conversion to double from sym is not possible.
>> x(2)
ans =
2*exp(-2*t)
lsim(SYS,U,T) plots the time response of the dynamic system SYS to the
input signal described by U and T. The time vector T is expressed in the
time units of SYS and consists of regularly spaced time samples. The
matrix U has as many columns as inputs in SYS and its i-th row specifies
the input value at time T(i). For example,
Overloaded methods:
DynamicSystem/lsim
resppack.ltisource/lsim
>> size(t)
ans =
61
>> U=ones(1,61)
U=
Columns 1 through 14
Columns 15 through 28
Columns 29 through 42
Columns 43 through 56
Columns 57 through 61
>> [y,t,x]=lsim(SYS,U,t,Xo)
y=
-1.0000
-0.8142
-0.6539
-0.5152
-0.3950
-0.2905
-0.1994
-0.1199
-0.0503
0.0108
0.0645
0.1117
0.1534
0.1903
0.2230
0.2520
0.2777
0.3006
0.3210
0.3392
0.3555
0.3700
0.3831
0.3947
0.4052
0.4145
0.4230
0.4305
0.4373
0.4435
0.4490
0.4539
0.4584
0.4624
0.4661
0.4693
0.4723
0.4750
0.4774
0.4796
0.4815
0.4833
0.4849
0.4863
0.4876
0.4888
0.4899
0.4909
0.4917
0.4925
0.4932
0.4939
0.4945
0.4950
0.4955
0.4959
0.4963
0.4966
0.4970
0.4973
0.4975
t=
0
0.1000
0.2000
0.3000
0.4000
0.5000
0.6000
0.7000
0.8000
0.9000
1.0000
1.1000
1.2000
1.3000
1.4000
1.5000
1.6000
1.7000
1.8000
1.9000
2.0000
2.1000
2.2000
2.3000
2.4000
2.5000
2.6000
2.7000
2.8000
2.9000
3.0000
3.1000
3.2000
3.3000
3.4000
3.5000
3.6000
3.7000
3.8000
3.9000
4.0000
4.1000
4.2000
4.3000
4.4000
4.5000
4.6000
4.7000
4.8000
4.9000
5.0000
5.1000
5.2000
5.3000
5.4000
5.5000
5.6000
5.7000
5.8000
5.9000
6.0000
x=
-1.0000
2.0000
-0.8142
1.7236
-0.6539
1.4891
-0.5152
1.2896
-0.3950
1.1196
-0.2905
0.9744
-0.1994
0.8500
-0.1199
0.7432
-0.0503
0.6512
0.0108
0.5719
0.0645
0.5032
0.1117
0.4437
0.1534
0.3919
0.1903
0.3468
0.2230
0.3074
0.2520
0.2729
0.2777
0.2427
0.3006
0.2161
0.3210
0.1926
0.3392
0.1719
0.3555
0.1537
0.3700
0.1375
0.3831
0.1231
0.3947
0.1103
0.4052
0.0989
0.4145
0.0888
0.4230
0.0798
0.4305
0.0717
0.4373
0.0645
0.4435
0.0581
0.4490
0.0523
0.4539
0.0471
0.4584
0.0424
0.4624
0.0382
0.4661
0.0345
0.4693
0.0311
0.4723
0.0281
0.4750
0.0253
0.4774
0.0229
0.4796
0.0207
0.4815
0.0187
0.4833
0.0168
0.4849
0.0152
0.4863
0.0138
0.4876
0.0124
0.4888
0.0112
0.4899
0.0102
0.4909
0.0092
0.4917
0.0083
0.4925
0.0075
0.4932
0.0068
0.4939
0.0061
0.4945
0.0055
0.4950
0.0050
0.4955
0.0045
0.4959
0.0041
0.4963
0.0037
0.4966
0.0034
0.4970
0.0030
0.4973
0.0027
0.4975
0.0025
>>c figure(2)
>> plot(t,x)
>>