# yanera_profile.c File Reference

## Detailed Description

This file has the functions required for calculating the SLD profile, .

Definition in file yanera_profile.c.

Go to the source code of this file.

## Functions

void yanera_write_profile (yanera_container *yanera)
Write the SLD profiles to file.
double layerProfileReal (double z, yanera_model *model, yanera_container *yanera)
Calulates for a slab model.
double componentProfileReal (double z, yanera_model *model, yanera_container *yanera)
Calulates for a component model.
double functionProfileReal (double z, yanera_model *model, yanera_container *yanera)
Calulates for a function model.
double layerProfileImag (double z, yanera_model *model, yanera_container *yanera)
Calulates imaginary component of for a slab model.
double componentProfileImag (double z, yanera_model *model, yanera_container *yanera)
Calulates imaginary component of for a component model.
double functionProfileImag (double z, yanera_model *model, yanera_container *yanera)
Calulates imaginary component of for a function model.
void minMaxProfile (double *min, double *max, yanera_model *model, yanera_container *yanera)
Figures the minimum and maximum .

## Function Documentation

 void yanera_write_profile ( yanera_container * yanera )

Write the SLD profiles, , to file. The file names are drawn from the file names of the data files, and the file type suffix ".pro" is appended. If there were no data files, then the file name is "result_xx.pro", where xx is a sequential number based on the number of models.

Definition at line 25 of file yanera_profile.c.

 double layerProfileReal ( double z, yanera_model * model, yanera_container * yanera )

Parameters:
 z Position to calculate model The yanera_model to calculate. yanera The general yanera_container.
Returns:
For a set of layers, that run from bulk () to substrate () (or substrate to bulk), the scattering length density profile can be given as

where is the thickness, is the real part of the scattering length density, the roughness, each of layer . The location of the error function, , is calculated by a running total of the thicknesses. When the roughness is zero, the error function becomes a Heavyside step function.

Definition at line 80 of file yanera_profile.c.

 double componentProfileReal ( double z, yanera_model * model, yanera_container * yanera )

Parameters:
 z Position to calculate model The yanera_model to calculate. yanera The general yanera_container.
Returns:
For a set of layers, that run from bulk () to substrate () (or substrate to bulk), the scattering length density profile is a sum of the components that form it.

where is a functional form of a component, that may have XML tags specifying the center (<cntr/>), roughness (<sigz/>), and thickness (<thik/>).

The bulk and/or substrate are modeled by error functions centered at 0 and at the total thickness given by the <cntr/> tag for the bulk in the XML file.

For a Gaussian function, the <sigz/> tag becomes the width of the gaussian, given by

A box function is a box of total width <thik/>, convoluted with a Gaussian of width <sigz/>:

If <sigz/> is zero, then the box function becomes a Heavyside step function, and the Gaussian becomes zero.

Definition at line 144 of file yanera_profile.c.

 double functionProfileReal ( double z, yanera_model * model, yanera_container * yanera )

Parameters:
 z Position to calculate model The yanera_model to calculate. yanera The general yanera_container.
Returns:
This function calculates a slab type profile model, as shown in the function slabProfile, but for layers that have a functional form, that layer is evaluated according to the expression.

Definition at line 239 of file yanera_profile.c.

 double layerProfileImag ( double z, yanera_model * model, yanera_container * yanera )

slabProfileReal

Definition at line 318 of file yanera_profile.c.

 double componentProfileImag ( double z, yanera_model * model, yanera_container * yanera )

componentProfileReal

Definition at line 370 of file yanera_profile.c.

 double functionProfileImag ( double z, yanera_model * model, yanera_container * yanera )

functionProfileReal

Definition at line 457 of file yanera_profile.c.

 void minMaxProfile ( double * min, double * max, yanera_model * model, yanera_container * yanera )

Parameters:
 min Allocated double to contain the calculated minimum max Allocated double to contain the calculated maximum model The yanera_model to calculate. yanera The general yanera_container.
Figures the minimum and maximum for the SLD profile. This is model ype dependant.
Bug:
My confidence that this function works for all cases is about 95%.

Definition at line 527 of file yanera_profile.c.

Generated on Thu May 29 10:56:33 2008 by  1.5.5