scidavis  2.3.0
About: SciDAVis is a free application for Scientific Data Analysis and Visualization (a fork off of QtiPlot).
  Fossies Dox: scidavis-2.3.0.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

exp_saturation.c File Reference
#include <gsl/gsl_vector.h>
#include <gsl/gsl_matrix.h>
#include <math.h>
Include dependency graph for exp_saturation.c:

Go to the source code of this file.

Classes

struct  data
 

Functions

char * name ()
 
char * function ()
 
char * parameters ()
 
double function_eval (double x, double *params)
 
int function_f (const gsl_vector *params, void *void_data, gsl_vector *f)
 
int function_df (const gsl_vector *params, void *void_data, gsl_matrix *J)
 
int function_fdf (const gsl_vector *params, void *void_data, gsl_vector *f, gsl_matrix *J)
 
double function_d (const gsl_vector *params, void *void_data)
 

Function Documentation

◆ function()

char* function ( )

Definition at line 47 of file exp_saturation.c.

47 { return "b1*(1-exp(-b2*x))"; }

◆ function_d()

double function_d ( const gsl_vector *  params,
void *  void_data 
)

Definition at line 88 of file exp_saturation.c.

89 {
90  struct data * d = (struct data*) void_data;
91  gsl_vector * f = gsl_vector_alloc(d->n);
92  double result = 0;
93  size_t i;
94 
95  function_f(params, void_data, f);
96  for (i=0; i<d->n; i++)
97  result += pow(gsl_vector_get(f, i), 2);
98 
99  gsl_vector_free(f);
100  return result;
101 }

References function_f(), and data::n.

Here is the call graph for this function:

◆ function_df()

int function_df ( const gsl_vector *  params,
void *  void_data,
gsl_matrix *  J 
)

Definition at line 67 of file exp_saturation.c.

68 {
69  struct data * d = (struct data*) void_data;
70  double b1 = gsl_vector_get(params, 0);
71  double b2 = gsl_vector_get(params, 1);
72  size_t i;
73  for (i=0; i<d->n; i++) {
74  double x = d->X[i];
75  gsl_matrix_set(J, i, 0, (1-exp(-b2*x)));
76  gsl_matrix_set(J, i, 1, b1*x*exp(-b2*x));
77  }
78  return GSL_SUCCESS;
79 }

References data::n, and data::X.

Referenced by function_fdf().

Here is the caller graph for this function:

◆ function_eval()

double function_eval ( double  x,
double *  params 
)

Definition at line 51 of file exp_saturation.c.

52 {
53  return params[0]*(1-exp(-params[1]*x));
54 }

◆ function_f()

int function_f ( const gsl_vector *  params,
void *  void_data,
gsl_vector *  f 
)

Definition at line 56 of file exp_saturation.c.

57 {
58  struct data * d = (struct data*) void_data;
59  double b1 = gsl_vector_get(params, 0);
60  double b2 = gsl_vector_get(params, 1);
61  size_t i;
62  for (i=0; i<d->n; i++)
63  gsl_vector_set(f, i, (b1*(1-exp(-b2*d->X[i])) - d->Y[i])/d->sigma[i]);
64  return GSL_SUCCESS;
65 }

References data::n, data::sigma, data::X, and data::Y.

Referenced by function_d(), and function_fdf().

Here is the caller graph for this function:

◆ function_fdf()

int function_fdf ( const gsl_vector *  params,
void *  void_data,
gsl_vector *  f,
gsl_matrix *  J 
)

Definition at line 81 of file exp_saturation.c.

82 {
83  function_f(params, void_data, f);
84  function_df(params, void_data, J);
85  return GSL_SUCCESS;
86 }

References function_df(), and function_f().

Here is the call graph for this function:

◆ name()

char* name ( )

Definition at line 45 of file exp_saturation.c.

45 { return "ExponentialSaturation"; }

Referenced by RenameWindowDialog::accept(), CurvesDialog::addCurve(), ApplicationWindow::addFolder(), Graph::addFunctionCurve(), ImportOPJ::createProjectTree(), ApplicationWindow::defineErrorBars(), ApplicationWindow::dependingPlots(), PythonScripting::eval(), PythonScripting::exec(), Filter::Filter(), FolderListView::FolderListView(), Graph::generateFunctionName(), ApplicationWindow::generateUniqueName(), Graph::Graph(), ImportASCIIDialog::ImportASCIIDialog(), ImportOPJ::importGraphs(), ImportOPJ::importNotes(), ImportOPJ::importSpreadsheet(), ApplicationWindow::initBareMultilayerPlot(), ApplicationWindow::initMultilayerPlot(), ApplicationWindow::initNote(), Graph::insertCurve(), Fit::insertFitFunctionCurve(), Graph::insertFunctionCurve(), ConfigDialog::languageChange(), IconLoader::load(), FitDialog::loadPlugins(), MuParserScripting::mathFunctionDoc(), PythonScripting::mathFunctionDoc(), ApplicationWindow::matrix(), ScriptingLangManager::newEnv(), ApplicationWindow::newHiddenTable(), ApplicationWindow::newMatrix(), MuParserScripting::newScript(), PythonScripting::newScript(), ApplicationWindow::newTable(), ApplicationWindow::newWrksheetPlot(), ApplicationWindow::openMatrixPlot3D(), Graph::plotPie(), XmlStreamReader::readAttributeInt(), ApplicationWindow::readSettings(), ApplicationWindow::removeCurves(), FitDialog::removeUserFunction(), ApplicationWindow::removeWindowFromLists(), ApplicationWindow::renameWindow(), ApplicationWindow::saveSettings(), FitDialog::saveUserFunction(), ScriptEdit::ScriptEdit(), ExportDialog::setActiveTableName(), PythonScripting::setDouble(), PythonScripting::setInt(), PythonScripting::setQObject(), DataCurve::setXColumnName(), DataCurve::setYColumnName(), ApplicationWindow::table(), ApplicationWindow::updateColNames(), ApplicationWindow::updateCurves(), ApplicationWindow::updateTableNames(), and ApplicationWindow::window().

Here is the caller graph for this function:

◆ parameters()

char* parameters ( )

Definition at line 49 of file exp_saturation.c.

49 { return "b1,b2"; }

Referenced by FitDialog::accept(), and FitDialog::showFitPage().

Here is the caller graph for this function:
function_f
int function_f(const gsl_vector *params, void *void_data, gsl_vector *f)
Definition: exp_saturation.c:56
data
Definition: exp_saturation.c:37
data::X
double * X
Definition: exp_saturation.c:40
data::sigma
double * sigma
Definition: exp_saturation.c:42
data::Y
double * Y
Definition: exp_saturation.c:41
data::n
size_t n
Definition: exp_saturation.c:38
function_df
int function_df(const gsl_vector *params, void *void_data, gsl_matrix *J)
Definition: exp_saturation.c:67