You are on page 1of 13

APM4809 -

Assignment or 2023/os/os
Unique Code:840978 JW GREEff (21136521)

1) Exercise 1. I

GIVEN State equation: tu


=

...

Initial condition:x(0) 0
=

... 2

Terminal condition:x(1) 1
=
...

cost function:J: S'u2dt


=

...

NowIS** dt =
Stu dt ... by
Eg

x(t)
=>
Stndt
=

...

THEN testing the initial and terminal conditions:

x(0) =

0 fotndt
=

0
=

=> the initial condition in 2


> atisfies $

x)
=

1 S:
=

tudt 66 a
terminal
8, by condition in

Now
showing It
n*- is a successful control:

I Jn
=
=
dt ...
by

=S.(n -st) 6tu


+ -
qt2dt...(n 3t)2 -
u2
=

-
6t at+
2

=
(.(n -
3t)2 dt 6(1) + -

3t3!!...by 0

=S.(u -3H2 dt + 3

of
since the
integral non-negative, the
is min 5 is 3

which can be achieved by


setting u st
=

..n*=st is a successful control


the
corresponding costfunction for u* 3t:
=

I Ju 2dt
=

... by

.* J:(st) 2dt 1!a


=
=

2dt
+
3
=

t10 3
=

the
corresponding trajectory for u* 3t:
=

x(t) 1tudt
=

...
by $

·x*(t) =

I3t2dt +)! =
=

+
3

(t) t the successful


the
is
corresponding trajectoryfor
=

control u* 3t=

f(x) = u*
=

v
+
... assumed to be another successful control

&

e
u st
=

v
+ and &i t(3t v)
=

+
st2 ut
=
+

...byQ

:. the solution of the new state equation:

x(t) (t3t2
=
+
vt dt =

t3 Stv dt
+
t

s(t) satisfies the condition((0)


initial
>
c
=

↳ x(=1 1
=

J!rtdt=> 1!vtdt
+
o...
=

· the cost ofthis control:

3 1!u
=
=
dt

=S. (st v)2 dt


+

=S!at2 6tv
+ v2
+ dt

=J'at2dt Sovdt
+

...
by

3
=
+
f!v2dt
>
3 since
integral non-negative
:.3 x
3 3*and
=

J 3*=)
=

v 0
=

THUSI is
n* the optimal control
Exercise
2) 12

GIVEN State equations.


Sincewith active
...

Initial conditions:(,(0). 0,xz(0) x =

= > 0 ... 2

Terminal conditions:(,(t) =

0, x2(t) 0
=

...

cost function:I =
S"idt t,
=

...

SINCE) the controls are banded as


given by -1 4,
=
It)=1 Yt we know
I of
subset the optimal control set
1 where the control variables only
take their extreme values

·any change in control results in the control switching from one

extreme to another

·
: we consider the 2 extreme values:II as
separate cases

CASE, where 4, (t) =-1:

Nawl ic,
3 with the [C's:(,(0). 0,x(0) x
=

x
=
= > o

xz 1
=

THEN1 1.c2dt=-I. dt => xt) X


=
-

by
t
the IC's

·J.c, dt I!xz(t)
=
dt

=>
x,(t) 3![X
=
-
3dt xt
+
=
-

·
the solution rector:jt(t (ii] [X]
=
=

: the solution vector satisfies the initial conditions and

the terminal conditions:


by

CASE
2 where U, (t) 1
=

: with terminal time t, ct

Now, atsome time to with tactwe switch the control to the


value of+ 1.

ALSO/ic, 2
3 with the IC's:x,(0). xz(0) x >
=
0, 0
=
=

xz
=
1
THEN SE, c2 dt Si,
=

dt => xalt) t- t,
=

...

·(FeatIcecre ...
by

El-titl
=

= -

E -

(t,t -t,
I
=
-

I
+

I(t- t,)2
=

THUs) itis possible to reach the attime to provided


origin
we can solve for t, and ts s.t


E x2(t) X t far u,(t) =
=

1
- -

...

x,(t) xt -
=

②\<(t) t- t, for n,(t) 1


= =

. . .

x,2t) I(t t,)2


=
-

*:X tz t,
-
t =
-
=

2tz =
x +

t,
t=x +
=>
tz 2 +
=

tz -
t, =

0 t2 t,
=
=

I
It 2, +1) x z- X tz tz t,
=

&
+
- + - = -

It
=> -

Ent, aXtz =
(=
(t, -

tz) tz = -

t,(t,
=> -

tz) 2t22
+
2Xt z
=

(
t,(tz -

x) 2tz(X
=
-

(z)
E t,
2
=
①Ein- It

E? En t

C
+ x +

·.xz(t,) t,
=

2tz =

0 tz
= =

It,
-:.x,(ti)
I

It? -

2t,tz x
+ t z2
+
=

It
=> -

t, +
x +
0
=

=>
- E x
+
+
=

x
=> =

=t=2X
3) Exercise 2.2

GIVEN in =c, + txz


3 with x,(0) and x2(0) c2
=

c,
=

i=x2

NOTE here we have a coupled system

2-T1 = = (=2]
=
A := constantmatrix, fundamental
X:= matrix

SINCEl cEC1) Aci (t) =

A
=> =
[di]
ALSO1 the fundamental matrix X has a det Fo

·: find the eigenvalues & of A:


me
eigenvectors

1A-x2) =

0
1 =x)
=
=

==> (1 -
x) 0:X=

1
= with multiplicity 2

for eigenvector : (8] (vic] (8] =

:(* 2] [0] =

=> viz 0
=

:.x, =

[]
For
eigenvector i2: [8][22] [] =

..[*] [8] =

v2z
=>

1
=

:.[i]
.
. (t) ar,et blt,+vz) et
= +

=>

(ii] et((:] =

(-))
+

(x,(t) (at bt 2) et
=> =

xz(t) bet =

the initial
by conditions:x,(0) c,xz(0) =

ca
=

..c, 0
=
md cr b
=

(at ct) et
...[x,(t)
=

czet
...
xz(t) =
4)Exercise 2.3

(a) GIVENI A [00]


=

LET)c rextbe = a trial solution ofi As with =

55=(=2]

Nowl bythe Characteristic Eg:1A-XII 0


=

.('* (x) =

0 =
x2 -
x =

X(x
=> -
1) =

X, 0,xz
=> =

1
=

F2x), an
eigenvector corresponding to X, =

·:[d]() (8] =

n, v,
=

+
0
=

r
=

[i]
=

FIX) is an
eigenvector corresponding to x2 1
=

:. (8-J[i] (8] =

= (-22] (:] =
i
=>
[6]
=

SINCE) we have a linearlyindependenteigenvectors:

x,(t) eti, 2 -i]


= =

xr(t) extvz
=

[]
=

THUSIX Fundamental
=
=

Matrix=['."I
(b) GIVENI A [8p']
=

LET)c rextbe = a trial solution ofi As with =

55=(=2]

Nowl bythe Characteristic Eg:1A-XII 0


=

·(Ppx) =

0
(p
=
-
x)2 0
=

=>
X p =

with multiplicity
2

F2x), an
eigenvector corresponding to X, P
=

·: [8][] [8] =
=>
v,z 0=
i
=

[d]
=

farv, = 1

FIX) is an
eigenvector corresponding to x2 P
=

:. (8!][n]= [i] = vez 1


=

v
=
[9]
=

SINCE) we have a linearlyindependenteigenvectors:

:x,(t) ei,
=

ePt[d] [2- I
=
=

x(t) ext(tv, vz)


=
+
et
=

[t] (t 28] =

THUSIX = fundamental matrix-


=

[etet]
(c) GIVENI A= L 88]
LET =nextbe a trial solution ofin- As with i=(?]
Nowl bythe Characteristic Eg:1A-XII 0
=

·(i) =

0 - -
x3 0
=

X
=>
=0 with multiplicity 3

F2x), an
eigenvector corresponding to X, 0
=

·188:][] (8] (5](:] = => =


= (:] farm

FIX) is an
eigenvector corresponding to x2 0
=

·
18:](*] (8] =
=
(w] (!] =

r
=>
(8]
=

forvai

FIX)

an eigenrectalcorresponding test(i]
is

· 5=
=>
(i] for t

SINCE we have 3 linearlyindependenteigenvectors:

:x,(t) e4i,
=

(!) =

(a(t) tex2 +,
=

(*] rz
+
=

xy(t) texstr,
=

+ +3 (*)
=

THUSIX = fundamental
=

matrix=(o*****]
(d) GIVENI A [8 :g]
=

LET)c rextbe = a trial solution ofi As with =

55=(=2]

Nowl bythe Characteristic Eg:1A-XII =


0

·( qx) -
=

0 - x) q
=
- -
x) =

->
1 0,Xz= =

F2x), an
eigenvector corresponding to X, 0
=

·: (8-][] (8] =

[rz] (8)
=>
=

=>
v,e 0
=

v
=

(0]
=

FIX) is an
eigenvector corresponding to x2 =
-

:. L a
·
b][v] [8] =
=> [21, 22]= [8] v2
=

=-
i
=>

[-,*]
=

SINCE) we have a linearlyindependenteigenvectors:

:.x,(t) eti,
=

[i]
=
-

xa(t) ent =
=

2
=

e qt[-,]

THUSIX = fundamental
=

matrix=[deat) I
(e) GIVEN A 1=
=

LET)c rextbe = a trial solution ofi As with =

55=(=2]
Now the of diagonal matrixis values its
eigenvalues a
equal to on

diagonal.

·. In-numer ofeigenvalues:Xi=PiXi =,...,n

ALSO the eigenvectors of a


diagonal matrix
in M" is simplythe standard
basis ofRM

:. In-number of
eigenvectors as the cols of V with

V Cr,
=
rc ...
[n] with vi =
eigenvectors
=

of A

=diag(1, ...,1) sit vi corresponds to Xi


-
n -
number of Xi=1, ...,
entries

SINCE) we have a linearlyindependenteigenvectors:

:xilt) eiti Vi=1,...,


-

THUSIX:Fundamental Matrix, is diagonal with


X diag (etr.,
=

...,
etron(
5) GIVENI
E Es with <,(0) x and (0) 0 initial
=

co x2
=

...

conditions
... a coupled system

LET)x,(t,) =

0 and xz(t) 0
=

...
terminal conditions

FIx) J(t,x,,xz,u) t function


given
=

... cost

ASSUME) the control is


bang-bang s.t n -
=

a or n b
=

for a,b>0

:.u =

b for ostite and n = -


a for tz<t<t,

RTSI target be reached


can with
single switch

SINCE) X co in the initial state -> C, is initiallynegative att 0 =

and then x, 0
=

at t t,
=

·u will be positive for time tats and


negative for time

t >
t2

⑧ t z ti
for
Now Solving , and x2:
ret I
I
-
I

CASE, for It (0, tn)

Navl J.*2dt=1.* dt

xr(t)
=>
bt)
=

btz
=

THEN 1
·J*, dt =
Stxz(t) dt

x,(t)
=>
(bt zdt
=

btzt)* =

bt2

Buil by the IC's:,

·
the solution rector:jt(t (ii] [X]
=
=

: the solution vector satisfies the initial conditions and

the terminal conditions:


by

You might also like