Commit Graph

43 Commits (7dd2dd5e24a343fbeaf3522ea5e535c27d8b9f95)

Author SHA1 Message Date
Johannes Pfeifer c9fd266cbb solve1.m: trap zero Jacobian case 2022-05-25 14:31:12 +02:00
Stéphane Adjemian (Ryûk) ef2bb4e669
Return and use errorcode from dynare_solve.
Note that the interpretation of the error code depends on the nonlinear solver.
2022-04-09 16:06:24 +02:00
Stéphane Adjemian (Ryûk) 882091cc97
Return more info about nonlinear solver failures (solve1). 2022-03-03 22:30:38 +01:00
Stéphane Adjemian (Ryûk) afd8359dbf
Do not compute g twice in solve1.
When jacobian is evaluated numerically.
2022-03-03 20:26:06 +01:00
Stéphane Adjemian (Ryûk) 9be328aeda
Cosmetic changes. 2022-03-03 20:24:18 +01:00
Stéphane Adjemian (Ryûk) f2193e8ec8
Add more checks on the initial evaluation. 2022-03-03 18:33:34 +01:00
Stéphane Adjemian (Ryûk) 3c85695b99
Use isinf() instead of isfinite() in solve1 routine. 2022-03-03 18:30:36 +01:00
Stéphane Adjemian (Ryûk) 0d092a36a0
Acknowledge option trust_region_initial_step_bound_factor in matlab based trust_region routine. 2021-07-23 19:44:16 +02:00
Sébastien Villemot 766fff88f6
Use secure URL for link to GNU licenses 2021-06-09 17:35:05 +02:00
Michel Juillard f70f7761db Nonlinear solver: tolerance for first Newton iteration is now
smaller than for subsequent ones. Closes: #1668
2019-11-27 14:19:01 +01:00
Sébastien Villemot 89a3e94cbf
Use true/false instead of 1/0 for boolean options
This is more elegant, and makes it easier to distinguish them from integer
options.

Also simplify test expressions for these boolean options.
2019-03-19 15:21:16 +01:00
Stéphane Adjemian (Charybdis) 5417b27ac7 Fixed indentation of matlab files. 2017-05-16 15:10:20 +02:00
Stéphane Adjemian (Charybdis) a53636e24e Fixed copyright notices. 2017-05-16 14:11:15 +02:00
Stéphane Adjemian (Charybdis) 88e1701289 Removed useless commas and semicolons. 2017-05-16 13:24:46 +02:00
Johannes Pfeifer 300ebd02b0 solve1: Move condition that could never be reached into if-clause 2016-03-22 21:55:52 +01:00
Stéphane Adjemian (Hermes) 837c812c17 Efficiency changes.
+ Use scalar product when possible, ie replace sum(x.*x) by x'*x,
+ Add parenthesis around scalar products, ie replace a*x'*x by a*(x'*x),
+ Removed global options_ in lnsrch1 (only used for solve_tolx).

Note that the scalar products could be replaced by a loop for small
problems. If the number of unknow is smaller than 70 the loop is
faster (10 times faster if the number of unknowns is less than 10).
2016-02-26 22:06:49 +01:00
Michel Juillard 6bbfa2fa6d removed 1e6 in expression forcing a non-singular Jacobian 2014-09-30 08:13:31 +02:00
Michel Juillard 72950de0a0 solve1: initialize fjac only if it needs to be computed numerically. 2014-05-11 14:44:06 +02:00
Michel Juillard a6106f07c7 making solve1.m robust to sparse Jacobian 2014-05-07 21:12:56 +02:00
Sébastien Villemot 3fe5a728c6 Remove bad_cond_flag argument from solve1.
This flag was not grounded on any solid theoretical foundation.

This commit actually makes solve_algo=2 to be exactly the same than solve_algo=4.
2014-02-04 17:56:27 +01:00
Stéphane Adjemian (Charybdis) 4052d4ccaf Cosmetic changes. Use skipline() instead of disp(' '). 2013-07-10 17:12:34 +02:00
Michel Juillard 48e00c5789 corrected and clarified error messages when steady state computation fails 2012-10-31 11:09:25 +01:00
Michel Juillard 70e162c736 removed globals from solve1.m 2012-08-06 23:32:40 +02:00
Sébastien Villemot 1f9cea669a Update copyright notices 2012-06-08 18:22:34 +02:00
Michel Juillard 5af1effd8f removed debugging code from nonlinear solver when Jacobian is near
singular. The treatment of this case still needs to be further improved.
2012-05-30 10:25:10 +02:00
Michel Juillard 1fcf708b80 Merge remote-tracking branch 'origin/master' into dr1break 2012-03-10 18:21:14 +01:00
Stéphane Adjemian (Charybdis) 323e6fdf4f Added a second gstep option used as a parameter for the routine computing the hessian matrix.
In some cases, for instance for the non linear filters, it helps to reduce this new gstep parameter
to get a positive definite hessian matrix. options_.gstep is now a 2*1 vector. The first element is
the old gstep parameter, the second element is the new gstep parameter. The step defined for the
computation of the hessian matrix is now:

h1=max(abs(x),sqrt(gstep(1))*ones(n,1))*eps^(1/6)*gstep(2);
2012-03-09 16:36:26 +01:00
Michel Juillard 7c62fafe0c Merge branch 'master' into dr1break 2011-12-10 20:10:31 +01:00
Sébastien Villemot 02652f6eb8 Updated copyright notices 2011-02-04 17:27:33 +01:00
sebastien 1be52aaa5f Beautification: removed tabulation characters which were left in previous beautification pass
git-svn-id: https://www.dynare.org/svn/dynare/trunk@3300 ac1d8469-bf42-47a9-8791-bf33cf982152
2010-01-05 10:46:10 +00:00
sebastien 502e3e1df8 Beautified MATLAB code (Unix newline convention + Emacs indentation), except: AIM, swz, particle
git-svn-id: https://www.dynare.org/svn/dynare/trunk@3250 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-12-16 17:17:34 +00:00
sebastien fec9486fb9 Change to option solve_algo=4 of steady:
Even when the Jacobian is very badly conditioned, continue to use a Newton step


git-svn-id: https://www.dynare.org/svn/dynare/trunk@2862 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-08-21 12:05:34 +00:00
sebastien db50368418 v4 matlab: fixed some existing copyright headers (and some other minor header issues)
git-svn-id: https://www.dynare.org/svn/dynare/dynare_v4@1974 ac1d8469-bf42-47a9-8791-bf33cf982152
2008-08-01 12:40:33 +00:00
assia 28a5422625 header updated
git-svn-id: https://www.dynare.org/svn/dynare/dynare_v4@1536 ac1d8469-bf42-47a9-8791-bf33cf982152
2008-01-03 12:21:25 +00:00
ferhat d884d8a397 New features:
- Implementation of the simulation of the block decomposed model using sparse matrix using MATLAB code: 
  New option in model : sparse
  Example:
  Model(SPARSE);
  ….
  End;
- Implementation of the simulation of the block decomposed model using sparse matrix for static model. 
- Krylov methods are implemented to solve the linear model J.y=b, with J the Jacobian matrix at each step of  the Newton Method. Two Krylov's solvers are considered : 
   + Generalized Minimum Residual Method (GMRES) 
   + BiConjugate Gradients Stabilized (BICGSTAB)
  To call them the SIMULATE command has to be completed with a new option : METHOD which could have three   different values : 
   + LU : (default value)  Sparse LU resolution
   + GMRES 
   + BICGSTAB
	 	Example:
 			simul(periods=100, method=lu);
                        or        simul(method=Gmres);
- Correction of various bugs in “simulate.dll”.
- Correction of simk.m
- Correction allowing a list of VALUES or PERIODS not necessarily separated by a comma. 

git-svn-id: https://www.dynare.org/svn/dynare/dynare_v4@1447 ac1d8469-bf42-47a9-8791-bf33cf982152
2007-11-20 23:24:01 +00:00
michel ec4d29935d v4 solve1.m: corrected convergence criterium max(abs(fvec)) < tolf instead of f < tolf
git-svn-id: https://www.dynare.org/svn/dynare/dynare_v4@1330 ac1d8469-bf42-47a9-8791-bf33cf982152
2007-06-25 14:48:55 +00:00
michel 6c98c92782 v4: made options for solve tolerance criteria
git-svn-id: https://www.dynare.org/svn/dynare/dynare_v4@925 ac1d8469-bf42-47a9-8791-bf33cf982152
2006-09-21 15:48:36 +00:00
michel c9534f98d8 v3+4 solve1.m: bug correction
git-svn-id: https://www.dynare.org/svn/dynare/dynare_v4@852 ac1d8469-bf42-47a9-8791-bf33cf982152
2006-07-31 17:17:05 +00:00
michel b6e1fef911 v4 dynare_solve.m solve1.m: bug corrections
git-svn-id: https://www.dynare.org/svn/dynare/dynare_v4@812 ac1d8469-bf42-47a9-8791-bf33cf982152
2006-07-03 12:19:54 +00:00
michel fc0ae0aefa v4: modifying solve1.m for jacobian_flag; unfinished
git-svn-id: https://www.dynare.org/svn/dynare/dynare_v4@625 ac1d8469-bf42-47a9-8791-bf33cf982152
2006-02-14 10:34:47 +00:00
michel 6e23ddbf6d v4: global dr_ -> oo_.dr; corrected bug with dr_algo=1
git-svn-id: https://www.dynare.org/svn/dynare/dynare_v4@608 ac1d8469-bf42-47a9-8791-bf33cf982152
2006-01-18 16:50:33 +00:00
michel c8812b552e changed computation of steady state for linear models
git-svn-id: https://www.dynare.org/svn/dynare/dynare_v4@464 ac1d8469-bf42-47a9-8791-bf33cf982152
2005-09-27 20:22:40 +00:00
michel 9a9872fd33 dynare_v4 from CVS
git-svn-id: https://www.dynare.org/svn/dynare/dynare_v4@8 ac1d8469-bf42-47a9-8791-bf33cf982152
2005-02-18 19:54:39 +00:00