Layers
Diffusion in heterogeneous environments
Functions
rti-theory.c File Reference

Functions for fitting the homogeneous model to the data (traditional fit) to obtain the apparent parameters and the characteristic curve. More...

#include "header.h"
Include dependency graph for rti-theory.c:

Go to the source code of this file.

Functions

double calc_mse_rti (const gsl_vector *x, void *params)
 Mean squared error function for simplex fitting. More...
 
void rti_theory (int nt, double spdist, double samplitude, double sdelay, double sduration, double kappa, double dfree, double alpha, double theta, double *t, double *p_theory)
 Calculates RTI data for diffusion in an isotropic, homogeneous environment (direct calculation from an equation) More...
 

Detailed Description

Functions for fitting the homogeneous model to the data (traditional fit) to obtain the apparent parameters and the characteristic curve.

Author
David Lewis, CABI, NKI
Date
2012-2013

Definition in file rti-theory.c.

Function Documentation

double calc_mse_rti ( const gsl_vector *  x,
void *  params 
)

Mean squared error function for simplex fitting.

The 3layer program uses a minimization function in GSL to minimize the mean squared error between the diffusion curve calculated from the multilayer model and a diffusion curve calculated from a formula that assumes an isotropic homogeneous environment. It does so to calculate the apparent parameters and characteristic diffusion curve (for comparison purposes).

This function calculates the mean squared error between the two curves. The GSL minimization routine needs the first parameter to be a vector of doubles which represent the parameters to be fit and the second parameter to be a pointer to parameters of the function to fit (rti_theory).

The second parameter actually points to a struct of parameters. The characteristic curve calculated from rti_theory is stored in the p_theory array of this struct.

Parameters
[in]xVector of doubles representing parameters to fit (alpha and theta)
[in,out]paramsVector of parameters needed by rti_theory
Returns
Mean squared error between multilayer curve and characteristic curve

Definition at line 42 of file rti-theory.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void rti_theory ( int  nt,
double  spdist,
double  samplitude,
double  sdelay,
double  sduration,
double  kappa,
double  dfree,
double  alpha,
double  theta,
double *  t,
double *  p_theory 
)

Calculates RTI data for diffusion in an isotropic, homogeneous environment (direct calculation from an equation)

Todo:
Change formula to take kappa into account
Parameters
[in]ntNumber of time points of calculation
[in]spdistDistance between source and probe
[in]samplitudeAmplitude of source
[in]sdelaySource delay (time before source starts)
[in]sdurationDuration of source
[in]kappaNonspecific clearance factor
[in]dfreeFree diffusion coefficient
[in]alphaExtracellular volume fraction
[in]thetaPermeability
[in]tTime array
[out]p_theoryProbe array (concentration as a function of time)

Definition at line 88 of file rti-theory.c.

Here is the caller graph for this function: