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

Examples of solving non-linear equation systems. More...

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <complex.h>
#include <float.h>
#include "vector.h"
#include "matrix.h"
#include "damped_newton_raphson.h"
#include "newton_raphson.h"
#include "fsolve.h"

Go to the source code of this file.

Functions

void get_non_lin_sys_f1_ (vector_t x_arr[], vector_t f1_vec[])
 The non-linear system f1. More...
 
void get_non_lin_sys_J1_ (vector_t x_arr[], matrix_t J1[][2])
 The Jacobian matrix of the non-linear system $ f_1 $. More...
 
void get_non_lin_sys_f2_ (vector_t x_arr[], vector_t f2_vec[])
 The non-linear system $ f_2 $. More...
 
void get_non_lin_sys_J2_ (vector_t x_arr[], matrix_t J2[][3])
 The Jacobian matrix of the non-linear system $ f_2 $. More...
 
void get_non_lin_sys_f3_ (vector_t x_arr[], vector_t f3_vec[])
 The non-linear system $ f_3 $. More...
 
void get_non_lin_sys_J3_ (vector_t x_arr[], matrix_t J3[][3])
 The Jacobian matrix of the non-linear system $ f_3 $. More...
 
void fsolve_test (void)
 Examples of solving non-linear equation systems.
 

Detailed Description

Examples of solving non-linear equation systems.

Solving non-linear equation systems examples (see fsolve functions).

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

Definition in file fsolve_test.c.

Function Documentation

◆ get_non_lin_sys_f1_()

void get_non_lin_sys_f1_ ( vector_t  x_arr[],
vector_t  f1_vec[] 
)

The non-linear system f1.

$ f_1 \left(x_1, x_2 \right) = \begin{bmatrix} x_1^3 + x_2 - 1 \\ x_2^3 - x_1 + 1 \\ \end{bmatrix} $

Parameters
[in]x_arr[]pointer to the $ x_1 $ and $ x_2 $ values.
[in]f1_vec[]pointer to the $ f_1 $ function values.

Definition at line 54 of file fsolve_test.c.

Referenced by fsolve_test().

◆ get_non_lin_sys_f2_()

void get_non_lin_sys_f2_ ( vector_t  x_arr[],
vector_t  f2_vec[] 
)

The non-linear system $ f_2 $.

$ f_2 \left( x_1, x_2, x_3 \right) = \begin{bmatrix} 3 x_1 - \cos\left( x_2 \times x_3 \right) - \dfrac{1}{2} \\ x_1^2 - 81 \left( x_2 + 0.1 \right)^2 + \sin(x_3) + 1.06 \\ \exp \left( -x1 \times x_2 \right) + 20 x_3 + \dfrac{10 \pi -3}{3} \\ \end{bmatrix} $

Parameters
[in]x_arr[]pointer to the $ x_1 $, $ x_2 $, and $ x_3 $ values.
[in]f2_vec[]pointer to the $ f_2 $ function values.

Definition at line 110 of file fsolve_test.c.

References M_PI.

Referenced by fsolve_test().

◆ get_non_lin_sys_f3_()

void get_non_lin_sys_f3_ ( vector_t  x_arr[],
vector_t  f3_vec[] 
)

The non-linear system $ f_3 $.

$ f_3 \left( x_1, x_2, x_3 \right) = \begin{bmatrix} \exp \left( -x_1 x_2 \right) + \log \left( x_1 \right)-\exp \left( -2 \right) \\ \exp \left( x_1 \right) - \dfrac{\sqrt{x_3}}{x_1} - \exp \left( 1 \right) + 2\\ x_1 + x_2 - x_2 x_3 + 5 \\ \end{bmatrix} $

Parameters
[in]x_arr[]pointer to the $ x_1 $, $ x_2 $, and $ x_3 $ values.
[in]f3_vec[]pointer to the $ f_3 $ function values.

Definition at line 174 of file fsolve_test.c.

Referenced by fsolve_test().

◆ get_non_lin_sys_J1_()

void get_non_lin_sys_J1_ ( vector_t  x_arr[],
matrix_t  J1[][2] 
)

The Jacobian matrix of the non-linear system $ f_1 $.

$ J_1 \left( x_1, x_2\right) = \begin{bmatrix} 3 \times x_1^2 & 1 \\ -1 & 3 \times x_2^2 \\ \end{bmatrix} $

Parameters
[in]x_arr[]pointer to the $ x_1 $ and $ x_2 $ values.
[in]J1[][]pointer to the Jacobian function $ J_1 $.

Definition at line 80 of file fsolve_test.c.

Referenced by fsolve_test().

◆ get_non_lin_sys_J2_()

void get_non_lin_sys_J2_ ( vector_t  x_arr[],
matrix_t  J2[][3] 
)

The Jacobian matrix of the non-linear system $ f_2 $.

$ J_2 \left( x_1, x_2, x_3 \right) = \begin{bmatrix} 3 & x_3 \sin\left( x_2 x_3 \right) & x_2 \sin\left( x_2 x_3 \right) \\ 2 x_1 & -162 x2 - \dfrac{81}{5} & \cos(x_3) \\ -x_2 \exp\left( -x_1 x_2 \right) & -x_1 \exp\left( -x_1 x_2 \right) & 20 \end{bmatrix} $

Parameters
[in]x_arr[]pointer to the $ x_1 $, $ x_2 $, and $ x_3 $ values.
[in]J2[][]pointer to the Jacobian function $ J_2 $.

Definition at line 139 of file fsolve_test.c.

Referenced by fsolve_test().

◆ get_non_lin_sys_J3_()

void get_non_lin_sys_J3_ ( vector_t  x_arr[],
matrix_t  J3[][3] 
)

The Jacobian matrix of the non-linear system $ f_3 $.

$ J_3 \left( x_1, x_2, x_3 \right) = \begin{bmatrix} \dfrac{1}{x_1}-x_2 \exp\left(-x_1 x_2\right) & -x_1\exp\left(-x_1 x_2\right) & 0 \\ \exp\left(x_1\right) + \dfrac{\sqrt{x_3}}{x_1^2} & 0 & \dfrac{-1}{2x_1\sqrt{x_3}} \\ 1 & 1-x_3 & -x_2 \end{bmatrix} $

Parameters
[in]x_arr[]pointer to the $ x_1 $, $ x_2 $, and $ x_3 $ values.
[in]J3[][]pointer to the Jacobian function $ J_3 $.

Definition at line 210 of file fsolve_test.c.

Referenced by fsolve_test().