Adams Basic Package > Adams View > View Command Language > panel > panel set twindow_function akima_spline

panel set twindow_function akima_spline

The AKIMA_SPLINE function uses the AKIMA method of interpolation to create a spline function across a set of data points.

Format:

 
panel set twindow_function akima_spline
x =
function
z =
function
spline_name =
an existing spline
derivative_order =
integer

Example:

 
panel set twindow_function akima_spline &
panel set twindow_function cubic_spline spline_name =
spline_1 &
panel set twindow_function cubic_spline derivative_order =
2

Description:

 
Parameter
Value Type
Description
x
FUNCTION
Specifies the real variable that is the independent variable value along the x-axis of the spline.
z
FUNCTION
Specifies a real variable that is the second independent variable value along the z-axis of the surface being interpolated
spline_name
AN EXISTING SPLINE
Specifies an existing spline
derivative_order
INTEGER
An optional integer that specifies the order of the derivative at the interpolate value to be returned by CUBSPL.

Range: 0 < iord < 2

Extended Definition:

1. The data points to be interpolated are defined in the SPLINE element in your Adams model. The SPLINE that you define may represent a curve ( x-y points) or a surface (x-y-z points). Interpolation in the y direction is cubic, and interpolation in the z direction is linear.
The AKIMA_SPLINE function is very fast, since it uses local methods. It always produces good results for the value of the function being approximated. The AKIMA_SPLINE returns good estimates for the first derivative of the approximated function when the data points are evenly spaced. In instances where the data points are unevenly spaced, the estimate of the first derivative may be in error. In all cases, the second derivative of the function being approximated is unreliable.
2. This variable can be any value of interest that you can compute using a function expression.
To enter a function expression you enter a series of quoted strings.
The easiest way to enter a function expression in Adams View is to use the text editor in combination with the function builder. To invoke the text editor for entering a function expression, highlight the function field and then either pick the "EDIT" button at the top of the panel or type a ^t (control-t). The Adams View "function builder" is discussed below.
The syntactical correctness of a function expression can be investigated by using the "VERIFY" button at the upper right of the text editor. If there is a syntax error, a message is printed and the cursor is put near the problem. Proper unit consistency is not checked during function expression verification.
The remainder of this explanation will cover the components of FUNCTION expressions as summerized in the following table.
 
Components
Examples
FUNCTION = 1E2 + 3.4 + 6
FUNCTION = 3*6/2 + 3 - 2**2
FUNCTION = PI + 20
FUNCTION = AX(1040, 2010)
FUNCTION = IF(DX(3, 5): -1, 0, 1)
FUNCTION = ABS(NUM) - 6
FUNCTION = 1 + 2
FUNCTION = 1 + 1 + 1 + 1 + 1 + 1 , + 1 + 1 + 1 + 1 + 1 + 1 + 1
FUNCTION = POLY(0, 0, 6.28)
NUMBERS
FUNCTION expressions can include integers, real numbers, and exponents. In other words, all numbers that are legal in Adams are legal in a FUNCTION expression.
OPERATORS
In a FUNCTION expression, Adams allows any of the operators **, *, /, +, and -. Adams executes these operators according to the following precedence rules:
From the greatest to the least, the operators have the following priorities. ** then * / then + -. In other words, Adams executes exponentiation (**) before all other operators and executes multiplication (*) and division (/) before addition (+) and subtraction (-).
When a statement has operators of the same priority, Adams executes them from left to right.
You can use parentheses to alter the precedence of operators. For example, in the equation,
FUNCTION = (1-TIME)*30/PI
Adams subtracts TIME from one before it performs multiplication and division.
SYSTEM CONSTANTS
You can include the following system constants in a FUNCTION expression:
PI Value of pi (to eighteen significant digits)
DTOR Value of pi/180 for converting degrees to radians
RTOD Value of 180/pi for converting radians to degrees
The following example of a FUNCTION with a system constant multiplies the system constant PI by the displacement of marker 10 with respect to marker 14:
FUNCTION = PI*DM(10,14)
BLANKS
A FUNCTION expression can contain any number of blank spaces. Five consecutive blank spaces in an expression do not terminate input of the expression (by indicating that what follows is a comment) as they do in an Adams statement. However, you should remember these two restrictions:
You cannot put a blank space in the middle of a number.
Adams does not accept a blank space between a function and its left bracket. (This is true for both, FORTRAN-77 functions and Adams functions.)
CONTINUATION COMMAS
You can use a comma to continue FUNCTION expressions. You can break the expression anywhere except in the middle of a number, in the middle of a name, or between a function and its left bracket. Put a continuation comma in column one of the following line before the rest of the expression. If you break the expression at a comma that is part of the expression, you must use both the expression comma and the continuation comma. You may use more than one continuation comma to extend an expression over several lines.
FUNCTION BUILDER
The FUNCTIONS button at the right side of the Adams View text editor provides a means of constructing an Adams function string. These functions are briefly described below. Upon picking the FUNCTIONS button, you will be presented with the list of available functions in the "selection window". After you select the desired function, a panel will appear with fields representing the various parameters for the function. You will have full access to on-line help with this panel just like you have with regular panels. After you have completed the panel and selected the DONE button on the panel, the function string will be constructed and inserted at the current text cursor location in the text edit window.
SYSTEM VARIABLES
A FUNCTION expression may access the current value of a system variable and use the value in computations. These values are accessed through a collection of functions. The accessible system variables include the following: Time, Mode, Displacements (Translational and Rotational), Velocities (Translational and Rotational), Accelerations (Translational and Rotational), Forces (Translational and Rotational), and User-defined variables. Invoke the text edit window and pick the FUNCTIONS button to get a list of functions that can be accessed.
In general, you use a function character string (such as DM, VX, or FZ) and a list of values (e.g. i1, i2, and i3) to access a system variable in an expression. For example, the value i1 may be the name of the marker for which you want to measure a quantity (such as displacement, velocity, acceleration, or force), i2 is the name of the marker with respect to which you want to measure the quantity, and i3 is the name of the marker you want to use to resolve the components of the quantity. If you do not specify marker i3, Adams computes the result in the ground reference frame.
ARITHMETIC IFS
Arithmetic IFs allow you to conditionally define FUNCTION. The format for arithmetic IFs is as follows:
IF (expression 1: expression 2, expression 3, expression 4)
Adams evaluates expression 1. If expression 1 is less than zero, the arithmetic IF equals expression 2; if expression 1 equals zero, the arithmetic IF equals expression 3; and if expression 1 is greater than zero, the arithmetic IF equals expression 4.
A FUNCTION expression with an arithmetic IF and its four expressions is as given below:
FUNCTION = 6 * IF(VR(10,31): 0 , 0 , 100)
If the radial velocity between markers 10 and 31 is less than or equal to zero, the value of the FUNCTION expression is zero; but if the radial velocity between markers 10 and 31 is greater than zero, the value of the FUNCTION expression is six hundred.
In some ways, you may treat IF as a variable. For example, you can place it anywhere in the expression. In addition, you can nest arithmetic IFs nine levels deep.
FORTRAN-77 FUNCTIONS
You can use the FORTRAN functions ABS, ATAN, ATAN2, COS, EXP, LOG, LOG10, MIN, MAX, SIN, SQRT, and TAN in your expression. For more information about these functions, see a FORTRAN reference manual. Invoke the text edit window and pick the FUNCTIONS button to get a list of functions that can be accessed.
Adams FUNCTIONS
In general, an Adams function evaluates a mathematical equation and returns a value to your FUNCTION expression. The following table lists all the Adams functions and their purposes. Invoke the text edit window and pick the FUNCTIONS button to make a list of functions that can be accessed.
 
Names
Purposes
AKISPL
Accesses the data in a SPLINE statement and uses the Akima cubic method to fit a cubic curve (a spline) to the data.
BISTOP
Evaluates a force restricting displacement of a part in two opposite directions
CHEBY
Evaluates a Chebyshev polynomial
CUBSPL
Accesses the data in a SPLINE statement and uses the traditional cubic method to fit a cubic curve (a spline) to the data.
FORCOS
Evaluates a Fourier cosine series
FORSIN
Evaluates a Fourier sine series
HAVSIN
Evaluates a haversine function
IMPACT
Evaluates a force restricting displacement of a part in one direction
POLY
Evaluates a polynomial
SHF
Evaluates a simple harmonic function
STEP
Approximates a step function with a cubic polynomial.
3. If the SPLINE defines only one curve, Adams ignores this parameter.
To enter a function expression you enter a series of quoted strings.
The easiest way to enter a function expression in Adams View is to use the text editor in combination with the function builder. To invoke the text editor for entering a function expression, highlight the function field and then either pick the "EDIT" button at the top of the panel or type a ^t (control-t). The Adams View "function builder" is discussed below.
The syntactical correctness of a function expression can be investigated by using the "VERIFY" button at the upper right of the text editor. If there is a syntax error, a message is printed and the cursor is put near the problem. Proper unit consistency is not checked during function expression verification.
The remainder of this explanation will cover the components of FUNCTION expressions as summerized in the following table.
 
Components
Examples
FUNCTION = 1E2 + 3.4 + 6
FUNCTION = 3*6/2 + 3 - 2**2
FUNCTION = PI + 20
FUNCTION = AX(1040, 2010)
FUNCTION = IF(DX(3, 5): -1, 0, 1)
FUNCTION = ABS(NUM) - 6
FUNCTION = 1 + 2
FUNCTION = 1 + 1 + 1 + 1 + 1 + 1 , + 1 + 1 + 1 + 1 + 1 + 1 + 1
FUNCTION = POLY(0, 0, 6.28)
NUMBERS
FUNCTION expressions can include integers, real numbers, and exponents. In other words, all numbers that are legal in Adams are legal in a FUNCTION expression.
OPERATORS
In a FUNCTION expression, Adams allows any of the operators **, *, /, +, and -. Adams executes these operators according to the following precedence rules:
From the greatest to the least, the operators have the following priorities. ** then * / then + -. In other words, Adams executes exponentiation (**) before all other operators and executes multiplication (*) and division (/) before addition (+) and subtraction (-).
When a statement has operators of the same priority, Adams executes them from left to right.
You can use parentheses to alter the precedence of operators. For example, in the equation,
FUNCTION = (1-TIME)*30/PI
Adams subtracts TIME from one before it performs multiplication and division.
SYSTEM CONSTANTS
You can include the following system constants in a FUNCTION expression:
PI Value of pi (to eighteen significant digits)
DTOR Value of pi/180 for converting degrees to radians
RTOD Value of 180/pi for converting radians to degrees
The following example of a FUNCTION with a system constant multiplies the system constant PI by the displacement of marker 10 with respect to marker 14:
FUNCTION = PI*DM(10,14)
BLANKS
A FUNCTION expression can contain any number of blank spaces. Five consecutive blank spaces in an expression do not terminate input of the expression (by indicating that what follows is a comment) as they do in an Adams statement. However, you should remember these two restrictions:
You cannot put a blank space in the middle of a number.
Adams does not accept a blank space between a function and its left bracket. (This is true for both, FORTRAN-77 functions and Adams functions.)
CONTINUATION COMMAS
You can use a comma to continue FUNCTION expressions. You can break the expression anywhere except in the middle of a number, in the middle of a name, or between a function and its left bracket. Put a continuation comma in column one of the following line before the rest of the expression. If you break the expression at a comma that is part of the expression, you must use both the expression comma and the continuation comma. You may use more than one continuation comma to extend an expression over several lines.
FUNCTION BUILDER
The FUNCTIONS button at the right side of the Adams View text editor provides a means of constructing an Adams function string. These functions are briefly described below. Upon picking the FUNCTIONS button, you will be presented with the list of available functions in the "selection window". After you select the desired function, a panel will appear with fields representing the various parameters for the function. You will have full access to on-line help with this panel just like you have with regular panels. After you have completed the panel and selected the DONE button on the panel, the function string will be constructed and inserted at the current text cursor location in the text edit window.
SYSTEM VARIABLES
A FUNCTION expression may access the current value of a system variable and use the value in computations. These values are accessed through a collection of functions. The accessible system variables include the following: Time, Mode, Displacements (Translational and Rotational), Velocities (Translational and Rotational), Accelerations (Translational and Rotational), Forces (Translational and Rotational), and User-defined variables. Invoke the text edit window and pick the FUNCTIONS button to get a list of functions that can be accessed.
In general, you use a function character string (such as DM, VX, or FZ) and a list of values (e.g. i1, i2, and i3) to access a system variable in an expression. For example, the value i1 may be the name of the marker for which you want to measure a quantity (such as displacement, velocity, acceleration, or force), i2 is the name of the marker with respect to which you want to measure the quantity, and i3 is the name of the marker you want to use to resolve the components of the quantity. If you do not specify marker i3, Adams computes the result in the ground reference frame.
ARITHMETIC IFS
Arithmetic IFs allow you to conditionally define FUNCTION. The format for arithmetic IFs is as follows:
IF (expression 1: expression 2, expression 3, expression 4)
Adams evaluates expression 1. If expression 1 is less than zero, the arithmetic IF equals expression 2; if expression 1 equals zero, the arithmetic IF equals expression 3; and if expression 1 is greater than zero, the arithmetic IF equals expression 4.
A FUNCTION expression with an arithmetic IF and its four expressions is as given below:
FUNCTION = 6 * IF(VR(10,31): 0 , 0 , 100)
If the radial velocity between markers 10 and 31 is less than or equal to zero, the value of the FUNCTION expression is zero; but if the radial velocity between markers 10 and 31 is greater than zero, the value of the FUNCTION expression is six hundred.
In some ways, you may treat IF as a variable. For example, you can place it anywhere in the expression. In addition, you can nest arithmetic IFs nine levels deep.
FORTRAN-77 FUNCTIONS
You can use the FORTRAN functions ABS, ATAN, ATAN2, COS, EXP, LOG, LOG10, MIN, MAX, SIN, SQRT, and TAN in your expression. For more information about these functions, see a FORTRAN reference manual. Invoke the text edit window and pick the FUNCTIONS button to get a list of functions that can be accessed.
Adams FUNCTIONS
In general, an Adams function evaluates a mathematical equation and returns a value to your FUNCTION expression. The following table lists all the Adams functions and their purposes. Invoke the text edit window and pick the FUNCTIONS button to make a list of functions that can be accessed.
 
Names
Purposes
AKISPL
Accesses the data in a SPLINE statement and uses the Akima cubic method to fit a cubic curve (a spline) to the data.
BISTOP
Evaluates a force restricting displacement of a part in two opposite directions
CHEBY
Evaluates a Chebyshev polynomial
CUBSPL
Accesses the data in a SPLINE statement and uses the traditional cubic method to fit a cubic curve (a spline) to the data.
FORCOS
Evaluates a Fourier cosine series
FORSIN
Evaluates a Fourier sine series
HAVSIN
Evaluates a haversine function
IMPACT
Evaluates a force restricting displacement of a part in one direction
POLY
Evaluates a polynomial
SHF
Evaluates a simple harmonic function
STEP
Approximates a step function with a cubic polynomial.
4. You identify a spline by typing its name. If you created the spline by reading an Adams data set, the spline name is the letters SPL followed by the Adams data set spline ID number. The name of Adams SPLINE/101 is SPL101, for example. If you created the spline during preprocessing, you gave it a name at that time.
If a spline is available by default, you may identify it by entering its name only. If it is not, you must enter its full name. To identify a spline under another model, for instance, you may need to enter the model name as well. For example, you may specify spline 'stiffness' from model 'suspension' by entering ".suspension.stiffness". If you type a "?", Adams View will list the splines available by default.

Cautions:

1. You must separate multiple spline names by commas.