RcdMathLib_doc
Open Source Library for Linear and Non-linear Algebra
newton_raphson.c File Reference

Implement the Newton–Raphson algorithm. More...

#include "vector.h"
#include "matrix.h"
#include "moore_penrose_pseudo_inverse.h"

Go to the source code of this file.

Functions

uint8_t newton_raphson (uint8_t f_length, uint8_t n, vector_t x0_arr[], double eps, uint8_t max_it_num, vector_t est_x_arr[], void(*get_non_lin_sys)(vector_t x_arr[], vector_t f_vec[]), void(*get_jacobian)(vector_t x_arr[], matrix_t J[][n]))
 Implements the Newton–Raphson algorithm. More...
 

Detailed Description

Implement the Newton–Raphson algorithm.

The Newton–Raphson algorithm enables to solve multi-variant nonlinear equation systems.

Author
Zakaria Kasmi zkasm.nosp@m.i@in.nosp@m.f.fu-.nosp@m.berl.nosp@m.in.de

Definition in file newton_raphson.c.

Function Documentation

◆ newton_raphson()

uint8_t newton_raphson ( uint8_t  f_length,
uint8_t  n,
vector_t  x0_arr[],
double  eps,
uint8_t  max_it_num,
vector_t  est_x_arr[],
void(*)(vector_t x_arr[], vector_t f_vec[])  get_non_lin_sys,
void(*)(vector_t x_arr[], matrix_t J[][n])  get_jacobian 
)

Implements the Newton–Raphson algorithm.

The user should provide pointers to non-linear equation systems and Jacobian functions.

Note
This function is generally implemented.
Parameters
[in]f_lengthlength of the error functions vector.
[in]nlength of the start vector.
[in]x0_arr[]start vector.
[in]epsaccuracy bound.
[in]max_it_nummaximal iteration number of the Newton–Raphson algorithm.
[out]est_x_arr[]estimated (solution) vector.
[in](*get_non_lin_sys)pointer to non-linear equation systems.
[in](*get_jacobian)pointer to the Jacobian matrix.
Returns
required iteration number.

Definition at line 28 of file newton_raphson.c.

References matrix_mul_vec(), matrix_t, moore_penrose_get_pinv(), vector_copy(), vector_get_euclidean_distance(), vector_sub(), and vector_t.

Referenced by fsolve().