File Exchange

## Jacobian-Free Newton-Krylov (JFNK) method

version 1.0.0.0 (4.31 KB) by
Function uses JFNK to solve a system of non-linear equations

Updated 21 Jan 2014

This function solves a system of non-linear equations using the Jacobian-Free Newton-Krylov (JFNK) method. The main advantage of using JFNK over the traditional Newton method is to avoid the need for generating and inverting the Jacobian matrix. Typically the Jacobian matrix is not analytically attainable and its numerical approximation (e.g., via finite-difference methods) is not easily invertible.

Reference: (1) Knoll D.A., Keyes D.E. "Jacobian-Free Newton-Krylov methods: a survey of approaches and applications", Journal of Computational Physics, August 2003.

### Cite As

Cheuk (2020). Jacobian-Free Newton-Krylov (JFNK) method (https://www.mathworks.com/matlabcentral/fileexchange/45170-jacobian-free-newton-krylov-jfnk-method), MATLAB Central File Exchange. Retrieved .

Alex Tekin

Hi, is there an example/manual how to apply this method for someone who is not very knowledgeable in MATLAB?

Liang Li

Thank you for reminding me that the built-in gmres can accept a function handle. It is heuristic! :)

mancolric2

It is very nice for illustrating the JFNK methods. However, in my opinion, it still has to be optimized. For example:
1) The GMRES is called without any preconditioning. That makes its convergence very slow.
2) For a fixed Newton iteration (e.g., fixed x), for each Krylov iteration, the function that computes Jv (JV_APPROX) evaluates both f(x) and f(x+epsilon*v). However, f(x) is always the same in that iterations! That should be taken into account to reduce computational cost, especially if f is expensive to compute ---in that case, computational cost could be reduced almost to the half part---.
3) The variable pert (in JV_APPROX) should be computed avoiding loops.

mancolric2

Ruiq Ma

Toppler

Thank you Cheuk,thank to you. I would like to learn about JFNK.

Sunil

Coz I'm using Octave, not MATLAB

Sunil

function gmres not included. :(

Sarah N

##### MATLAB Release Compatibility
Created with R2011a
Compatible with any release
##### Platform Compatibility
Windows macOS Linux