#include "headcpp.h" #include "math.h" #include "tbl.h" #include "matrice.h" #include "cheby.h" double f_source (double x) { static double constante = -4*exp(1.)/(1+exp(1.)*exp(1.)) ; return constante + exp(x) ; } double f_solution (double x) { static double constante = -4*exp(1.)/(1+exp(1.)*exp(1.)) ; return exp(x) - sinh(1.)/sinh(2.)*exp(2*x) + constante/4 ; } //******************* // First derivative //******************* Tbl ope_der (const Tbl& so) { // Verification of size : assert (so.get_ndim() == 1) ; int size = so.get_dim(0) ; // The result is set to zero Tbl res (size) ; res.annule_hard() ; // the computation for (int n=0 ; n> nr ; cout << "The operator matrix is " << endl ; Matrice operator_mat (matrix_ope(nr)) ; cout << operator_mat << endl ; // Resolution with a collocation method : Matrice systeme(nr, nr) ; systeme.annule_hard() ; // Boundary conditions are inforced by additional equations: // Left boundary condition : for (int i=0 ; i error_max) error_max = error ; x += step ; } cout << "Error max : " << endl ; cout << error_max << endl ; return 0 ; }