LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem to plot a function

Hello!

I am working with LBW 7,1 and I have a problem.

I want to plot a function wich is e^-x * sin20x the problem is
that I can´t seem to find how to raise e^-x.

Can someone please help me, i have searched so long time now.

/Marcus
0 Kudos
Message 1 of 10
(2,743 Views)
All tools are right there (Make sure to adjust dx of the x axis or use an xy graph if desired)!
 

Or just use an expression node 😉

Message Edited by altenbach on 02-11-2007 11:18 AM

Download All
0 Kudos
Message 2 of 10
(2,740 Views)
Hey!

That´s the graph i want. But i can´t get it right because my graph is in a for loop.

I will work on.

Thank u!
0 Kudos
Message 3 of 10
(2,721 Views)
Why is it in a FOR loop? Please attach your program so we can find a better solution for your specific environment. 🙂
0 Kudos
Message 4 of 10
(2,719 Views)
Hello again.

I´ve put in a for loop because i want an intervall from x=0 -5 with an delta x step 0,05.

But the results from the graph is not correct. I could see if I can put in an attachment.

My spelling sucks 😉
0 Kudos
Message 5 of 10
(2,713 Views)
The only thing that needs to be in a loop (unless you use the ramp function, where you don't even need any loop at all ;)) is the generation of the X values. Optionally you can also place the calculation in a loop as seen in the second example below.
 
 
The graph terminal only needs to be in the loop if the loop is very slow and you want to see the curve grow. In this case you would need to built the array in a shift register. In all other cases it is a waste of resources to update the graph 100 times in a row.

Message Edited by altenbach on 02-11-2007 01:37 PM

0 Kudos
Message 6 of 10
(2,707 Views)
Very nice information 🙂

My function as we have mentioned before is in a for loop. Then i have added a bundle with 3 inputs (dbl, integer and the signal from the  cosine) but these are outside
the for loop and in to the waveform graph. So I really don´t think my construction is wrong. But the results as I have said before is wrong.

But im just an amture, so i will try to do it easy for me 😉

Do you understand my construction, a little?

0 Kudos
Message 7 of 10
(2,702 Views)

Message Edited by Hamlich on 02-11-2007 04:01 PM

Here it is

http://img316.imageshack.us/my.php?image=90022868nj3.jpg

Message Edited by Hamlich on 02-11-2007 04:02 PM

0 Kudos
Message 8 of 10
(2,700 Views)

(1) Your VI calculates sin(e^(-x) * 20x), which is quite different to e^(-x) * sin(20x).
(You need to take the sine of 20x and multiply the result with exp(-x). The multiply goes after the sine function.)

(2) Your X range is incorrect, it goes from 0..100 instead of 0..5. You need to multiply [i] by 0.05 before feeding it to the rest of the formula.

Message 9 of 10
(2,677 Views)

Thanks! Now it works!

Message Edited by Hamlich on 02-12-2007 12:42 PM

0 Kudos
Message 10 of 10
(2,646 Views)