0% found this document useful (0 votes)
100 views

Activity 3 Elementary Mathematical Functions in LabVIEW

The document describes an activity on using mathematical functions in LabVIEW. It has three main learning outcomes: 1) to understand the mathematical functions in LabVIEW, 2) to use them to analyze data according to criteria, and 3) to apply them to create useful VIs. The activity focuses on using trigonometric, exponential, and other functions. It provides examples of using sin, cos, and other trig functions with a knob control to generate outputs. It also demonstrates using exponential, logarithmic, and other functions with numeric indicators to display outputs. The goal is for students to learn how to use mathematical functions in LabVIEW for tasks like data analysis, curve fitting, optimization, and more.

Uploaded by

DENNREC SUNGA
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)
100 views

Activity 3 Elementary Mathematical Functions in LabVIEW

The document describes an activity on using mathematical functions in LabVIEW. It has three main learning outcomes: 1) to understand the mathematical functions in LabVIEW, 2) to use them to analyze data according to criteria, and 3) to apply them to create useful VIs. The activity focuses on using trigonometric, exponential, and other functions. It provides examples of using sin, cos, and other trig functions with a knob control to generate outputs. It also demonstrates using exponential, logarithmic, and other functions with numeric indicators to display outputs. The goal is for students to learn how to use mathematical functions in LabVIEW for tasks like data analysis, curve fitting, optimization, and more.

Uploaded by

DENNREC SUNGA
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/ 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 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 . 2 5
b. 0.56 d. 3.13

Question: Explain how the VI works?


Whenever you move the knob for your desired input, it will immediately compute for its respective value
for sin, cos, tan, sec, csc, and cot by means of Trigonometric Functions that can be found in the block
diagram. For it to work, each Trigonometric Function should be wired to their respective Numeric Indicator
and wired all together into the Knob labelled Input Angle.

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


Page 22
ECE 100 Fundamentals of LabVIEW Programming

0.00 0 1 0 Inf 1 Inf


0.50 0.480195 0.877162 0.547442 2.08249 1.14004 1.82668
1.00 0.842206 0.539156 1.56208 1.18736 1.85475 0.640172
1.50 0.997547 0.0699952 14.2516 1.00246 14.2867 0.0701673
2.00 0.908591 -0.417687 -2.17529 1.10061 -2.39414 -0.459709
2.50 0.598353 -0.801233 -0.74679 1.67125 -1.24808 -1.33906
3.00 0.139273 -0.990254 -0.140644 7.18014 -1.00984 -7.11017

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?
There is a difference when comparing the value calculated from the calculator and from the LabView
since in LabVIEW, it is set in RADIAN mode rather than DEGREE mode. This is the reason as to why
there is a significant difference of their values when you try to solve it manually using your own
calculator.

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.

Page 23
ECE 100 Fundamentals of LabVIEW Programming

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 1 0 1 1 -Inf -Inf
0.50 1.65371 0.653713 3.18437 1.41718 -0.298412 -0.68712
1.00 2.72096 1.72096 10.0227 2.00137 0.000427986 0.000985475
1.50 4.4907 3.4907 31.7693 2.83237 0.176672 0.406803
2.00 7.47047 6.47047 102.555 4.0305 0.303403 0.698611
2.50 12.1375 11.1375 313.545 5.64237 0.397297 0.91481
3.00 20.2347 19.2347 1017.18 8.04113 0.478191 1.10108
3.50 33.1303 32.1303 3165.55 11.3172 0.544124 1.25289
4.00 54.6717 53.6717 10031.1 16.0149 0.602206 1.38663
4.50 89.7843 88.7843 31434.7 22.5868 0.652962 1.5035
5.00 148.416 147.416 100004 32.0004 0.698972 1.60944
5.50 244.744 243.744 316382 45.2615 0.740379 1.70479
6.00 403.751 402.751 1.00184E+6 64.0354 0.778209 1.79189
6.50 667.066 666.066 3.18338E+6 90.6911 0.813106 1.87225
7.00 1099.89 1098.89 1.00686E+7 128.264 0.845282 1.94633
7.50 1808.51 1807.51 3.16417E+7 181.052 0.875076 2.01494
8.00 2999.44 2998.44 1.01433E+8 257.099 0.903425 2.08021
8.50 4939.18 4938.18 3.19857E+8 363.284 0.929672 2.14065
9.00 8175.91 8174.91 1.02082E+9 515.185 0.954674 2.19822
9.50 13389.8 13388.8 3.17869E+9 725.206 0.977826 2.25153
10.00 22026.5 22025.5 1E+10 1024 1 2.30259

Question: Explain each function used in the calculation of the tables given above.
Exponential - computes the value of e raised to the x power, or the exponential of x
Exponential Arg (-1) - computes 1 less than the value of e raised to the x
Power Of 10 - computes x raised to the 10th power.
Power Of 2 - computes x raised to the 2nd power
Logarithm Base 10 - computes the base 10 logarithm of x.
Natural Logarithm - computes the base e natural logarithm of x

Question: What are the other functions under Exponential and explain each function?
Natural Logarithm (Arg +1) - computes the natural logarithm of (x + 1)
Logarithm Base X - computes the base x logarithm of y
Logarithm Base 2 - computes the base 2 logarithm of x
Power Of X - computes x raised to the y power
Y-th Root of X Function - Returns the yth root of the input value x.
NOTE for Y-th Root of X Function: if x is not complex, x must be greater than or equal to zero unless y is an integer.

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 24
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 sech csch coth
0.00 0 1 0 1 NaN NaN
0.50 0.522615 1.12833 0.463176 0.886266 1.91345 2.15901
1.00 1.2112 1.57067 0.771135 0.636671 0.825629 1.29679
1.50 2.14098 2.36301 0.906041 0.42319 0.467076 1.1037
2.00 3.61702 3.75271 0.963842 0.266474 0.276471 1.03751
2.50 6.0529 6.13495 0.986626 0.163001 0.16521 1.01356
3.00 10.1173 10.1666 0.995151 0.0983613 0.0988406 1.00487
3.50 16.5921 16.6223 0.998189 0.0601603 0.0602695 1.00181
4.00 27.3553 27.3736 0.999333 0.0365315 0.0365559 1.00067
4.50 45.115 45.1261 0.999754 0.0221601 0.0221656 1.00025
5.00 74.5534 74.5601 0.99991 0.013412 0.0134132 1.00009
5.50 122.377 122.381 0.999967 0.0081712 0.00817147 1.00003
6.00 202.491 202.493 0.999988 0.00493843 0.00493849 1.00001
6.50 333.676 333.678 0.999996 0.0029969 0.00299692 1
7.00 549.154 549.154 0.999998 0.00182098 0.00182098 1
7.50 908.059 908.06 0.999999 0.00110125 0.00110125 1
8.00 1492.27 1492.27 1 0.000670118 0.000670118 1
8.50 2468.97 2468.97 1 0.000405026 0.000405026 1
9.00 4065.97 4065.97 1 0.000245944 0.000245944 1

Page 25
ECE 100 Fundamentals of LabVIEW Programming

9.50 6697.21 6697.21 1 0.000149316 0.000149316 1


10.00 11013.2 11013.2 1 9.07999E-5 9.07999E-5 1

Question: Explain each functions used in the calculation of the tables given above.
Hyperbolic Cosecant - computes the hyperbolic cosecant of x.
Hyperbolic Cosine - computes the hyperbolic cosine of x.
Hyperbolic Cotangent - computes the hyperbolic cotangent of x.
Hyperbolic Secant - computes the hyperbolic secant of x.
Hyperbolic Sine - computes the hyperbolic sine of x.

Question: What are the other functions under Hyperbolic Functions and explain each function?
Inverse Hyperbolic Cosecant - computes the inverse hyperbolic cosecant of x.
Inverse Hyperbolic Cosine - computes the inverse hyperbolic cosine of x.
Inverse Hyperbolic Cotangent - computes the inverse hyperbolic cotangent of x.
Inverse Hyperbolic Secant - computes the inverse hyperbolic secant of x.
Inverse Hyperbolic Sine - computes the inverse hyperbolic sine of x.

IV. MACHINE PROBLEM

1. Given the following equations for a catenary


L
s=asinh
a
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:

L
d=a(cosh −1)
a
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:

x3 x5 x7 x 2 n +1
sinhx=x + + + + …=∑
3! 5! 7! n=0 ( 2 n+1 ) !
While for the hyperbolic cosine is:

x2 x4 x6 x2 n
coshx =1+ + + + …=∑
2! 4! 6! n=0 ( 2 n ) !
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 26
ECE 100 Fundamentals of LabVIEW Programming

2. What is the importance of having Mathematical functions in creating a program using LabVIEW?
It is important to have Mathematical function in creating a program using LabVIEW since it gives the user the ability
to easily create and execute a program that involves a wide variety of mathematical expressions. Furthermore, these
functions can also be used as a foundation on creating a much more complex program that does not focus on
mathematical expressions. With these, it is safe to say that the Mathematical function in LabVIEW serves as a basic
foundation to create a program that involves a much more complex and intricate coding and programming.

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?

No, because LabVIEW reads and execute its components in Radians. This will mean that the result from LabVIEW
and from an external device will have the possibility that they may differ. Whenever there are instances of differences
in results, it is not advisable to use LabVIEW’s Mathematical functions to other external device since it may not give
the expected answer needed and can affect the overall output.

VI. CONCLUSION
After being able to finish the whole activity, our group learned that LabVIEW itself consists of a
much more complex and intricate mathematical expressions and formulas that may help us in our future
program that needs to be executed. It varies from numerous Mathematical topics such as Algebra,
Calculus, Discrete Math, and even Trigonometry. With these included the possibility of creating a program
that can solve any Mathematical equation and question will be endless.
However, in order for these functions to work, you need to ensure that it is wired correctly in order
for it to show the expected results. If not, it may be troublesome and may overall affect the result.

VII. RUBRICS FOR LABORATORY PERFORMANCE

Page 27

You might also like