连续状态方程离散化

  • Post author:
  • Post category:其他




连续状态方程

连续状态方程的表达式为:





x

˙

(

t

)

=

A

x

(

t

)

+

B

u

(

t

)

y

(

t

)

=

C

x

(

t

)

+

D

u

(

t

)

\begin{array}{l}\dot x(t) = Ax(t) + Bu(t)\\y(t) = Cx(t) + Du(t)\end{array}

























x






˙







(


t


)




=




A


x


(


t


)




+




B


u


(


t


)








y


(


t


)




=




C


x


(


t


)




+




D


u


(


t


)


























将以上状态方程离散化以下形式:





x

(

k

+

1

)

=

E

x

(

k

)

+

F

u

(

k

)

y

(

k

)

=

G

x

(

k

)

+

H

u

(

k

)

\begin{array}{l}x(k + 1) = Ex(k) + Fu(k)\\y(k) = Gx(k) + Hu(k)\end{array}


















x


(


k




+




1


)




=




E


x


(


k


)




+




F


u


(


k


)








y


(


k


)




=




G


x


(


k


)




+




H


u


(


k


)


























第一种方式:解状态方程



求解

对连续状态方程进行变形:





{

x

˙

(

t

)

A

x

(

t

)

=

B

u

(

t

)

α

x

˙

(

t

)

α

A

x

(

t

)

=

α

B

u

(

t

)

(

α

x

(

t

)

)

=

α

B

u

(

t

)

\left\{ \begin{array}{l}\dot x(t) – Ax(t) = Bu(t)\\\alpha \dot x(t) – \alpha Ax(t) = \alpha Bu(t)\\(\alpha x(t))’ = \alpha Bu(t)\end{array} \right.








































































x






˙







(


t


)









A


x


(


t


)




=




B


u


(


t


)








α









x






˙







(


t


)









α


A


x


(


t


)




=




α


B


u


(


t


)








(


α


x


(


t


)



)
























=




α


B


u


(


t


)





























求解



α

\alpha






α





为时间t的函数有:





α

=

e

A

t

\alpha = {e^{ – At}}






α




=










e














A


t
















所以有:





[

e

A

t

x

(

t

)

]

=

e

A

t

B

u

(

t

)

{\left[ {

{e^{ – At}}x(t)} \right]^\prime } = {e^{ – At}}Bu(t)










[






e














A


t











x


(


t


)




]

























=










e














A


t











B


u


(


t


)







求解有:





{

[

e

A

t

x

(

t

)

]

=

e

A

t

B

u

(

t

)

d

[

e

A

t

x

(

t

)

]

d

t

=

e

A

t

B

u

(

t

)

t

0

t

d

[

e

A

t

x

(

t

)

]

=

t

0

t

e

A

t

B

u

(

t

)

d

t

x

(

t

)

=

x

(

t

0

)

e

A

(

t

t

0

)

+

B

t

0

t

e

F

τ

u

(

τ

)

d

τ

\left\{ \begin{array}{l}{\left[ {

{e^{ – At}}x(t)} \right]^\prime } = {e^{ – At}}Bu(t)\\\frac{

{d\left[ {

{e^{ – At}}x(t)} \right]}}{

{dt}} = {e^{ – At}}Bu(t)\\\int_{

{t_0}}^t d \left[ {

{e^{ – At}}x(t)} \right] = \int_{

{t_0}}^t {

{e^{ – At}}Bu(t)d} t\\x(t) = x({t_0}){e^{A(t – {t_0})}} + B\int_{

{t_0}}^t {

{e^{ – F\tau }}u(\tau )d\tau } \end{array} \right.













































































































































[






e














A


t











x


(


t


)




]

























=






e














A


t











B


u


(


t


)





















d


t


















d




[






e














A


t











x


(


t


)




]


























=






e














A


t











B


u


(


t


)























t










0


























t




















d






[






e














A


t











x


(


t


)




]






=



















t










0


























t























e














A


t











B


u


(


t


)


d



t








x


(


t


)




=




x


(




t










0



















)




e











A


(


t







t










0



















)













+




B



















t










0


























t























e














F


τ











u


(


τ


)


d


τ






























其中设其实时刻为



t

0

{

{t_0}}









t










0























,对于F为矩阵的情况,可以用指数级数展开的公式计算:





e

A

t

=

n

=

0

(

A

t

)

n

n

!

{e^{At}} = \sum\limits_{n = 0}^\infty {\frac{

{

{

{(At)}^n}}}{

{n!}}}








e











A


t













=

















n


=


0



















































n


!



















(


A


t


)











n



































一般到二阶即可。



离散化

设相邻采样时刻为



t

k

{t_k}








t










k


























t

k

+

1

{t_{k + 1}}








t











k


+


1























,有



t

k

+

1

t

k

=

T

{t_{k + 1}} – {t_k} = T








t











k


+


1

































t










k





















=








T









T

T






T





为采样间隔。对与求解的表达式代入有:





x

(

t

k

+

1

)

=

x

(

t

k

)

e

A

(

t

k

+

1

t

k

)

+

B

t

k

t

k

+

1

e

A

(

t

τ

)

u

(

τ

)

d

τ

x({t_{k + 1}}) = x({t_k}){e^{A({t_{k + 1}} – {t_k})}} + B\int_{

{t_k}}^{

{t_{k + 1}}} {

{e^{ A(t-\tau) }}u(\tau )d\tau }






x


(




t











k


+


1




















)




=








x


(




t










k



















)




e











A


(




t











k


+


1

























t










k



















)













+








B



















t










k





























t











k


+


1










































e











A


(


t





τ


)











u


(


τ


)


d


τ










x

(

t

k

+

1

)

=

x

(

t

k

)

e

A

T

+

B

t

k

t

k

+

1

e

A

(

t

k

+

1

τ

)

u

(

τ

)

d

τ

x({t_{k + 1}}) = x({t_k}){e^{AT}} + B\int_{

{t_k}}^{

{t_{k + 1}}} {

{e^{ A(t_{k+1}-\tau) }}u(\tau )d\tau }






x


(




t











k


+


1




















)




=








x


(




t










k



















)




e











A


T













+








B



















t










k





























t











k


+


1










































e











A


(



t











k


+


1






















τ


)











u


(


τ


)


d


τ






相邻采样时刻间隔很小,这里采用一个近似所有:





u

(

τ

)

=

u

(

t

k

)

,

t

k

τ

t

k

+

1

u(\tau ) = u({t_k}),{t_k} \le \tau \le {t_{k + 1}}






u


(


τ


)




=








u


(




t










k



















)


,






t










k






























τ















t











k


+


1

























所以有:





x

(

t

k

+

1

)

=

x

(

t

k

)

e

A

T

+

B

t

k

t

k

+

1

e

A

(

t

k

+

1

τ

)

u

(

τ

)

d

τ

=

x

(

t

k

)

e

A

T

+

B

u

(

t

k

)

t

k

t

k

+

1

e

A

(

t

k

+

1

τ

)

d

τ

\begin{array}{c}x({t_{k + 1}}) = x({t_k}){e^{AT}} + B\int_{

{t_k}}^{

{t_{k + 1}}} {

{e^{A({t_{k + 1}} – \tau )}}u(\tau )d\tau } \\ = x({t_k}){e^{AT}} + Bu({t_k})\int_{

{t_k}}^{

{t_{k + 1}}} {

{e^{A({t_{k + 1}} – \tau )}}d\tau } \end{array}


















x


(




t











k


+


1




















)




=




x


(




t










k



















)




e











A


T













+




B



















t










k





























t











k


+


1










































e











A


(




t











k


+


1























τ


)











u


(


τ


)


d


τ









=




x


(




t










k



















)




e











A


T













+




B


u


(




t










k



















)



















t










k





























t











k


+


1










































e











A


(




t











k


+


1























τ


)











d


τ



























对比离散方程可以推出





E

=

e

A

T

,

F

=

B

t

k

t

k

+

1

e

A

(

t

k

+

1

τ

)

d

τ

E = {e^{AT}},F = B\int_{

{t_k}}^{

{t_{k + 1}}} {

{e^{A({t_{k + 1}} – \tau )}}d\tau }






E




=










e











A


T











,




F




=








B



















t










k





























t











k


+


1










































e











A


(




t











k


+


1























τ


)











d


τ








对于



F

F






F





,设$\lambda = {t_{k + 1}} – \tau $,可以推出B:





F

=

B

0

T

e

A

t

d

t

F = B\int_0^T {

{e^{At }}} dt






F




=








B
















0








T























e











A


t












d


t











t

k

=

k

T

{t_k} = kT








t










k





















=








k


T





,代入到



x

(

t

)

x(t)






x


(


t


)





的表达式中有:





x

[

(

k

+

1

)

T

]

=

x

(

k

T

)

e

A

T

+

B

0

T

e

A

t

d

t

u

(

k

T

)

x\left[ {\left( {k + 1} \right)T} \right] = x\left( {kT} \right){e^{AT}} + B\int_0^T {

{e^{At}}dt} \cdot u(kT)






x





[




(



k




+




1



)





T



]





=








x





(



k


T



)







e











A


T













+








B
















0








T























e











A


t











d


t














u


(


k


T


)







因为



(

k

+

1

)

T

({k + 1})T






(



k




+




1



)


T





只表示序列点出现的时刻,所以拿掉



T

T






T





有:





x

(

k

+

1

)

=

x

(

k

)

e

A

T

+

B

0

T

e

A

t

d

t

u

(

k

)

x {\left( {k + 1} \right)} = x\left( {k} \right){e^{AT}} + B\int_0^T {

{e^{At}}dt} \cdot u(k)






x




(



k




+




1



)






=








x





(



k



)







e











A


T













+








B
















0








T























e











A


t











d


t














u


(


k


)







对于



e

A

t

{

{e^{At}}}









e











A


t















有另一种计算方式,对状态方程进行Laplace变化:





s

x

(

s

)

x

(

0

)

=

A

x

(

s

)

+

B

u

(

s

)

sx(s) – x(0) = Ax(s) + Bu(s)






s


x


(


s


)













x


(


0


)




=








A


x


(


s


)




+








B


u


(


s


)







有:





x

(

s

)

=

(

s

I

A

)

1

x

(

0

)

+

(

s

I

A

)

1

B

u

(

s

)

x(s) = {(sI – A)^{ – 1}}x(0) + {(sI – A)^{ – 1}}Bu(s)






x


(


s


)




=









(


s


I









A



)














1











x


(


0


)




+









(


s


I









A



)














1











B


u


(


s


)







其中



I

I






I





为单位矩阵。对比之前求解的



x

(

t

)

x(t)






x


(


t


)





的表达式有:





e

A

t

=

L

1

[

(

s

I

A

)

1

]

{e^{At}} = {L^{ – 1}}\left[ {

{

{\left( {sI – A} \right)}^{ – 1}}} \right]








e











A


t













=










L














1















[








(



s


I









A



)
















1













]









第二种方法:欧拉法

写出



x

˙

(

t

)

\dot x(t)













x






˙







(


t


)





的表达式:





x

˙

(

t

)

=

x

(

k

+

1

)

x

(

k

)

T

\dot x(t) = \frac{

{x(k + 1) – x(k)}}{T}













x






˙







(


t


)




=



















T















x


(


k




+




1


)









x


(


k


)


























代入到连续状态方程中有:





{

x

(

k

+

1

)

x

(

k

)

T

=

A

x

(

k

)

+

B

u

(

k

)

x

(

k

+

1

)

x

(

k

)

=

A

T

x

(

k

)

+

B

T

u

(

k

)

x

(

k

+

1

)

=

(

A

T

+

1

)

x

(

k

)

+

B

T

u

(

k

)

\left\{ \begin{array}{l}\frac{

{x(k + 1) – x(k)}}{T} = Ax(k) + Bu(k)\\ \Rightarrow x(k + 1) – x(k) = ATx(k) + BTu(k)\\ \Rightarrow x(k + 1) = \left( {AT + 1} \right)x(k) + BTu(k)\end{array} \right.













































































T

















x


(


k


+


1


)





x


(


k


)
























=




A


x


(


k


)




+




B


u


(


k


)













x


(


k




+




1


)









x


(


k


)




=




A


T


x


(


k


)




+




B


T


u


(


k


)













x


(


k




+




1


)




=





(



A


T




+




1



)





x


(


k


)




+




B


T


u


(


k


)





























所以有





E

=

(

A

T

+

I

)

,

F

=

B

T

E = \left( {AT + I} \right),F = BT






E




=









(



A


T




+




I



)





,




F




=








B


T







版权声明:本文为qq_39974578原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。