Stellarator-Tools
functions Module Reference

This module containes functions used by the profiles. More...

Functions/Subroutines

real(rprec) pure function, public two_power (x, b)
 A two power profile. More...
 
real(rprec) pure function, public two_power_gs (x, b)
 A two power profile with added guassian peaks. More...
 
real(rprec) pure function guassian (x, b)
 A profile with a single guassian peak. More...
 
real(rprec) pure function guassian_int (x, b)
 A profile with a integrated single guassian peak. More...
 
logical function, public function_test ()
 Profile unit test function. More...
 

Detailed Description

This module containes functions used by the profiles.

Function/Subroutine Documentation

◆ function_test()

logical function, public functions::function_test

Profile unit test function.

This runs the associated unit tests and returns the result.

Returns
True if the tests pass and false otherwise.

◆ guassian()

real(rprec) pure function functions::guassian ( real(rprec), intent(in)  x,
real(rprec), dimension(0:20), intent(in)  b 
)

A profile with a single guassian peak.

This defines a profile with a single guassian peak.

b(0)*Exp(-(x - b(1))/b(2)) ** 2 (1)

b(0) controls the amplitude. b(1) controls the mean. b(2) controls the width.

Parameters
[in]xPoint to evaluate function from.
[in]bArray of profile parameters.
Returns
The function evaluated at x.

◆ guassian_int()

real(rprec) pure function functions::guassian_int ( real(rprec), intent(in)  x,
real(rprec), dimension(0:20), intent(in)  b 
)

A profile with a integrated single guassian peak.

This defines a profile with a with an integarted single guassian peak.

Sqrt(2Pi)/2*b(0)*b(1)*(Erf(b(1)/b(2)) - Erf((b(1) - x)/b(2))) (1)

b(0) controls the amplitude. b(1) controls the mean. b(2) controls the width.

Note
Fortran 90 does not have a built in Error function must use the C function instead.
Parameters
[in]xPoint to evaluate function from.
[in]bArray of profile parameters.
Returns
The function evaluated at x.

◆ two_power()

real(rprec) pure function, public functions::two_power ( real(rprec), intent(in)  x,
real(rprec), dimension(0:20), intent(in)  b 
)

A two power profile.

A two power profiles is defined using 3 parameters.

b(0) * (1.0 - x ** b(1)) ** b(2) (1)

b(0) controls the profile amplitude. b(1) controls the profile width. b(2) controls the profile tail.

Parameters
[in]xPoint to evaluate function from.
[in]bArray of profile parameters.
Returns
The function evaluated at x.

◆ two_power_gs()

real(rprec) pure function, public functions::two_power_gs ( real(rprec), intent(in)  x,
real(rprec), dimension(0:20), intent(in)  b 
)

A two power profile with added guassian peaks.

The power profile is defined as functions::two_power. Then up to 9 additional guassians peaks can be added.

two_power(x)*(1 + Sum[b(i)*Exp(-(x - b(i+1))/b(i+2)) ** 2]) (1)

Parameters beyond the first three control the additional guassians. b(i) controls the amplitude. b(i+1) controls the mean. b(i+2) controls the width.

Parameters
[in]xPoint to evaluate function from.
[in]bArray of profile parameters.
Returns
The function evaluated at x.