Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
pbdlib-matlab
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
rli
pbdlib-matlab
Commits
878c14e4
Commit
878c14e4
authored
Jul 30, 2014
by
Sylvain Calinon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
LQR tests and notational changes
parent
0f1c56b4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
reproduction_LQR_finiteHorizon.m
reproduction_LQR_finiteHorizon.m
+2
-2
reproduction_LQR_infiniteHorizon.m
reproduction_LQR_infiniteHorizon.m
+1
-1
No files found.
reproduction_LQR_finiteHorizon.m
View file @
878c14e4
...
...
@@ -63,8 +63,8 @@ dtar = gradient(tar,1,2)/model.dt;
%Backward integration of the Riccati equation and additional equation
for
t
=
nbData
-
1
:
-
1
:
1
S
(:,:,
t
)
=
S
(:,:,
t
+
1
)
+
model
.
dt
*
(
A
'*S(:,:,t+1) + S(:,:,t+1)*A - S(:,:,t+1) * B * (R\B'
)
*
S
(:,:,
t
+
1
)
+
Q
(:,:,
t
+
1
));
d
(:,
t
)
=
d
(:,
t
+
1
)
-
model
.
dt
*
(
S
(:,:,
t
+
1
)
*
B
*
(
R
\
B
') - A'
)
*
d
(:,
t
+
1
)
+
model
.
dt
*
S
(:,:,
t
+
1
)
*
dtar
(:,
t
+
1
)
...
-
model
.
dt
*
(
S
(:,:,
t
+
1
)
*
A
*
tar
(:,
t
+
1
));
%Optional feedforward term computation
%Optional feedforward term computation
d
(:,
t
)
=
d
(:,
t
+
1
)
+
model
.
dt
*
((
A
'-S(:,:,t+1)*B*(R\B'
))
*
d
(:,
t
+
1
)
+
S
(:,:,
t
+
1
)
*
dtar
(:,
t
+
1
)
-
S
(:,:,
t
+
1
)
*
A
*
tar
(:,
t
+
1
));
end
%Computation of the feedback term L in u=-LX+M
for
t
=
1
:
nbData
...
...
reproduction_LQR_infiniteHorizon.m
View file @
878c14e4
...
...
@@ -65,7 +65,7 @@ for t=1:nbData
M
=
R
\
B
'*
d
;
%Compute acceleration (with only feedback terms)
%ddx = -L * [x-r.currTar(:,t); dx]
+ M
;
%ddx = -L * [x-r.currTar(:,t); dx];
%Compute acceleration (with feedback and feedforward terms)
ddx
=
-
L
*
[
x
-
r
.
currTar
(:,
t
);
dx
]
+
M
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment