0% found this document useful (0 votes)
227 views8 pages

Activity 3 Elementary Mathematical Functions in LabVIEW 1

The document discusses using mathematical functions in LabVIEW. It describes three learning activities focused on trigonometric, exponential, and hyperbolic functions. The first activity has students use trigonometric functions like sine, cosine, and tangent in LabVIEW to analyze data from a knob control. The second activity covers exponential functions such as exponential, logarithms, and powers. Students calculate function values for various inputs. The third activity introduces hyperbolic functions and has students connect them to indicators to display output values. The goal is for students to learn how to use different mathematical functions in LabVIEW for data analysis and modeling.

Uploaded by

Albert N Camacho
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
227 views8 pages

Activity 3 Elementary Mathematical Functions in LabVIEW 1

The document discusses using mathematical functions in LabVIEW. It describes three learning activities focused on trigonometric, exponential, and hyperbolic functions. The first activity has students use trigonometric functions like sine, cosine, and tangent in LabVIEW to analyze data from a knob control. The second activity covers exponential functions such as exponential, logarithms, and powers. Students calculate function values for various inputs. The third activity introduces hyperbolic functions and has students connect them to indicators to display output values. The goal is for students to learn how to use different mathematical functions in LabVIEW for data analysis and modeling.

Uploaded by

Albert N Camacho
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

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


windowMathematics. 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
MathematicsElementaryTrigonometric 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?


The VI works by getting the values of sine, cosine, tangent, secant, cosecant and cotangent
through the use of the Knob which giving the program the angle. So, it means that in every
inputted angle, the program displays the value of the six trigonometric functions.

Page 22
ECE 100 Fundamentals of LabVIEW Programming

(1.25) (0.56)

(0.56) (3.13

4. Consider the table below. Record the values of the six trigonometric functions for the given values below:

Input values SIN COS TAN CSC SEC COT


0.00 0 1 0 lnf 1 lnf
0.50 0.48 0.88 0.55 2.09 1.14 1.83
1.00 0.84 0.54 1.56 1.19 1.85 0.64
1.50 1 0.07 14.1 1 14.14 0.07
2.00 0.91 -0.42 -2.19 1.1 -2.4 -0.46
2.50 0.6 -0.8 -0.74 1.67 -1.25 -1.34
3.00 0.14 -1 -0.14 7.09 -1.01 -7.02

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?
Yes, there is a difference because in the calculator, it is in the degree mode while in the program the
values are in the radian mode.

Page 23
ECE 100 Fundamentals of LabVIEW Programming

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. Right-
Click anywhere in an empty

Space, go to Mathematics
ElementaryExponential
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
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 Natural
10 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

Page 24
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 Exponential and explain each function?

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:

Page 25
ECE 100 Fundamentals of LabVIEW Programming

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 sech coth
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.
Hyperbolic Sine – Computes the hyperbolic sine x.

Hyperbolic Cosine – Computes the hyperbolic cosine of x.

Hyperbolic Tangent- Computes the hyperbolic tangent of x.

Hyperbolic Cosecant - Computes the hyperbolic cosecant of x.

Hyperbolic Secant - Computes the hyperbolic secant of x.

Hyperbolic Cotangent - Computes the hyperbolic cotangent of x.

Page 26
ECE 100 Fundamentals of LabVIEW Programming

Question: What are the other functions under Hyperbolic Functions and explain each function?
Inverse Hyperbolic Sine – Computes the inverse hyperbolic sine x.

Inverse Hyperbolic Cosine – Computes the hyperbolic cosine of x.

Inverse Hyperbolic Tangent- Computes the inverse hyperbolic tangent of x.

Inverse Hyperbolic Cosecant - Computes the inverse hyperbolic cosecant of x.

Inverse Hyperbolic Secant - Computes the inverse hyperbolic secant of x.

Inverse Hyperbolic Cotangent - Computes the inverse hyperbolic cotangent of x.

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:

𝐿
𝑑 = 𝑎(𝑐𝑜𝑠ℎ − 1)
𝑎
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:

𝑥3 𝑥5 𝑥7 𝑥 2𝑛+1
𝑠𝑖𝑛ℎ𝑥 = 𝑥 + + + + ⋯ = ∑
3! 5! 7! (2𝑛 + 1)!
𝑛=0
While for the hyperbolic cosine is:

𝑥2 𝑥4 𝑥6 𝑥 2𝑛
𝑐𝑜𝑠ℎ𝑥 = 1 + + + + ⋯ = ∑
2! 4! 6! (2𝑛)!
𝑛=0
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
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?

Page 27
ECE 100 Fundamentals of LabVIEW Programming

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 28

You might also like