Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
dynare
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dynare
dynare
Commits
e7a8261b
Commit
e7a8261b
authored
12 years ago
by
MichelJuillard
Browse files
Options
Downloads
Patches
Plain Diff
first order and cycle reduction: fixing bugs in previous commits
parent
ba1f5eed
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
matlab/cycle_reduction.m
+5
-4
5 additions, 4 deletions
matlab/cycle_reduction.m
matlab/dyn_first_order_solver.m
+1
-2
1 addition, 2 deletions
matlab/dyn_first_order_solver.m
with
6 additions
and
6 deletions
matlab/cycle_reduction.m
+
5
−
4
View file @
e7a8261b
...
...
@@ -66,6 +66,7 @@ info = 0;
X
=
[];
crit
=
Inf
;
A0_0
=
A0
;
Ahat1
=
A1
;
if
(
nargin
==
5
&&
~
isempty
(
ch
)
)
A1_0
=
A1
;
A2_0
=
A2
;
...
...
@@ -76,11 +77,11 @@ id2 = id0+n;
cont
=
1
;
while
cont
crit
>
cvg_tol
&&
it
<
max_it
&&
~
isnan
(
crit
)
tmp
=
([
A0
;
A2
]
/
A1
)
*
[
A0
A2
];
A1
=
A1
-
tmp
(
id0
,
id2
)
-
tmp
(
id2
,
id0
);
A0
=
-
tmp
(
id0
,
id0
);
A2
=
-
tmp
(
id2
,
id2
);
Ahat1
=
Ahat1
-
tmp
(
id2
,
id0
);
crit
=
norm
(
A0
,
1
);
if
crit
<
cvg_tol
%
keep
iterating
until
condition
on
A2
is
met
...
...
@@ -90,17 +91,17 @@ while cont
elseif
isnan
(
crit
)
||
it
==
max_it
if
crit
<
cvg_tol
info
(
1
)
=
4
;
info
(
2
)
=
log
(
norm
(
A2
,
1
))
info
(
2
)
=
log
(
norm
(
A2
,
1
))
;
else
info
(
1
)
=
3
;
info
(
2
)
=
log
(
norm
(
A1
,
1
))
info
(
2
)
=
log
(
norm
(
A1
,
1
))
;
end
return
end
it
=
it
+
1
;
end
X
=
-
A1
\
A0_0
;
X
=
-
A
hat
1
\
A0_0
;
if
(
nargin
==
5
&&
~
isempty
(
ch
)
)
%
check
the
solution
...
...
This diff is collapsed.
Click to expand it.
matlab/dyn_first_order_solver.m
+
1
−
2
View file @
e7a8261b
...
...
@@ -276,8 +276,7 @@ else
opts
.
UT
=
true
;
opts
.
TRANSA
=
true
;
hx1
=
linsolve
(
tt
(
indx_stable_root
,
indx_stable_root
),
Z11
,
opts
)
'
;
opts
.
UT
=
false
;
hx2
=
linsolve
(
Z11
,
ss
(
indx_stable_root
,
indx_stable_root
)
'
,
opts
)
'
;
hx2
=
linsolve
(
Z11
,
ss
(
indx_stable_root
,
indx_stable_root
)
')'
;
hx
=
hx1
*
hx2
;
ghx
=
[
hx
(
k1
,
:
)
;
gx
(
k2
(
nboth
+
1
:
end
),
:
)];
end
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment