Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

ECE 100 Fundamentals of LabVIEW Programming

MATHEMATICAL FUNCTIONS in LABVIEW


Activity No. 3
I. INTENDED LEARNING OUTCOMES
At the end of this activity, the student shall be able to:
1. Enumerate the Mathematical Functions in LabVIEW and discuss its functions.
2. Use the Mathematical Functions of LabVIEW to analyze set of data according to set
criteria.
3. Apply mathematical functions in LabVIEW to create a useful VI.
II. BACKGROUND INFORMATION
The previous activity has focused in the development of LabVIEW program using basic arithmetic,
comparison and Boolean functions. This activity is a one-level higher continuation of Activity No. 2 which
will be focusing on the use of elementary mathematical functions of LabVIEW. The elementary and special
functions in LabVIEW include trigonometric, exponential, hyperbolic functions but not limited to discrete
mathematics, Bessel functions, linear algebra, curve fitting, interpolation, extrapolation and optimization.
LabVIEW can be used to interpret data that require the use and application of higher mathematical
operations. A number of engineering design and analysis depends on how data will be treated. Say for
instance, a set of data coming from a controlled experiment is tabulated and then plotted against the x and
y axes. The programmer then noticed that the data points obtained are scattered everywhere in the plane.
Mathematically, these data are remained untreated such that they cannot be evaluated directly by
modelling the behaviour of experiment as a mathematical equation. To easily interpret these data, curve
fitting may be employed. This means that the scattered data points may be represented closely by a
geometric function including linear, polynomial and cubic function.
Another application that a LabVIEW platform can administer is optimization. This technique is used
to select the best possible elements in a group of data depending on a given criteria. For example, a metal
can factory wants to design a can for preserved foods. Using the optimization techniques in LabVIEW the
company can decide on how much dimensions of the can will give them the minimum cost of production
with maximum capacity as much as possible.
LabVIEW also offers tools for statistics. It includes measures of central tendency like mean,
median and mode. Might as well, LabVIEW has the ability to interpret complex function, mathematical
functions containing real and imaginary elements.
To access the above functions, right-click anywhere in the block diagram
windowMathematics. All functions that are not mentioned previously are located in that menu. To use
the said functions, everyone should have a strong foundation in Engineering Mathematics including
Algebra, Geometry, Calculus, Differential Equations, Advanced Engineering Mathematics, Probability and
Statistics, Linear Algebra and Discrete Mathematics.

Page 21

ECE 100 Fundamentals of LabVIEW Programming


III. LEARNING ACTIVITIES
ACTIVITY 3.1: TRIGONOMETRIC FUNCTIONS
1. Open LabVIEW 2012 and let the Front Panel and Block Diagram windows appear. On the Block
diagram
window,
right-click
anywhere
in
the
empty
space
and
choose
MathematicsElementaryTrigonometric and drag and drop the six basic trigonometric functions sin,
cos, tan, csc, sec and cot.
2. On the Front Panel window, drag and drop a Knob control and connect the Knob control output node
to the input nodes of the trigonometric functions. Change the scale of the Knob control from 0 (minimum)
to 3.5 (maximum). Put Numeric Indicators for the output of the corresponding trigonometric function. Save
your VI as Act3_1_1.VI

3. Click on the Run Continuously button and adjust the control knob as follows:
a. 1.25
c. 1.57
b. 0.56
d. 3.13
Question: Explain how the VI works?

Page 22

ECE 100 Fundamentals of LabVIEW Programming


4. Consider the table below. Record the values of the six trigonometric functions for the given values below:
Input values
0.00
0.50
1.00
1.50
2.00
2.50
3.00

SIN

COS

TAN

CSC

SEC

COT

5. Verify using your scientific calculator in DEGREE mode the values recorded on the table above.
Question: Compare the results of the values tabulated above with the values you have computed
using your scientific calculator. Is there any difference in the value? If there is a difference, why do
you think so?

6. Modify the VI such that the value on your program and scientific calculator matches without omitting
the values of control knob. Save the modified VI as Act3_1_2.VI. SCREEN-CAPTURE the Front Panel
and Block Diagram for this procedure and include it in your activity report.
ACTIVITY 3.2: EXPONENTIAL FUNCTIONS
1. Clear the Front Panel and the Block Diagram from the
previous activity done. Create a Front Panel VI as shown
below: Save VI as Act3_2_1.VI
2. On the Block Diagram
Window, drag and drop
Exponential functions. RightClick anywhere in an empty
Space, go to Mathematics
ElementaryExponential
And drag and drop the ff:
a. Exponential
b. Exponential Arg (-1)
c. Power of 10
d. Power of 2
e. Logarithm Base-10
f. Natural Logarithm
Page 23

ECE 100 Fundamentals of LabVIEW Programming


3. Connect the Exponential function to Numeric Indicator labelled as Output 1. Connect Exponential
Arg (-1) to Numeric Indicator labelled as Output 2. Connect the other functions in their respective
indicators following the sequence from c to f in the previous page.
4. Consider the table below. Record the values for the given values below:
Input values Exponential

Exp Arg (-1)

Power of 10

Power of 2

Log Base
10

Natural
Logarithm

0.00
0.50
1.00
1.50
2.00
2.50
3.00
3.50
4.00
4.50
5.00
5.50
6.00
6.50
7.00
7.50
8.00
8.50
9.00
9.50
10.00
Question: Explain each functions used in the calculation of the tables given above.

Question: What are the other functions under Exponential and explain each function?

Page 24

ECE 100 Fundamentals of LabVIEW Programming


ACTIVITY 3.3: EXPONENTIAL FUNCTIONS
1. Clear the Front Panel and the Block Diagram from the previous activity done. Create a Front Panel VI
as shown below:

2. On the Block Diagram, drag and drop the six hyperbolic functions and connect to its numeric indicator
labeled Output 1 to Output 6 respectively. The hyperbolic functions in sequence should be sinh, cosh,
tanh, sech, csch, coth respectively. Save your VI as Act3_3_1.VI
3. Consider the table below. Record the values for the given values below:
Input values
sinh
cosh
tanh
csch
0.00
0.50
1.00
1.50
2.00
2.50
3.00
3.50
4.00
4.50
5.00
5.50
6.00
6.50
7.00

sech

tanh

Page 25

ECE 100 Fundamentals of LabVIEW Programming


7.50
8.00
8.50
9.00
9.50
10.00
Question: Explain each functions used in the calculation of the tables given above.

Question: What are the other functions under Hyperbolic Functions and explain each function?

IV. MACHINE PROBLEM


1. Given the following equations for a catenary
Where s is half of the rope length, a is the parameter related to the mass of the rope and the acceleration
due to gravity, and L is half the distance of the posts supporting the rope. The sag of the rope is given as:

Create a VI that will allow to compute the value of d for each of the given s and L from 0 to 1000. Use
a dedicated control knob and customize your VI. Save your VI as MacPro3_1.VI
2. The Taylor Series expansion for the hyperbolic sine function is given as:

While for the hyperbolic cosine is:

Where n is the number of terms to be added to the series. Create a VI that would compute the sum of the
first ten terms of the Taylor Series expansion for the hyperbolic sine and hyperbolic cosine of an input x,
calling this VI as HypTaylor.VI
Page 26

ECE 100 Fundamentals of LabVIEW Programming


V. ASSESSMENT TASKS
1. What are the other Mathematics functions in LabVIEW apart from Trigonometric, Exponential and
Inverse Hyperbolic functions? Enumerate their functions and define when they can be used?

2. What is the importance of having Mathematical functions in creating a program using LabVIEW?

3. When using a trigonometric function such that you want to compute for the six trigonometric functions of
a given angle, how does LabVIEW interpret your input value?

4. Can we use the Mathematical functions of LabVIEW in the operation of an external device from the
platform itself? How and why?

VI. CONCLUSION
VII. RUBRICS FOR LABORATORY PERFORMANCE

Page 27

You might also like