1
00:00:05,000 --> 00:00:05,000
Hello, friends.

2
00:00:05,000 --> 00:00:15,000
Today I will tell you another mathematical formula how to create a function in a lab.

3
00:00:15,000 --> 00:00:21,000
For that purpose, I just go to my block diagram window over here.

4
00:00:22,000 --> 00:00:25,000
As you see, this is my for loop.

5
00:00:26,000 --> 00:00:29,000
I just set the loop count 50.

6
00:00:29,000 --> 00:00:38,000
In this case, the number of x values you can set over here, you can control it also.

7
00:00:38,000 --> 00:00:41,000
Right now, I just create a constant in this case.

8
00:00:42,000 --> 00:00:44,000
As you see, this is my iteration loop.

9
00:00:44,000 --> 00:00:45,000
Iteration.

10
00:00:45,000 --> 00:00:54,000
It will start from zero to n minus one and just directly connect it to the edge of for loop and auto

11
00:00:54,000 --> 00:00:57,000
indexing is on in this case.

12
00:00:59,000 --> 00:01:01,000
As many as times.

13
00:01:01,000 --> 00:01:05,000
My loop runs all the values stored at over here.

14
00:01:06,000 --> 00:01:08,000
It will create an array.

15
00:01:08,000 --> 00:01:13,000
As you see, the width of the wire is increased.

16
00:01:14,000 --> 00:01:15,000
In this case.

17
00:01:15,000 --> 00:01:20,000
So now I just explain you the function or formula.

18
00:01:21,000 --> 00:01:23,000
The in the given VI.

19
00:01:23,000 --> 00:01:28,000
So over here, let's say it is I iteration.

20
00:01:28,000 --> 00:01:34,000
So when you multiply this iteration with three, it will give me three I.

21
00:01:35,000 --> 00:01:38,000
So I just put three over here.

22
00:01:39,000 --> 00:01:44,000
Then you just go here, this is my head function.

23
00:01:44,000 --> 00:01:46,000
Just add before.

24
00:01:47,000 --> 00:01:50,000
After this plus 0.1.

25
00:01:52,000 --> 00:01:55,000
So over here, I'll just add.

26
00:01:59,000 --> 00:02:01,000
Three plus 0.1.

27
00:02:01,000 --> 00:02:09,000
After this operation and this function, this value goes to the sine function right now.

28
00:02:09,000 --> 00:02:11,000
Sine is in radians.

29
00:02:12,000 --> 00:02:19,000
So over here I just put sign of the given function.

30
00:02:19,000 --> 00:02:30,000
After this, this value, the particular value that is value of sign function is multiplied by 0.8.

31
00:02:30,000 --> 00:02:32,000
I just multiply it with 0.8.

32
00:02:33,000 --> 00:02:35,000
Then it is multiplied with.

33
00:02:36,000 --> 00:02:37,000
Minus one.

34
00:02:37,000 --> 00:02:38,000
I just put.

35
00:02:39,000 --> 00:02:41,000
Minus one over here.

36
00:02:44,000 --> 00:02:50,000
As you see now, this value, this complete value is in X.

37
00:02:51,000 --> 00:02:54,000
We just subtract minus one from it.

38
00:02:54,000 --> 00:02:57,000
We just subtract one from it, not minus one.

39
00:02:57,000 --> 00:02:59,000
So minus one.

40
00:03:00,000 --> 00:03:03,000
So over here it is the complete formula.

41
00:03:06,000 --> 00:03:14,000
So the value of I goes to this formula and value created by this function is stored at this particular

42
00:03:14,000 --> 00:03:15,000
value.

43
00:03:15,000 --> 00:03:19,000
For example, in I is zero, I is zero stored over here.

44
00:03:19,000 --> 00:03:24,000
And when I is zero according to that function, the value goes over here.

45
00:03:24,000 --> 00:03:31,000
So if you want to check what happened at every level, so just create.

46
00:03:33,000 --> 00:03:34,000
Just go to Cobh.

47
00:03:40,000 --> 00:03:43,000
And create.

48
00:03:44,000 --> 00:03:44,000
Wires.

49
00:03:47,000 --> 00:03:48,000
Second.

50
00:03:49,000 --> 00:03:50,000
Third.

51
00:03:51,000 --> 00:03:52,000
Or.

52
00:03:53,000 --> 00:03:56,000
Fifth and final view.

53
00:03:57,000 --> 00:03:59,000
Let's check what happened to it.

54
00:04:01,000 --> 00:04:07,000
So in this case, initially, I just remove it.

55
00:04:10,000 --> 00:04:11,000
Delete it.

56
00:04:13,000 --> 00:04:21,000
So I just put a value zero, let's say, because initially when iteration is zero, I just put zero.

57
00:04:21,000 --> 00:04:24,000
So when you hit on run button, you just get.

58
00:04:26,000 --> 00:04:29,000
Zero into three, it will give me zero.

59
00:04:31,000 --> 00:04:34,000
Then I just add 0.1.

60
00:04:34,000 --> 00:04:36,000
So 0.1 is there.

61
00:04:36,000 --> 00:04:43,000
At the third place over here, sine of 0.1 is 0.0998334.

62
00:04:44,000 --> 00:04:47,000
At the next level, I just multiply 0.8 with it.

63
00:04:47,000 --> 00:04:49,000
So value decreased.

64
00:04:49,000 --> 00:04:52,000
0.079.

65
00:04:53,000 --> 00:04:56,000
After this, I multiply minus one with it.

66
00:04:56,000 --> 00:04:58,000
So value is minus one.

67
00:04:59,000 --> 00:05:07,000
-0.0798667, and then just subtract minus one from it.

68
00:05:07,000 --> 00:05:12,000
So I got this value and all these values are stored right now.

69
00:05:12,000 --> 00:05:18,000
I just take an example of when I is zero in the next level, let's say one is there.

70
00:05:19,000 --> 00:05:21,000
Then again, I hit on run button.

71
00:05:21,000 --> 00:05:25,000
So again, the values initially it is one, two, three, three.

72
00:05:25,000 --> 00:05:28,000
Then plus 0.1, it is 3.1.

73
00:05:28,000 --> 00:05:30,000
Then it is sine of 3.1.

74
00:05:30,000 --> 00:05:32,000
I got this value.

75
00:05:32,000 --> 00:05:38,000
So likewise all the values respective to the iteration stored over here.

76
00:05:38,000 --> 00:05:40,000
So I just delete this.

77
00:05:41,000 --> 00:05:43,000
And connect this fire to.

78
00:05:48,000 --> 00:05:50,000
Control be by this.

79
00:05:50,000 --> 00:05:53,000
Connect this to location, as you see over here.

80
00:05:54,000 --> 00:05:56,000
So now when you hit on run button.

81
00:06:01,000 --> 00:06:02,000
Let's close this.

82
00:06:06,000 --> 00:06:10,000
And you just check over here for the 50 values, not 50.

83
00:06:11,000 --> 00:06:15,000
It is up to 49 because my loop count is 50, so n minus one.

84
00:06:15,000 --> 00:06:18,000
My for loop goes from zero to n minus one.

85
00:06:18,000 --> 00:06:22,000
So I got this pattern and this is the value of.

86
00:06:24,000 --> 00:06:25,000
This function.

87
00:06:25,000 --> 00:06:29,000
This function will give me the waveform graph of this.

88
00:06:30,000 --> 00:06:31,000
Function over here.

89
00:06:31,000 --> 00:06:34,000
I just use build array function.

90
00:06:34,000 --> 00:06:41,000
It will connect, add this one and this one and it will create a two dimensional array, as you see

91
00:06:41,000 --> 00:06:41,000
over here.

92
00:06:41,000 --> 00:06:42,000
This is.

93
00:06:43,000 --> 00:06:45,000
Two battle lines are there.

94
00:06:45,000 --> 00:06:48,000
And over here I have a function transpose.

95
00:06:48,000 --> 00:06:54,000
It will transpose the whole function and it will give me area over here.

96
00:06:54,000 --> 00:06:56,000
In this case, I have total number of.

97
00:06:58,000 --> 00:06:58,000
49.

98
00:06:58,000 --> 00:07:00,000
Up to 49.

99
00:07:00,000 --> 00:07:02,000
Total number of 50 values.

100
00:07:03,000 --> 00:07:04,000
I just.

101
00:07:04,000 --> 00:07:06,000
I just minimize it.

102
00:07:07,000 --> 00:07:10,000
Using this, I'll just increase the.

103
00:07:11,000 --> 00:07:13,000
Number over here.

104
00:07:15,000 --> 00:07:16,000
Up to 49.

105
00:07:16,000 --> 00:07:19,000
I just got the values in this case.

106
00:07:24,000 --> 00:07:31,000
So as you see up to 49, when I just go one more increase, there is no value, as you see over here.

107
00:07:31,000 --> 00:07:34,000
So this is the case how you can create.

108
00:07:35,000 --> 00:07:36,000
Your own.

109
00:07:38,000 --> 00:07:40,000
Eddie or your own.

110
00:07:42,000 --> 00:07:44,000
Waveform graph using this function.

111
00:07:45,000 --> 00:07:49,000
The given function you can change also your given function.

112
00:07:49,000 --> 00:07:53,000
Let's say I want to go with only 30 values.

113
00:07:53,000 --> 00:07:55,000
In that case, let's check what happened to it.

114
00:07:56,000 --> 00:07:57,000
I think this.

115
00:07:59,000 --> 00:08:02,000
So as you see, it is auto updated mode.

116
00:08:02,000 --> 00:08:05,000
The function is an auto updated mode.

117
00:08:07,000 --> 00:08:09,000
Graph is in auto operated mode.

118
00:08:09,000 --> 00:08:12,000
That's why over here it is up to 29.

119
00:08:12,000 --> 00:08:17,000
So this is how you can if you just change it to, let's say 100.

120
00:08:17,000 --> 00:08:18,000
The fixed value is 100.

121
00:08:19,000 --> 00:08:21,000
And over here, the mode.

122
00:08:22,000 --> 00:08:24,000
A change changed?

123
00:08:26,000 --> 00:08:27,000
So when you hit on run button.

124
00:08:28,000 --> 00:08:32,000
Right now, this value is there and I just change it to control.

125
00:08:34,000 --> 00:08:38,000
Just go to value over here.

126
00:08:38,000 --> 00:08:41,000
I just put now 80.

127
00:08:41,000 --> 00:08:49,000
So over here, as you got the function, this pattern is from the function.

128
00:08:50,000 --> 00:08:53,000
This pattern is created by the function itself.

129
00:08:53,000 --> 00:08:59,000
So this is how you can create your own function in LabVIEW and how to plot that function in LabVIEW.

130
00:09:01,000 --> 00:09:01,000
Thank you.

