FEDEM Solver  R8.0
Source code of the dynamics solver
Data Types | Functions/Subroutines | Variables
explicitfunctionsmodule Module Reference

Module with explicit math functions. More...

Data Types

type  splinedata
 Data type for spline functions. More...
 
interface  funcvalue
 Evaluates a function. More...
 
interface  funcderivative
 Evaluates the derivative of a function. More...
 

Functions/Subroutines

subroutine, private funcvalue1 (ikf, ifunc, rfunc, x, fn, ierr)
 Evaluates an explicit function. More...
 
subroutine, private funcvalue2 (ikf, ifunc, rfunc, x, fn, ierr)
 Evaluates an (possibly) multi-argument explicit function. More...
 
subroutine, private funcderivative1 (ikf, iorder, ifunc, rfunc, x, fn, ierr)
 Evaluates the derivative of an explicit function. More...
 
subroutine, private funcderivative2 (ikf, iorder, ifunc, rfunc, x, fn, ierr)
 Evaluates the derivative of a multi-argument explicit function. More...
 
subroutine funcintegral (ikf, iorder, ifunc, rfunc, x, fn, ierr)
 Integrates an explicit function from 0.0 to x. More...
 
logical function canintegrateexplicitly (funcType, intOrder)
 Query function telling if a function can be integrated explicitly. More...
 
subroutine, private outofrangeerror (X, X0, X1)
 Prints an error message when function argument is out of range. More...
 
real(dp) function func1 (IFUNC, RFUNC, T, X)
 Simple sinusoidal function. More...
 
real(dp) function func2 (RFUNC, T, X, useTmin)
 Complex sinusoidal function composed of two sine waves. More...
 
real(dp) function func4 (IFUNC, RFUNC, T, X, IERR)
 Complex sinusoidal function composed of many sine waves. More...
 
real(dp) function func5 (IKF, IFUNC, RFUNC, constT, IERR)
 Servo simulator function. More...
 
real(dp) function func6 (IKF, IFUNC, RFUNC, T, IERR)
 Spline function. More...
 
subroutine deallocatesplines ()
 Deallocates all spline function data. More...
 
subroutine, private splin3 (X, Y, DERIV, N, Z, FVALUE, FDERIV, M, IOP, IERR)
 Computes a spline approximation from a set of points. More...
 
real(dp) function func8 (RFUNC, T, X, IERR)
 Evaluates the streamline wave profile at point X and time T. More...
 
real(dp) function func9 (IFUNC, RFUNC, T, X, IERR)
 Evaluates the embedded wave profile at point X and time T. More...
 
real(dp) function func10 (IKF, IFUNC, RFUNC, X, IERR)
 Evaluates a piece-wise linear function at the given point. More...
 
real(dp) function, private func10diff (IKF, IFUNC, RFUNC, X, IERR)
 Evaluates the derivative of a piece-wise linear function. More...
 
real(dp) function, private func10integral (IKF, IFUNC, RFUNC, X, IORD, IERR)
 Integrates a piece-wise linear function from 0.0 to X. More...
 
real(dp) function func11 (RFUNC, T)
 Ramp function. More...
 
real(dp) function, private rampintegral (IORD, X, OFFSET, SLOPE, X0, X3)
 Integrate a ramp function from 0.0 to X. More...
 
real(dp) function func12 (RFUNC, T)
 Step function. More...
 
real(dp) function func13 (RFUNC, T)
 Square pulse function. More...
 
real(dp) function func14 (RFUNC, T)
 Dirac pulse function. More...
 
real(dp) function func15 (RFUNC)
 Constant function. More...
 
real(dp) function func16 (RFUNC, T)
 Extended ramp function. More...
 
real(dp) function func17 (RFUNC, T)
 Linear function. More...
 
real(dp) function func18 (ikf, iFunc, rFunc, arg, ierr)
 Calls a C-function to read and interpolate a function from a file. More...
 
real(dp) function, private func18integral (ikf, iFunc, rFunc, arg, iorder, ierr)
 Calls a C-function to read and integrate a function from a file. More...
 
real(dp) function func19 (ikf, iFunc, arg, ierr)
 Calls a C-function to get function value of an expression function. More...
 
real(dp) function func19diff (ikf, iFunc, arg, ierr)
 Calls a C-function to get derivative of an expression function. More...
 
real(dp) function func20 (ikf, iFunc, args, ierr)
 Calls a C-function to get function value of an expression function. More...
 
real(dp) function func20diff (ikf, iFunc, args, ierr)
 Calls a C-function to get derivative of an expression function. More...
 
real(dp) function func21 (ikf, iFunc, rFunc, args, ierr)
 Calls a C-function to get function value of a user-defined function. More...
 
real(dp) function func21diff (ikf, iFunc, rFunc, args, ierr)
 Calls a C-function to get derivative of a user-defined function. More...
 
real(dp) function func22 (IKF, RFUNC, T, IERR)
 Smooth trajectory function. More...
 

Variables

integer, parameter, private dp = kind(1.0D0)
 8-byte real (double) More...
 
real(dp), parameter, private pi = 3.141592653589793238_dp
 The value of π. More...
 
real(dp), parameter, private twopi = PI+PI
 The value of 2π. More...
 
real(dp), parameter, private epsarg_p = 1.0e-15_dp
 Argument tolerance. More...
 
integer, parameter maxfunc_p = 22
 Number of function types. More...
 
integer, parameter sinusoidal_p = 1
 
integer, parameter compl_sinus_p = 2
 
integer, parameter delayed_compl_sinus_p = 3
 
integer, parameter wave_sinus_p = 4
 
integer, parameter lin_vel_var_p = 5
 
integer, parameter spline_p = 6
 
integer, parameter wave_stokes5_p = 7
 
integer, parameter wave_streamline_p = 8
 
integer, parameter wave_embedded_p = 9
 
integer, parameter lin_var_p = 10
 
integer, parameter ramp_p = 11
 
integer, parameter step_p = 12
 
integer, parameter square_puls_p = 13
 
integer, parameter dirac_puls_p = 14
 
integer, parameter constant_p = 15
 
integer, parameter lim_ramp_p = 16
 
integer, parameter scale_p = 17
 
integer, parameter device_function_p = 18
 
integer, parameter math_expression_p = 19
 
integer, parameter user_defined_p = 21
 
integer, parameter smooth_traj_p = 22
 
character(len=19), dimension(maxfunc_p), parameter functype_p = (/ 'SINUSOIDAL ', 'COMPL_SINUS ', 'DELAYED_COMPL_SINUS', 'WAVE_SINUS ', 'LIN_VEL_VAR ', 'SPLINE ', 'WAVE_STOKES5 ', 'WAVE_STREAMLINE ', 'WAVE_EMBEDDED ', 'LIN_VAR ', 'RAMP ', 'STEP ', 'SQUARE_PULS ', 'DIRAC_PULS ', 'CONSTANT ', 'LIM_RAMP ', 'SCALE ', 'DEVICE_FUNCTION ', 'MATH_EXPRESSION ', 'MATH_EXPRESSION ', 'USER_DEFINED ', 'SMOOTH_TRAJ ' /)
 Function type names. More...
 
integer, save dbgfunc = 0
 File unit number of debug print. More...
 
integer, parameter nspln_p = 6
 Max. number of spline functions in core. More...
 
type(splinedata), dimension(nspln_p), save, private spl
 Internal spline data buffer. More...
 
integer, dimension(nspln_p), save last = 0
 Identifier for splines in core. More...
 

Detailed Description

Module with explicit math functions.

This module contains a collection of Fortran functions for evaluating explicit math functions. It consists of the following functions:

  1. FUNC1 : SIN-function
  2. FUNC2 : Two SIN-functions summed, either TMAX or TMIN given
  3. FUNC4 : Wave function (SIN-functions with random phase)
  4. FUNC5 : Servo simulator
  5. FUNC6 : Spline function
  6. FUNC8 : Streamline wave function
  7. FUNC9 : Wave function with embedded streamline functions
  8. FUNC10 : Piece-wise linear function
  9. FUNC11 : Ramp function
  10. FUNC12 : Step function
  11. FUNC13 : Square pulse function
  12. FUNC14 : Dirac pulse function
  13. FUNC15 : Constant function
  14. FUNC16 : Extended ramp function
  15. FUNC17 : Scaling function
  16. FUNC18 : External device function
  17. FUNC19 : General math expression function
  18. FUNC20 : Multi-variable math expression function
  19. FUNC21 : Multi-variable user-defined function (plug-in)
  20. FUNC22 : Smooth trajectory based on SIN2

Originally, this module was writtene by Ole Iver Sivertsen (OIS) in 1984, and later converted to Fortran90 by Bjorn Haugen in 1999.

Function/Subroutine Documentation

◆ canintegrateexplicitly()

logical function explicitfunctionsmodule::canintegrateexplicitly ( integer, intent(in)  funcType,
integer, intent(in)  intOrder 
)

Query function telling if a function can be integrated explicitly.

Author
Knut Morten Okstad
Date
15 Dec 2004

◆ deallocatesplines()

subroutine explicitfunctionsmodule::deallocatesplines

Deallocates all spline function data.

◆ func1()

real(dp) function explicitfunctionsmodule::func1 ( integer, dimension(3), intent(in)  IFUNC,
real(dp), dimension(:), intent(in)  RFUNC,
real(dp), intent(in)  T,
real(dp), intent(in)  X 
)

Simple sinusoidal function.

The following is from the original FORTRAN-77 documententation:

***********************************************************************
*
* PROGRAM CATEGORY : Fortran function
*
* PURPOSE : To describe a scaling function
*
* PURPOSE : To describe a simple sinusoidal function.
* A sine wave can be delayed and displaced.
*
* ENTRY ARGUMENTS : Time.......................................T
* Position...................................X
* Period velocity........................OMEGA=RF1*2*pi
* Period delay.............................EPS=RF2*2*pi
* Amplitude................................AMP=RF3
* Amplitude displacement.................DELTA=RF4
* Maximum time for the function to apply..TMAX=RF5
*
* EXIT ARGUMENTS : Value of function at time T................F
*
* CALLING SEQUENCE : FN=FUNC1(IFUNC,RFUNC,T,X)
*
***********************************************************************
Author
Ole Ivar Sivertsen SINTEF avd. for maskinkonstruksjon
Date
1984
Here is the caller graph for this function:

◆ func10()

real(dp) function explicitfunctionsmodule::func10 ( integer, intent(in)  IKF,
integer, dimension(:), intent(in)  IFUNC,
real(dp), dimension(:,:), intent(in)  RFUNC,
real(dp), intent(in)  X,
integer, intent(inout)  IERR 
)

Evaluates a piece-wise linear function at the given point.

Parameters
[in]IKFFunction identification number
[in]IFUNCInteger function input parameters
[in]RFUNCReal function input parameters
[in]XFunction argument
[out]ierrError indicator
Returns
Function value at point X
Author
Knut Morten Okstad
Date
17 Nov 2014
Here is the caller graph for this function:

◆ func10diff()

real(dp) function, private explicitfunctionsmodule::func10diff ( integer, intent(in)  IKF,
integer, dimension(:), intent(in)  IFUNC,
real(dp), dimension(:,:), intent(in)  RFUNC,
real(dp), intent(in)  X,
integer, intent(inout)  IERR 
)
private

Evaluates the derivative of a piece-wise linear function.

Parameters
[in]IKFFunction identification number
[in]IFUNCInteger function input parameters
[in]RFUNCReal function input parameters
[in]XFunction argument
[out]ierrError indicator
Returns
Function derivative at point X
Author
Knut Morten Okstad
Date
17 Nov 2014
Here is the caller graph for this function:

◆ func10integral()

real(dp) function, private explicitfunctionsmodule::func10integral ( integer, intent(in)  IKF,
integer, dimension(:), intent(in)  IFUNC,
real(dp), dimension(:,:), intent(in)  RFUNC,
real(dp), intent(in)  X,
integer, intent(in)  IORD,
integer, intent(inout)  IERR 
)
private

Integrates a piece-wise linear function from 0.0 to X.

Parameters
[in]IKFFunction identification number
[in]IFUNCInteger function input parameters
[in]RFUNCReal function input parameters
[in]XFunction argument, upper range of integration domain
[in]IORDIntegration order (0, 1, or 2)
[out]ierrError indicator
Returns
Function integral at point X
Author
Bjorn Haugen
Date
1998
Here is the caller graph for this function:

◆ func11()

real(dp) function explicitfunctionsmodule::func11 ( real(dp), dimension(3), intent(in)  RFUNC,
real(dp), intent(in)  T 
)

Ramp function.

The following is from the original FORTRAN-77 documententation:

***********************************************************************
*
* PURPOSE : To describe a ramp funtion
*
* ENTRY ARGUMENTS : Time.......................................T
* Offset ...............................OFFSET=RF1
* Ramp slope ............................SLOPE=RF2
* Start time for ramp....................STIME=RF3
*
* EXIT ARGUMENTS : Value of function at time T................F
*
* CALLING SEQUENCE : FN=FUNC11(RFUNC,T)
*
***********************************************************************
Author
Torleif Iversen (OIS) SINTEF avd. for reguleringsteknikk
Date
1989
Here is the caller graph for this function:

◆ func12()

real(dp) function explicitfunctionsmodule::func12 ( real(dp), dimension(3), intent(in)  RFUNC,
real(dp), intent(in)  T 
)

Step function.

The following is from the original FORTRAN-77 documententation:

***********************************************************************
*
* PURPOSE : To describe a step funtion
*
* ENTRY ARGUMENTS : Time.......................................T
* Offset ...............................OFFSET=RF1
* Step amplitude...........................AMP=RF2
* Start time for ramp....................STIME=RF3
*
* EXIT ARGUMENTS : Value of function at time T................F
*
* CALLING SEQUENCE : FN=FUNC12(RFUNC,T)
*
***********************************************************************
Author
Torleif Iversen (OIS) SINTEF avd. for reguleringsteknikk
Date
1989
Here is the caller graph for this function:

◆ func13()

real(dp) function explicitfunctionsmodule::func13 ( real(dp), dimension(4), intent(in)  RFUNC,
real(dp), intent(in)  T 
)

Square pulse function.

The following is from the original FORTRAN-77 documententation:

***********************************************************************
*
* PURPOSE : To describe a square puls function
*
* ENTRY ARGUMENTS : Time ......................................T
* Offset ...............................OFFSET=RF1
* Step amplitude ..........................AMP=RF2
* Period ...............................PERIOD=RF4
* Phrase angle .........................PANGLE=RF4
*
* EXIT ARGUMENTS : Value of function at time T................F
*
* CALLING SEQUENCE : FN=FUNC13(RFUNC,T)
*
***********************************************************************
Author
Torleif Iversen (OIS) SINTEF avd. for reguleringsteknikk
Date
1989
Here is the caller graph for this function:

◆ func14()

real(dp) function explicitfunctionsmodule::func14 ( real(dp), dimension(4), intent(in)  RFUNC,
real(dp), intent(in)  T 
)

Dirac pulse function.

The following is from the original FORTRAN-77 documententation:

***********************************************************************
*
* PURPOSE : To describe a dirac puls function
*
* ENTRY ARGUMENTS : Time ......................................T
* Offset ...............................OFFSET=RF1
* Step amplitude ..........................AMP=RF2
* Start time for puls....................STIME=RF3
*
* EXIT ARGUMENTS : Value of function at time T................F
*
* CALLING SEQUENCE : FN=FUNC14(RFUNC,T)
*
***********************************************************************
Author
Torleif Iversen (OIS) SINTEF avd. for reguleringsteknikk
Date
1989
Here is the caller graph for this function:

◆ func15()

real(dp) function explicitfunctionsmodule::func15 ( real(dp), dimension(1), intent(in)  RFUNC)

Constant function.

The following is from the original FORTRAN-77 documententation:

***********************************************************************
*
* PURPOSE : To describe a constant function
*
* ENTRY ARGUMENTS : Constant.............................. CONST=RF1
*
* EXIT ARGUMENTS : Value of function at time T................F
*
* CALLING SEQUENCE : FN=FUNC15(RFUNC)
*
***********************************************************************
Author
Torleif Iversen (OIS) SINTEF avd. for reguleringsteknikk
Date
1989
Here is the caller graph for this function:

◆ func16()

real(dp) function explicitfunctionsmodule::func16 ( real(dp), dimension(4), intent(in)  RFUNC,
real(dp), intent(in)  T 
)

Extended ramp function.

The following is from the original FORTRAN-77 documententation:

***********************************************************************
*
* PURPOSE : To describe an extended ramp funtion
*
* ENTRY ARGUMENTS : Time.......................................T
* Offset ...............................OFFSET=RF1
* Ramp slope ............................SLOPE=RF2
* Start time for ramp....................STIME=RF3
* Stop time for ramp.....................STOPT=RF4
*
* EXIT ARGUMENTS : Value of function at time T................F
*
* CALLING SEQUENCE : FN=FUNC16(RFUNC,T)
***********************************************************************
Author
Terje Rolvag (OIS) SINTEF avd. for reguleringsteknikk
Date
1989
Here is the caller graph for this function:

◆ func17()

real(dp) function explicitfunctionsmodule::func17 ( real(dp), dimension(1), intent(in)  RFUNC,
real(dp), intent(in)  T 
)

Linear function.

The following is from the original FORTRAN-77 documententation:

***********************************************************************
*
* PROGRAM CATEGORY : Fortran function
*
* PURPOSE : To describe a scaling function
*
* ENTRY ARGUMENTS : Time.......................................T
* Scale Factor...........................SCALE=RF1
*
* EXIT ARGUMENTS : Value of function at time T................F
*
* CALLING SEQUENCE : FN=FUNC17(RFUNC,T)
*
***********************************************************************
Author
Jens Lien Fedem AS
Here is the caller graph for this function:

◆ func18()

real(dp) function explicitfunctionsmodule::func18 ( integer, intent(in)  ikf,
integer, dimension(5), intent(in)  iFunc,
real(dp), dimension(2), intent(in)  rFunc,
real(dp), intent(in)  arg,
integer, intent(inout)  ierr 
)

Calls a C-function to read and interpolate a function from a file.

Author
Tommy Jorstad / Knut Morten Okstad
Date
14 Jun 2002
Here is the caller graph for this function:

◆ func18integral()

real(dp) function, private explicitfunctionsmodule::func18integral ( integer, intent(in)  ikf,
integer, dimension(5), intent(in)  iFunc,
real(dp), dimension(2), intent(in)  rFunc,
real(dp), intent(in)  arg,
integer, intent(in)  iorder,
integer, intent(inout)  ierr 
)
private

Calls a C-function to read and integrate a function from a file.

Author
Knut Morten Okstad
Date
15 Dec 2004
Here is the caller graph for this function:

◆ func19()

real(dp) function explicitfunctionsmodule::func19 ( integer, intent(in)  ikf,
integer, dimension(3), intent(in)  iFunc,
real(dp), intent(in)  arg,
integer, intent(inout)  ierr 
)

Calls a C-function to get function value of an expression function.

Author
Tommy Jorstad
Date
15 Aug 2002
Here is the caller graph for this function:

◆ func19diff()

real(dp) function explicitfunctionsmodule::func19diff ( integer, intent(in)  ikf,
integer, dimension(3), intent(in)  iFunc,
real(dp), intent(in)  arg,
integer, intent(inout)  ierr 
)

Calls a C-function to get derivative of an expression function.

Author
Knut Morten Okstad
Date
15 Sep 2009
Here is the caller graph for this function:

◆ func2()

real(dp) function explicitfunctionsmodule::func2 ( real(dp), dimension(:), intent(in)  RFUNC,
real(dp), intent(in)  T,
real(dp), intent(in)  X,
logical, intent(in)  useTmin 
)

Complex sinusoidal function composed of two sine waves.

The following is from the original FORTRAN-77 documententation:

***********************************************************************
*
* PURPOSE : To describe a complex sinusoidal made up of
* 2 sine waves which separately can be delayed.
* The sine waves are added together and a total
* dispacement can be specified.
*
* ENTRY ARGUMENTS : Time.......................................T
* Position...................................X
* Period velocity wave1................OMEGA1=RF1
* Period velocity wave2................OMEGA2=RF2
* Period delay wave1.....................EPS1=RF3
* Period delay wave2.....................EPS2=RF4
* Amplitude wave1........................AMP1=RF5
* Amplitude wave2........................AMP2=RF5
* Amplitude displacement.................DELTA=RF7
* Starting point for function to apply....TMIN=RF8
* Maximum time for the function to apply..TMAX=RF8
* Flag for specifying TMIN or TMAX.....useTmin
*
* EXIT ARGUMENTS : Value of function at time T................F
*
* CALLING SEQUENCE : FN=FUNC2(RFUNC,T,X,useTmin)
*
***********************************************************************
Author
Sjur Lassesen SINTEF avd. for maskinkonstruksjon
Date
1986
Here is the caller graph for this function:

◆ func20()

real(dp) function explicitfunctionsmodule::func20 ( integer, intent(in)  ikf,
integer, dimension(4), intent(in)  iFunc,
real(dp), dimension(:), intent(in)  args,
integer, intent(inout)  ierr 
)

Calls a C-function to get function value of an expression function.

Author
Knut Morten Okstad
Date
15 Sep 2009
Here is the caller graph for this function:

◆ func20diff()

real(dp) function explicitfunctionsmodule::func20diff ( integer, intent(in)  ikf,
integer, dimension(4), intent(in)  iFunc,
real(dp), dimension(:), intent(in)  args,
integer, intent(inout)  ierr 
)

Calls a C-function to get derivative of an expression function.

Author
Knut Morten Okstad
Date
15 Sep 2009
Here is the caller graph for this function:

◆ func21()

real(dp) function explicitfunctionsmodule::func21 ( integer, intent(in)  ikf,
integer, dimension(4), intent(in)  iFunc,
real(dp), dimension(:), intent(in)  rFunc,
real(dp), dimension(:), intent(in)  args,
integer, intent(inout)  ierr 
)

Calls a C-function to get function value of a user-defined function.

Author
Knut Morten Okstad
Date
15 Jan 2010
Here is the caller graph for this function:

◆ func21diff()

real(dp) function explicitfunctionsmodule::func21diff ( integer, intent(in)  ikf,
integer, dimension(4), intent(in)  iFunc,
real(dp), dimension(:), intent(in)  rFunc,
real(dp), dimension(:), intent(in)  args,
integer, intent(inout)  ierr 
)

Calls a C-function to get derivative of a user-defined function.

Author
Knut Morten Okstad
Date
15 Jan 2010
Here is the caller graph for this function:

◆ func22()

real(dp) function explicitfunctionsmodule::func22 ( integer, intent(in)  IKF,
real(dp), dimension(4), intent(in)  RFUNC,
real(dp), intent(in)  T,
integer, intent(inout)  IERR 
)

Smooth trajectory function.

The following is from the original FORTRAN-77 documententation:

***********************************************************************
*
* PURPOSE : To describe a trajectory with continuity in speed,
* acceleration and jerk.
* The trajectiory is based on a second order
* sinusoidal function.
*
* ENTRY ARGUMENTS : Time.........................................T
* Starting time for trajection generation....RF1
* Total trajectory time......................RF2
* Maximum acceleration.......................RF3
* Maximum speed..............................RF4
*
* EXIT ARGUMENTS : Value of function at time T.................FN
* Error indicator...........................IERR
*
* CALLING SEQUENCE : FN=FUNC22(IKF,RFUNC,T,IERR)
*
* ERROR INDICATION : IERR < 0 --> An error has occurred
* -10 : Zero or negative maximum acceleration
* -15 : Zero or negative maximum speed
* -20 : Can not reach maximum speed
* before deacceleration
*
***********************************************************************
Author
Hans Petter Hildre 503914, NTH Institutt for maskinkonstruksjon
Date
27 Mar 1990
Here is the caller graph for this function:

◆ func4()

real(dp) function explicitfunctionsmodule::func4 ( integer, dimension(:), intent(in)  IFUNC,
real(dp), dimension(:), intent(in)  RFUNC,
real(dp), intent(in)  T,
real(dp), intent(in)  X,
integer, intent(inout)  IERR 
)

Complex sinusoidal function composed of many sine waves.

The following is from the original FORTRAN-77 documententation:

***********************************************************************
*
* PURPOSE : To describe a complex sinusoidal made up of
* an arbitrary number of sine waves with separate
* amplitudes, frequencies and phase shifts.
*
* ENTRY ARGUMENTS : Time.......................................T
* Position...................................X
* Number of sine waves, N .............IFUNC(3)
* Amplitude, A(i) ...................RFUNC(1,i)
* Angular frequency, omega(i) .......RFUNC(2,i)
* Phase shift, epsilon(i) ...........RFUNC(3,i)
*
* EXIT ARGUMENTS : Value of function at time T................F
* Error indicator.........................IERR
*
* CALLING SEQUENCE : FN=FUNC4(IFUNC,RFUNC,T,X,IERR)
*
* ERROR INDICATION : IERR
*
***********************************************************************
Author
Knut Morten Okstad
Date
16 Jan 2007
Here is the caller graph for this function:

◆ func5()

real(dp) function explicitfunctionsmodule::func5 ( integer, intent(in)  IKF,
integer, dimension(:), intent(in)  IFUNC,
real(dp), dimension(:), intent(in)  RFUNC,
real(dp), intent(in)  constT,
integer, intent(inout)  IERR 
)

Servo simulator function.

The following is from the original FORTRAN-77 documententation:

***********************************************************************
*
* PURPOSE : To describe a curve starting in 0.0 and varying
* linearly between -1.0 and 1.0.
*
* ENTRY ARGUMENTS : Time.......................................T
* Time incident for change in gradient.....RF1
* . . . . . . .
* Time incident for change in gradient.....RF8
*
* EXIT ARGUMENTS : Value of function at time T...............FN
* Error indicator.........................IERR
*
* CALLING SEQUENCE : FN=FUNC5(IKF,IFUNC,RFUNC,T,IERR)
*
* ERROR INDICATION : IERR < 0 --> Error has occurred
*
* NNN = 5 Negative starting time
* NNN = 10 2. change in grad. earlier than 1.
* NNN = 15 3. change in grad. earlier than 2.
* NNN = 20 4. change in grad. earlier than 3.
* NNN = 25 5. change in grad. earlier than 4.
* NNN = 30 6. change in grad. earlier than 5.
* NNN = 35 7. change in grad. earlier than 6.
* NNN = 40 8. change in grad. earlier than 7.
*
***********************************************************************
Author
Ole Ivar Sivertsen SINTEF avd. for maskinkonstruksjon
Date
1984
Here is the caller graph for this function:

◆ func6()

real(dp) function explicitfunctionsmodule::func6 ( integer, intent(in)  IKF,
integer, dimension(:), intent(in)  IFUNC,
real(dp), dimension(:,:), intent(in)  RFUNC,
real(dp), intent(in)  T,
integer, intent(inout)  IERR 
)

Spline function.

The following is from the original FORTRAN-77 documententation:

***********************************************************************
*
* PURPOSE : Computes a spline approximation of third order.
*
* ENTRY ARGUMENTS : Time.......................................T
* X(i) .........................RFUNC(2*i-1,j)
* Y(X) .........................RFUNC(2*i ,j)
*
* EXIT ARGUMENTS : Value of function at time T................F
* Error indicator.........................IERR
*
* CALLING SEQUENCE : FN=FUNC6(IKF,IFUNC,RFUNC,T,IERR)
*
***********************************************************************
Author
Ole Ivar Sivertsen SINTEF avd. for maskinkonstruksjon
Date
1984
Here is the caller graph for this function:

◆ func8()

real(dp) function explicitfunctionsmodule::func8 ( real(dp), dimension(:), intent(in)  RFUNC,
real(dp), intent(in)  T,
real(dp), intent(in)  X,
integer, intent(inout)  IERR 
)

Evaluates the streamline wave profile at point X and time T.

Parameters
[in]RFUNCWave data, output from wavefunctionsmodule::initfunc8
[in]TCurrent time
[in]XCurrent position
[out]IERRError indicator
Returns
Current wave height above z = 0
Author
Knut Morten Okstad
Date
9 May 2011
Here is the caller graph for this function:

◆ func9()

real(dp) function explicitfunctionsmodule::func9 ( integer, dimension(:), intent(in)  IFUNC,
real(dp), dimension(:), intent(in)  RFUNC,
real(dp), intent(in)  T,
real(dp), intent(in)  X,
integer, intent(inout)  IERR 
)

Evaluates the embedded wave profile at point X and time T.

Parameters
[in]IFUNCWave data, output from wavefunctionsmodule::initfunc9
[in]RFUNCWave data, output from wavefunctionsmodule::initfunc9
[in]TCurrent time
[in]XCurrent position
[out]IERRError indicator
Returns
Current wave height above z = 0
Author
Knut Morten Okstad
Date
14 May 2012
Here is the caller graph for this function:

◆ funcderivative1()

subroutine, private explicitfunctionsmodule::funcderivative1 ( integer, intent(in)  ikf,
integer, intent(in)  iorder,
integer, dimension(:), intent(in)  ifunc,
real(dp), dimension(:), intent(in)  rfunc,
real(dp), intent(in)  x,
real(dp), intent(out)  fn,
integer, intent(out)  ierr 
)
private

Evaluates the derivative of an explicit function.

Parameters
[in]ikfFunction identification number
[in]iorderDerivative order
[in]ifuncInteger function input parameters
[in]rfuncReal function input parameters
[in]xFunction argument
[out]fnDerivative of function
[out]ierrError indicator
Author
Knut Morten Okstad
Date
15 Dec 2005

◆ funcderivative2()

subroutine, private explicitfunctionsmodule::funcderivative2 ( integer, intent(in)  ikf,
integer, intent(in)  iorder,
integer, dimension(:), intent(in)  ifunc,
real(dp), dimension(:), intent(in)  rfunc,
real(dp), dimension(:), intent(in)  x,
real(dp), intent(out)  fn,
integer, intent(out)  ierr 
)
private

Evaluates the derivative of a multi-argument explicit function.

Parameters
[in]ikfFunction identification number
[in]iorderDerivative order
[in]ifuncInteger function input parameters
[in]rfuncReal function input parameters
[in]xFunction arguments
[out]fnDerivative of function
[out]ierrError indicator
Author
Knut Morten Okstad
Date
15 Oct 2009

◆ funcintegral()

subroutine explicitfunctionsmodule::funcintegral ( integer, intent(in)  ikf,
integer, intent(in)  iorder,
integer, dimension(:), intent(in)  ifunc,
real(dp), dimension(:), intent(in)  rfunc,
real(dp), intent(in)  x,
real(dp), intent(out)  fn,
integer, intent(inout)  ierr 
)

Integrates an explicit function from 0.0 to x.

Parameters
[in]ikfFunction identification number
[in]iorderIntegration order
[in]ifuncInteger function input parameters
[in]rfuncReal function input parameters
[in]xFunction arguments
[out]fnIntegral of function
[out]ierrError indicator
Author
Knut Morten Okstad
Date
15 Dec 2004
Here is the call graph for this function:

◆ funcvalue1()

subroutine, private explicitfunctionsmodule::funcvalue1 ( integer, intent(in)  ikf,
integer, dimension(:), intent(in)  ifunc,
real(dp), dimension(:), intent(in)  rfunc,
real(dp), intent(in)  x,
real(dp), intent(out)  fn,
integer, intent(inout)  ierr 
)
private

Evaluates an explicit function.

Parameters
[in]ikfFunction identification number
[in]ifuncInteger function input parameters
[in]rfuncReal function input parameters
[in]xFunction argument
[out]fnValue of function
[out]ierrError indicator
Author
Ole Ivar Sivertsen SINTEF avd. for maskinkonstruksjon
Date
1989

◆ funcvalue2()

subroutine, private explicitfunctionsmodule::funcvalue2 ( integer, intent(in)  ikf,
integer, dimension(:), intent(in)  ifunc,
real(dp), dimension(:), intent(in)  rfunc,
real(dp), dimension(:), intent(in)  x,
real(dp), intent(out)  fn,
integer, intent(inout)  ierr 
)
private

Evaluates an (possibly) multi-argument explicit function.

Parameters
[in]ikfFunction identification number
[in]ifuncInteger function input parameters
[in]rfuncReal function input parameters
[in]xFunction arguments
[out]fnValue of function
[out]ierrError indicator
Author
Knut Morten Okstad
Date
15 Oct 2009

◆ outofrangeerror()

subroutine, private explicitfunctionsmodule::outofrangeerror ( real(dp), intent(in)  X,
real(dp), intent(in)  X0,
real(dp), intent(in)  X1 
)
private

Prints an error message when function argument is out of range.

◆ rampintegral()

real(dp) function, private explicitfunctionsmodule::rampintegral ( integer, intent(in)  IORD,
real(dp), intent(in)  X,
real(dp), intent(in)  OFFSET,
real(dp), intent(in)  SLOPE,
real(dp), intent(in)  X0,
real(dp), intent(in), optional  X3 
)
private

Integrate a ramp function from 0.0 to X.

Parameters
[in]IORDIntegration order (1 or 2)
[in]XEnd point of integration
[in]OFFSETFunction value offset
[in]SLOPERamp slope
[in]X0Start point for ramp
[in]X3End point for ramp
Returns
Function integral at point X
Author
Knut Morten Okstad
Date
2006
Here is the caller graph for this function:

◆ splin3()

subroutine, private explicitfunctionsmodule::splin3 ( real(dp), dimension(:), intent(in)  X,
real(dp), dimension(:), intent(in)  Y,
real(dp), dimension(:,:), intent(inout)  DERIV,
integer, intent(in)  N,
real(dp), dimension(:), intent(in)  Z,
real(dp), dimension(:), intent(out)  FVALUE,
real(dp), dimension(:,:), intent(out)  FDERIV,
integer, intent(in)  M,
integer, intent(in)  IOP,
integer, intent(out)  IERR 
)
private

Computes a spline approximation from a set of points.

The following is from the original FORTRAN-77 documententation:

CERN LIBRARY PROGRAM NO E-209.
nummat library PROGRAM no e201.
revised version july 1973.
purpose : to compute a natural spline approximation of third
order for a FUNCTION y(X) given in the n points
(x(i),y(i)) , i=1...n.
parameters(in list).
x = an array storing the input arguments.dimension x(n).
y = an array storing the input FUNCTION values.the element
y(i) represent the FUNCTION value y(X) for x=x(I).
deriv = an array used for storing the computed derivatives of
the FUNCTION y(X).in deriv(I,1) and deriv(I,2) are
stored the first- and second-order derivatives of y(x)
for x=x(i) respectively.
n = number of input FUNCTION values.
z = an array storing the arguments for the interpolated
values to be computed.
fvalue = an array storing the computed interpolated values.
fvalue(j) represent the FUNCTION value fvalue(Z) for
z=z(j).
fderiv = an array used for storing the derivatives of the com-
puted interpolated values.explanation as for deriv.
m = number of interpolated values to be computed.
iop = option PARAMETER.for iop.LE.0 the derivatives for each
sub-interval in the spline approximation are computed.
<0, the second order END-POINT DERIVATIVES are
computed by linear extrapolation.
=0, the second order END-POINT DERIVATIVES ASSUMED to
be given.
=1, compute spline approximations for the arguments
given in the array z,the derivatives beeing
assumed to have been calculated in a previous call
on the routine.
ierr = error PARAMETER.
=0, no errors occurred.
=1, the number of points too small i.e. n less than 4.
=2, the arguments x(i) not in increasing order.
=3, argument to be used in interpolation above range.
=4, argument to be used in interpolation below range.
local variables(static).
secd1 = VALUE of the second derivative d2y(x)/dx2 for the
input argument x=x(1).
secdn = VALUE of the second derivative d2y(x)/dx2 for the
input argument x=x(n).
nb. values have to be assigned to secd1 and secdn in
the calling program.IF a natural spline fit is wanted,
put secd1=secdn=0.
vofint = computed approximation for the integral of y(x) taken
from x(1) to x(n).
nxy = n(see above),has to be stored for entries
corresponding to iop=1.

Variable Documentation

◆ compl_sinus_p

integer, parameter explicitfunctionsmodule::compl_sinus_p = 2

◆ constant_p

integer, parameter explicitfunctionsmodule::constant_p = 15

◆ dbgfunc

integer, save explicitfunctionsmodule::dbgfunc = 0

File unit number of debug print.

◆ delayed_compl_sinus_p

integer, parameter explicitfunctionsmodule::delayed_compl_sinus_p = 3

◆ device_function_p

integer, parameter explicitfunctionsmodule::device_function_p = 18

◆ dirac_puls_p

integer, parameter explicitfunctionsmodule::dirac_puls_p = 14

◆ dp

integer, parameter, private explicitfunctionsmodule::dp = kind(1.0D0)
private

8-byte real (double)

◆ epsarg_p

real(dp), parameter, private explicitfunctionsmodule::epsarg_p = 1.0e-15_dp
private

Argument tolerance.

◆ functype_p

character(len=19), dimension(maxfunc_p), parameter explicitfunctionsmodule::functype_p = (/ 'SINUSOIDAL ', 'COMPL_SINUS ', 'DELAYED_COMPL_SINUS', 'WAVE_SINUS ', 'LIN_VEL_VAR ', 'SPLINE ', 'WAVE_STOKES5 ', 'WAVE_STREAMLINE ', 'WAVE_EMBEDDED ', 'LIN_VAR ', 'RAMP ', 'STEP ', 'SQUARE_PULS ', 'DIRAC_PULS ', 'CONSTANT ', 'LIM_RAMP ', 'SCALE ', 'DEVICE_FUNCTION ', 'MATH_EXPRESSION ', 'MATH_EXPRESSION ', 'USER_DEFINED ', 'SMOOTH_TRAJ ' /)

Function type names.

◆ last

integer, dimension(nspln_p), save explicitfunctionsmodule::last = 0

Identifier for splines in core.

◆ lim_ramp_p

integer, parameter explicitfunctionsmodule::lim_ramp_p = 16

◆ lin_var_p

integer, parameter explicitfunctionsmodule::lin_var_p = 10

◆ lin_vel_var_p

integer, parameter explicitfunctionsmodule::lin_vel_var_p = 5

◆ math_expression_p

integer, parameter explicitfunctionsmodule::math_expression_p = 19

◆ maxfunc_p

integer, parameter explicitfunctionsmodule::maxfunc_p = 22

Number of function types.

◆ nspln_p

integer, parameter explicitfunctionsmodule::nspln_p = 6

Max. number of spline functions in core.

◆ pi

real(dp), parameter, private explicitfunctionsmodule::pi = 3.141592653589793238_dp
private

The value of π.

◆ ramp_p

integer, parameter explicitfunctionsmodule::ramp_p = 11

◆ scale_p

integer, parameter explicitfunctionsmodule::scale_p = 17

◆ sinusoidal_p

integer, parameter explicitfunctionsmodule::sinusoidal_p = 1

◆ smooth_traj_p

integer, parameter explicitfunctionsmodule::smooth_traj_p = 22

◆ spl

type(splinedata), dimension(nspln_p), save, private explicitfunctionsmodule::spl
private

Internal spline data buffer.

◆ spline_p

integer, parameter explicitfunctionsmodule::spline_p = 6

◆ square_puls_p

integer, parameter explicitfunctionsmodule::square_puls_p = 13

◆ step_p

integer, parameter explicitfunctionsmodule::step_p = 12

◆ twopi

real(dp), parameter, private explicitfunctionsmodule::twopi = PI+PI
private

The value of 2π.

◆ user_defined_p

integer, parameter explicitfunctionsmodule::user_defined_p = 21

◆ wave_embedded_p

integer, parameter explicitfunctionsmodule::wave_embedded_p = 9

◆ wave_sinus_p

integer, parameter explicitfunctionsmodule::wave_sinus_p = 4

◆ wave_stokes5_p

integer, parameter explicitfunctionsmodule::wave_stokes5_p = 7

◆ wave_streamline_p

integer, parameter explicitfunctionsmodule::wave_streamline_p = 8