07-11-2022 10:31 AM
@Bob_Schor wrote:
@spoddar94 wrote:
I tried to create vi but failing for integral part how to set limits from 0 to npi. If spasu can share it will be helpful.
@spasu originated this Post in 2007, and hasn't posted since. Like you, he (or she) was probably "learning LabVIEW", and made the effort to understand the advice. For us to help you "cheat" and provide the answers to you will not help you to learn LabVIEW. However, if you make a real effort, and post your code (which means "attach the VI or VIs that you've created and explain where you are stuck"), we might be able to give you some guidance so you can learn to "do it yourself".
Bob Schor
It's probably "dog ate my homework" time.
02-09-2023 04:10 PM - edited 02-09-2023 04:31 PM
Hello all,
I'm working on a homework problem:
""
Create a VI that graphs the function sin x where x = 0…nπ and the integral
nπ
y = ∫sin x dx.
0
The value of n should be an input on the front panel. The graph will have sinx on the x-axis and y on Y-axis
""
I'm having trouble doing this in a way that makes sense/LabView likes. After running into trouble with this problem, I found the NI Community post: Re: urgent urgent - NI Community
@altenbach gave a good answer, however the original thread poster didn't include the problem statement in its entirety, so I think his helpful answer didn't quite conform to the problem statement.
I'd appreciate any advice on this problem, and understanding the integration capability LabView possesses. Cheers!
-Douglas
02-09-2023 04:48 PM
Hate to dredge up a dead topic, but my post was taken down.
I'm working on the same problem as the original poster, however he did not include the full problem statement so the helpful advice given by @altenbach wasn't applicable in this case.
Problem Statement: ".... front panel. The graph will have sinx on x-axis and y on Y-axis."
I am trying to use shift register to create a 1D array for 'sinx' and a different 1D array for its integral. However, my graphical results are not as anticipated. I think I may not be using the numerical integration subVI correctly. I would appreciate any advice- my VI is attached.
This post is not 'urgent urgent' - do your homework ahead of time kids so you have time to get help when you run into issues 😁
02-09-2023 06:55 PM - edited 02-09-2023 07:20 PM
@Arti99 wrote:
However, my graphical results are not as anticipated. I think I may not be using the numerical integration subVI correctly. I would appreciate any advice- my VI is attached.
No, you are using LabVIEW AND math incorrectly!
02-10-2023 10:20 AM
02-10-2023 07:04 PM
After revisiting the problem with your suggestions from last night, I was able to obtain the desired result (in a manner nowhere near as elegant as the method you used). I would have posted last night but there is a post limit for new forum members.
If other students are having a disconnect between the mathematics and programmatics and end up in this thread, consider that,
-From the NI manual for 'Integral x(t)': "The value of the output array at any value x is the area under the curve of the input array between 0 and x."
-The step size for which sin(x) is evaluated should be the same as the step size for which the integral is evaluated. This ensures that the frequencies are the same.
-Perhaps revisit some theory and the 'why' behind numerical integration
Considering these things made the problem a lot easier to understand from a conceptual standpoint.
Thanks again altenbach, cheers!
-Douglas