LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

urgent urgent


@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.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 11 of 16
(1,157 Views)

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

0 Kudos
Message 12 of 16
(1,030 Views)

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 😁

0 Kudos
Message 13 of 16
(1,050 Views)

@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!

 

  • Your shift register in not initialized, so your angle will start from the last value of the previous run.
  • Calculating the sine function starting with an increment of pi will give you all the same values. (zero, if you start with zero)
  • Adding zero after the shift register does nothing interesting.
  • wiring an integer ramp to the initial condition input of the integration makes no sense.
  • Wiring the x ramp to the final condition input of the integration makes no sense.
  • Graphing the integral of sin(x) vs. sin(x), may or may not be very interesting, especially since all values are about zero.
  • Please don't mess with the background color of the diagram.
Message 14 of 16
(1,014 Views)

Here's an incomplete draft that may (or may not...) give you some ideas....

 

altenbach_0-1676045983557.png

 

Message 15 of 16
(929 Views)

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

 

 

Message 16 of 16
(897 Views)