Thermal > Microfunction Library > Microfunction Library
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX''">XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX''">   
Microfunction Library
The following is a catalogue of the microfunctions that are available in the QTRAN Microfunction Library, as well as an explanation of the various input parameters which are required for each microfunction. Briefly, the microfunctions which are available are:
1. Constant
2. Power Series
3. Sine Wave
4. Square Wave
5. Step
6. Ramp
7. Exponential
8. Linear Interpolation of a User-Input Data Table
9. Hermite Polynomial Interpolation of a User-Input Data Table, with Quadratic Interpolation Etrapolation at the Data Table End-Points
10. Repeating Waveform: Linearly Interpolated Data Table
11. Repeating Waveform: Hermite Polynomial Interpolated Data Table
12. Natural Logarithm
13. Base 10 Logarithm
14. Blackbody Radiation (this function determines the fraction of blackbody radiant energy that lies between two wavelengths)
15. Flip/Flop
16. Dead Band (this function allows for hysteresis effects)
17. Straight Line
18. Indexed Linear Interpolation of a User-Input Data Table
19. Indexed Hermite Polynomial Interpolation of a User-Input Data Table, with Quadratic Interpolation/Extrapolation at the Data Table End-Points
20. Indexed Repeating Waveform: Linearly Interpolated Data Table
21. Indexed Repeating Waveform: Hermite Polynomial Interpolated Data Table
22. Repeating Flip/Flop
23-999 Reserved for Future Use (not currently implemented)
1000+ User-Coded (a function defined by a user-supplied subroutine UMICRO)
The variable X that is referred to in the following function explanations refers to the independent variable that you specify. As described in Microfunction Data, 322, the independent variable may be either the current time value, the temperature value of any node, the temperature difference between any two nodes, a radiosity difference, or the average temperature of any two nodes.
Microfunction Format
MFID, Independent Variable, and Function Type
 
MICRO(keyword)
MFID
ARGUMENT
OPTION
Example
MICRO	27	0	9
This begins a microfunction data packet for MFID 27, with 0 (time) as the independent argument, and option 9 (Hermite table) as the function type.
 
Parameter
Description
MFID
The MicroFunction Identification number. Each microfunction must be assigned a unique MFID number greater than zero. This MFID number will be referenced by the macrofunctions on (p. 325) through (p. 331) in the same manner as a material property ID number (MPID) is referenced by resistors and capacitors. This referencing scheme allows the same microfunction to be used in many different macrofunctions.
ARGUMENT
Identifies the microfunction independent variable as time, temperature (T), D T, radiosity difference or an average temperature according to the following argument code:
 
0 -- t (time)
1 -- T (temperature)
2 --
3 --
Notice: and are converted to absolute temperatures (i.e., Kelvin or Rankine, depending on the value of ICCALC) prior to raising them to the 4th power. This is done ONLY for ARGUMENT = 3.
4 -- (average temperature)
OPTION
Identifies the Function Library option that has been selected. For more information, consult the Function Library in Microfunction Options, 452. If the Function Library option number is entered as the negative of the option number (e.g., specify option 2 as option -2), QTRAN will use the reciprocal of the function. For example, SIN(X) would be evaluated as (1/SIN(X)).
 
Microfunction Options
Each microfunction option that is available is described below.
Option 1 - Constant
Option 1 is a constant of the following form:
F(X) = P1
where:  
P1 is the first MICDAT value entered for the microfunction. See Microfunction Parameters or Data Tables, 324.
For example, suppose microfunction 11 is defined to be a constant with a value of 23.7.
Example
MICRO	11	0	1
MICDAT	23.7
/
Option 2 - Power Series
Option 2 is a power series of the form:
... +
where:  
The MICDAT(1...N) are tabular input data that is supplied for the microfunction as outlined in Microfunction Parameters or Data Tables, 324.
For example, suppose microfunction number 12 is defined to be a temperature dependent power series of the following form.
Example
MICRO	12	1	2
MICDAT	1.2	1.5
MICDAT	83.7	0.3
MICDAT	0.1	4.731
/
Option 3 - Sine Wave
Option 3 is a sine wave input of the form:
where:  
P1, P2, P3, and P4 are the MICDAT(1) to MICDAT(4) parameters referred to in Microfunction Parameters or Data Tables, 324. The arguments (P2 * X + P3) are in radians.
For example, suppose microfunction 11 is defined to be a time dependent sine wave of the following form:
Example
MICRO	11	0	3
MICDAT	23.7	14.8E+03 	-18.7 	1.456E+03
/
Option 4 - Square Wave
Option 4 is a square wave input that is calculated in the following manner:
1. Calculate A, where: A = SIN(MICDAT(3) * X + MICDAT(4))
2. Calculate the square wave value F(X) such that:
F(X) = MICDAT(2) if A < 0, and
F(X) = MICDAT(1) if A = 0 or 0 < A,
where:  
MICDAT(1...4) are the MICDAT parameters referred to in Microfunction Parameters or Data Tables, 324. The argument of the sine function, (P3 * X + P4), is assumed to be in radians.
For example, suppose that you want to define microfunction 14 to be a time dependent square wave with a frequency of 18.7, a phase angle of 44.7, a maximum value of 0.17 and a minimum value of 0.14.
Example
MICRO	14	0	4
MICDAT	0.17	0.14	18.7	44.7
/
Option 5 - Step Function
Option 5 is a step function input that is calculated in the following manner:
1. F(X) = MICDAT(2) if X < MICDAT(1), and
2. F(X) = MICDAT(3) if X = MICDAT(1) or MICDAT(1) < X
where:  
MICDAT(1...N) correspond to the parameters referred to in Microfunction Parameters or Data Tables, 324.
For example, suppose microfunction 15 is defined to be a step function using temperature difference as the argument (remember that the node temperatures are defined by the calling macrofunction) and that the step function form is as follows:
IF (X < 11.78) THEN
F(X) = 84.89
ELSE
F(X) = -77.67
ENDIF
Example
MICRO	15	2	5
MICDAT	11.78	84.89	-77.67
/
Option 6 - Ramp Function
Option 6 is a ramp function input that is calculated in the following manner:
1. F(X) = MICDAT(3) if X < or = MICDAT(1)
1. F(X) = MICDAT(4) if MICDAT(2) < or = X
1. F(X) is linearly interpolated between MICDAT(3) and MICDAT(4) if MICDAT(1) < X < MICDAT(2)
where:  
MICDAT(1...N) correspond to the parameters referred to in Microfunction Parameters or Data Tables, 324.
For example, suppose microfunction 16 is defined to be a time-dependent ramp function of the following form:
 
IF (X < or = 10.0)
F(X) = 100.0
IF (20.0 < or = X)
F(X) = 200.
IF (10.0 < X < 20.0)
F(X) = INTERP(10.0, 100.0, 20.0, 200.0, X)
where:  
INTERP(10.0, 100.0, 20.0, 200.0, X) was a linear interpolation function.
Example
MICRO	16	0	6
MICDAT	10.0	20.0	100.0 	200.0
/
Option 7 - Exponential Function
Option 7 is an exponential function of the form:
F(X) = MICDAT(1) * EXP(MICDAT(2) * (X - MICDAT(3)) + MICDAT(4)
where:  
MICDAT(1...N) are the parameters referred to in Microfunction Parameters or Data Tables, 324.
For example, suppose microfunction 17 is to be defined to be an exponential function using the radiosity potential difference between two nodes as the argument with the exponential function having the following form:
 
Important:  
Here MICDAT(4) is zero.
Example
MICRO	17	3	7
MICDAT	0.17	-23.7	-273.15	0.0
/
Option 8 - Linear Interpolation of a Data Table
Option 8 results in the linear interpolation of a data table that is supplied and that corresponds directly to the table data referred to in Microfunction Parameters or Data Tables, 324. When ordered pairs of X and F(X) are entered for the MICDAT data, Option 8 will interpolate or extrapolate this data to determine the appropriate value of F(X). The data pairs must be entered in order of increasing values of X. If this is not done, error messages will be written to the output file and the program will terminate.
If Option 8 is used, at least two data pairs must be entered.
For example, suppose microfunction 18 is defined to be a temperature dependent data table of the following form:
 
Temperature (or X)
Microfunction Value
0.0
100.0
200.0
1000.7
0.0
17.3
84.9
987.9
Example
MICRO	18	1	8
MICDAT	0.0	0.0
MICDAT	100.0 	17.3
MICDAT	200.0	84.9
MICDAT	1000.7	987.9
/
Option 9 - Hermite Polynomial Interpolation of a Data Table
Option 9 is similar to Option 8 except that Hermite polynomials are used for interpolation wherever possible. Hermite polynomials are not used for the first and last intervals in the table or for extrapolation. Quadratic interpolation/extrapolation is used for these regions. Hermite polynomials guarantee both continuity of value for a function and continuity of slope. Linear interpolation would guarantee only continuity of value.
A table identical to the example can be defined for Option 8 (only using Hermite polynomial interpolation) with the following microfunction data:
Example
MICRO	18	1	9
MICDAT	0.0	0.0
MICDAT	100.0	17.3
MICDAT	200.0	84.9
MICDAT	1000.7	987.9
/
If Option 9 is used, at least three data pairs must be defined.
Option 10 - Repeating Waveform - Linearly Interpolated Data Table
Option 10 is identical to Option 8 except that no extrapolation from the table is allowed. Instead, the value of X is altered such that it falls between the smallest and largest table values. If the maximum table value of X is XMAX and the minimum table value of X is XMIN, an interval of X may be defined as follows.
INTERVAL = XMAX - XMIN
The value of X is then divided by INTERVAL, and the value of X is set equal to the remainder left by the division. This new value of X will fall between XMIN and XMAX and hence can be interpolated. This algorithm generates a repeating waveform defined by a data table that you enter. This function is especially useful, for example, to simulate solar insulation over a period of days. The heat input can be defined as a 24-hour cycle (repeating waveform) and can be input using Option 10.
For example, suppose that the problem involved a periodic heat source with a triangular pulse, with the base of the triangle at 0.0 heat units and the peak at 100.0 heat units. Suppose further that the triangle is symmetric about time = 50.0. The microfunction data for this function is as follows:
Example
MICRO	20	0	10
MICDAT	0.0	0.0
MICDAT	50.0	100.0
MICDAT	100.0	0.0
/
This particular wave begins at time = 0.0. To cause a phase shift, all you have to do is to change the time values. The function as defined above will repeat the triangular heat pulse every 100.0 seconds.
If Option 10 is used, at least two data pairs must be entered.
Option 11 - Repeating Waveform - Hermite Interpolated Data Table
Option 11 is a tabular repeating waveform similar to Option 10, except that the tabular waveform is interpolated using Hermite polynomials. Use this option if the function data is relatively smooth and to represent the function with relatively few data points. Option 11 is computationally more expensive than Option 10.
To define a Hermite polynomial interpolated waveform from the following tabular data.
 
Temperature (or X)
Microfunction Value
10.0
50.0
75.0
100.7
10.0
20.0
0.0
-10.0
Example
MICRO	21	1	11
MICDAT	10.0	10.0
MICDAT 	50.0	20.0
MICDAT	75.0	0.0
MICDAT	100.0	-10.0
/
If Option 11 is used, at least three data pairs must be entered.
Option 12 - Natural Logarithm Option
Option 12 is a natural logarithm function that is generated in the following manner:
F(X) = MICDAT(1) * Ln( MICDAT(2) * X + MICDAT(3) ) + MICDAT(4)
where:  
MICDAT(1...4) are the parameters referred to in Microfunction Parameters or Data Tables, 324.
When using any log function, exercise care that the argument does not become negative because a log function is undefined for negative arguments. If a log function argument does become negative, your computer will probably detect an arithmetic floating point error and terminate. QTRAN does not check for positive arguments.
For example, to define a time-dependent function of the following form.
Example
MICRO	22	0	12
MICDAT	17.7E-04	17.7 	123.4	1.0E-07
/
Option 13 - Base 10 Logarithm Option
Option 13 is identical to Option 12 except that a Base 10 logarithm is used instead of a natural logarithm. The function is defined as:
where:  
MICDAT(1...N) are the parameters referred to in Microfunction Parameters or Data Tables, 324.
When using any log function, exercise care that the argument does not become negative, because a log function is undefined for negative arguments. If a log function argument does become negative, the computer will probably detect an arithmetic floating point error and terminate. QTRAN does not check for positive arguments.
For example, to define a time-dependent function of the following form.
Example
MICRO	23	0	13
MICDAT	17.7E-04	17.7	123.4	1.0E-07
/
Option 14 - Blackbody Radiation Fraction Option
Option 14 calculates the fraction of a blackbody’s radiant energy that lies between two wavelengths. This fraction is calculated using formulas taken from Ref.  in Appendix A, p. 769. The function parameters are defined as follows:
 
MICDAT(1)
The shortest wavelength of the interval in units of micrometers.
MICDAT(2)
The longest wavelength of the interval in units of micrometers.
 
Important:  
The values of MICDAT(1) and MICDAT(2) must be such that MICDAT(1) < MICDAT(2).
Values for F(X,MICDAT(1),MICDAT(2)) will always be between the values of 0 and 1, inclusive.
The primary use of this microfunction option is to emulate QTRAN’s wavelength-dependent thermal radiation algorithm using a heat source.
Example
MICRO	101	1	14
MICDAT	0.2	0.6	
/
Option 15 - Flip/Flop Option
Option 15 allows a flip/flop function to be implemented of the following form:
IF (MICDAT(1) ð X <MICDAT(2) ) THEN
F(X) = MICDAT(3)
ELSE
F(X) = MICDAT(4)
ENDIF
where:  
The MICDAT(1...4) are the parameters referred to in Microfunction Parameters or Data Tables, 324. This function is typically used for time-dependent heat sources that may be turned on for only a definite period of time. As can be seen, a flip/flop function is really a kind of double step function that is fairly commonly encountered.
For example, to build a model where a heat source of 1000.0 units is turned on at time = 17.8 and turned off again at time = 19.2.
Example
MICRO	25	0	15
MICDAT	17.8	19.2	1000.0 	0.0
/
Option 16 - Dead Band
RESTRICTION: This microfunction option may only be used for temperature control macrofunctions. It may not be used for heat source macrofunctions.
With this function, a node’s temperature may be controlled in the following manner:
 
IF(MICDAT(2) < X < MICDAT(4) )
then T(X) = T (no change)
IF(X < MICDAT(2) )
then T(X) = MICDAT(1)
IF(MICDAT(4) < X)
then T(X) = MICDAT(3)
A common use of this function is a hysteresis switch for thermostats, where the position of the switch (on/off) is dependent not only upon the temperature of a node but also upon the node’s history. For example, consider the following thermostatically controlled heater at node 1.
where:  
1. If T1 < 60, heater is turned ON
2. If 80 < T1, heater is turned OFF
3. If 60 < T1 < 80, heater can be either ON or OFF depending upon the temperature history of T1
To build a thermostat, introduce another temperature node T2. T2 will not be a “real” temperature node but will instead be your hysteresis flag. T2’s temperature can be controlled with an Option 16 microfunction, letting the X of this microfunction be T1 and letting the MICDAT(1...4) values be 1.0, 60.0, 0.0, 80.0. Specifically we then have:
1. T2 = 1.0 if T1 < 60.0
2. T2 = 0.0 if T1 > 80.0
3. T2 = unchanged if 60.0 < T1 < 80.0
The thermostat control has been built, next build the heater. This can be done by using microfunction option 17 (straight line) with the independent variable X of this microfunction being T2. For example, to build a 1000-watt heater for node T1, use Option 17 with MICDAT(1) and MICDAT(2) values of 1000.0 and 0.0, respectively, where Option 17 is of the form:
F(X) = MICDAT(1) * X + MICDAT(2)
Since T2 is used for X in the Option 17 microfunction and T2 can only be 1.0 or 0.0 (according the microfunction that controls T2), a complete (though simple) thermostatically controlled heater has been built for node T1.
Example
MICRO	26	1	16
MICDAT	1.0	60.0	0.0	80.0 
/
See Option 17 for an example of a straight line microfunction.
Option 17 - Straight Line
Option 17 allows a straight line microfunction to be built of the following form:
F(X) =MICDAT(1) * X + MICDAT(2)
where:  
MICDAT(1) and MICDAT(2) are the parameters referred to in Microfunction Parameters or Data Tables, 324.
To build a straight line heat source such as the one described for the thermostatically controlled heater in the Option 16 example. This straight line heater has the form:
F(X) = 1000.0 * X + 0.0
Example
MICRO	27	1	17
MICDAT	1000.0	0.0
/
Option 18 - Indexed Linear Interpolation of a Data Table
Option 18 results in the linear interpolation of a data table that is supplied that corresponds directly to the table data referred to in Microfunction Parameters or Data Tables, 324. When ordered pairs of X and F(X) are entered for the MICDAT data, Option 18 will interpolate or extrapolate this data to determine the appropriate value of F(X). The data pairs must be entered in order of increasing values of X. If this is not done, error messages will be written to the output file and the program will terminate. This is identical to Option 8 except the table is entered at the point it last exited in an attempt to speed up execution.
If Option 18 is used at least two data pairs must be entered.
For example, suppose that you wish to define microfunction 28 to be a indexed temperature dependent data table of the following form:
 
Temperature (or X)
Microfunction Value
0.0
100.0
200.0
1000.7
0.0
17.3
84.9
987.9
Example
MICRO	28	1	18
MICDAT	0.0	0.0
MICDAT	100.0	17.3
MICDAT	200.0	84.9
MICDAT	1000.7	987.9
/
Option 19 - Indexed Hermite Polynomial Interpolation of a Data Table
Option 19 is similar to Option 18 except that Hermite polynomials are used for interpolation wherever possible. Hermite polynomials are not used for the first and last intervals in the table or for extrapolation. Quadratic interpolation/extrapolation is used for these regions. Hermite polynomials guarantee both continuity of value for a function and continuity of slope. Linear interpolation would guarantee only continuity of value.
A table identical to the example for Option 9 - Hermite Polynomial Interpolation of a Data Table, 459 can be defined (only using Hermite polynomial interpolation) with the following microfunction data. The only difference between Option 9 and 19 is the indexed table enters the table where it last exited. This is done to improve execution times.
Example
MICRO	18 	1	19
MICDAT	0.0	0.0
MICDAT	100.0	17.3
MICDAT	200.0	84.9
MICDAT	1000.7	987.9
/
If Option 19 is used, at least three data pairs must be entered.
Option 20 - Indexed Repeating Waveform - Linearly Interpolated Data Table
Option 20 is identical to Option 18 except that no extrapolation from the table is allowed. Instead, the value of X is altered such that it falls between the smallest and largest table values. If the maximum table value of X is XMAX and the minimum table value of X is XMIN, an interval of X may be defined as follows.
INTERVAL = XMAX - XMIN
The value of X is then divided by INTERVAL, and the value of X is set equal to the remainder left by the division. This new value of X will fall between XMIN and XMAX and hence can be interpolated. This algorithm generates a repeating waveform defined by a data table that you enter. This function is especially useful, for example, to simulate solar insulation over a period of days. The heat input can be defined as a 24-hour cycle (repeating waveform) and can be input using Option 20. The data table is entered at the point that it last exited to help speedup execution.
For example, suppose that you wished to build a periodic heat source with a triangular pulse, with the base of the triangle at 0.0 heat units and the peak at 100.0 heat units. Suppose further that the triangle is symmetric about time = 50.0.
Example
MICRO 	201	0	20
MICDAT	0.0	0.0
MICDAT	50.0	100.0
MICDAT	100.0	0.0
/
This particular wave begins at time = 0.0. To cause a phase shift, change the time values. The function as defined above will repeat the triangular heat pulse every 100.0 seconds.
If Option 20 is used, at least two data pairs must be entered.
Option 21 - Indexed Repeating Waveform - Hermite Interpolated Data Table
Option 21 is a tabular repeating waveform similar to Option 20, except that the tabular waveform is interpolated using Hermite polynomials. Use this option if the function data is relatively smooth to represent the function with relatively few data points. Option 21 is computationally more expensive than Option 20. The data table is entered at the point that it last exited in order to speedup execution.
For example; to define a Hermite polynomial interpolated waveform from the tabular data below, use the following microfunction data.
 
Temperature (or X)
Microfunction Value
10.0
50.0
75.0
100.0
10.0
20.0
0.0
-10.0
Example
MICRO	123	1	21
MICDAT	10.0	10.0
MICDAT	50.0	20.0
MICDAT	75.0	0.0
MICDAT	100.0	-10.0
/
If Option 21 is used, at least three data pairs must be entered.
Option 22 - Repeating Flip/Flop Option
Option 22 allows a flip/flop function to be implemented of the following form:
IF (MICDAT(2) X <MICDAT(3) ) THEN
F(X) = MICDAT(5)
ELSE
F(X) = MICDAT(6)
ENDIF
PERIOD = MICDAT(4) - MICDAT(1)
where:  
The MICDAT(1...5) are the parameters referred to in Microfunction Parameters or Data Tables, 324. This function is typically used for time-dependent heat sources that may be turned on and off for only a definite periods of time. As can be seen, a repeating flip/flop function is really a kind of double step function that can be turned on and off at repeatedly but can have different on and off time periods. The period is P4 - P1.
For example, to build a model where a heat source of 1000.0 units is turned on between 19.2 and 26.4 second and repeated every 22.2 where the cycle begins at 17.8 seconds, the inputs would be as define below.
Example
MICRO	25	0	15
MICDAT	17.8	19.2	26.4	40.0	1000.0 	0.0
/
Option 1000+ - User-Coded Functions
Option 1000+ allows unique special case functions to be defined through a user-coded subroutine named UMICRO. A dummy version of subroutine UMICRO may be found in the ULIB.FOR file supplied with Patran Thermal, along with example applications.
Whenever an OPTION number of 1000 or larger is used for a microfunction, QTRAN will call subroutine UMICRO. This allows a library to be built and maintained of a very exotic special case heat source or temperature control functions. With UMICRO, any of the QTRAN parameters or arrays may be accessed, since all arrays and all important parameters are contained in named common blocks.
For example, microfunction 199 could be used to be a time dependent microfunction with the following data:
Example
MICRO	199	0	1000
MICDAT	0.0	273.0
	1.0	375.0
	2.0 	376.0 
	100.0 	390.0
	101.0	-37.36
	115.0	27.0
 
Any macrofunction in the model that references MFID 199 will now return a value from the user-supplied subroutine UMICRO.