06-26-2010 01:26 PM
Hi
As a part of a project I want to divide volatge by a complex impedance (Z) to find out current then plot both current and voltage on the same graph to show the difference in amolitude and phase shift.
I have used these functions but I get odd values and there is no phase shift .The signal comes from a simple wave generator.
Would you please help me to fix this problem.
06-26-2010 01:47 PM
06-26-2010 02:31 PM
Hi thanks for your reply.As u said that is a part of my block diagram.Red dots representing the sine wave gererated by a simple wave generator . I have made a complex number using Re/Im to complex function then I used a simple divide function to divide my signal by the complex number but as I said before the amplitude and phase of the signal after devision are wrong.I am not sure whether this is the right way of divinding a sine wave by a complex number.
For example in this picture.The genrated sine wave is 10sin(wt) and the complex number is 4+3j ..so the current should be 10/(4+3j) and the amplitude should be 2 and phase shift of -arctg(3/4) but this is what I have got
06-26-2010 02:39 PM
Hi en99,
I think you didn't understand what I'm trying to say...
In your first post there are some red dots at both inputs of the divide function and at the terminal of the graph. Those red dots indicate type coercions!
So even when trying to divide by a complex number it may happen that the complex number is then coerced to some other datatype. Also the graph may only take real DBL inputs and so coerces it's input.
So please check you're really getting complex numbers in the end!
06-26-2010 02:39 PM
How are you generating the sine wave of 10sin(wt)? That part of your code is not showing. What frequency are you generating?
06-26-2010 02:52 PM
Sending a complex waveform to a waveform graph doesn't tell you much. You need to separate the real and imaginary parts and create two plots in order for the waveform graph to be meaningful. Alternatively, you could use an XY graph. See attached example.
06-26-2010 03:38 PM
@ethen99 wrote:
For example in this picture.The genrated sine wave is 10sin(wt) and the complex number is 4+3j ..so the current should be 10/(4+3j) and the amplitude should be 2 ...
The amplitude should be 1.6, not 2. I re-created your vi and got the same results.
The peak value of the sine wave 10sin(wt) is 10. In complex form, you could write this as 10 + 0j. If you divide (10 + 0j) by (4 + 3j) you get:
First multiply top and bottom by conjugate:
(10 + 0j) (4 - 3j) 40 + 0j - 30j - 0j
------------ * -------- = -------------------------
(4 + 3j) (4 - 3j) 16 + 12j - 12j -9j^2
Do all the math and you get (40 - 30j) / 25. So the amplitude is 40 / 25 which is 1.6. This is the amplitude shown in the graph.
If you divide by 4 + 2j you will get an amplitude of 2.
06-26-2010 04:49 PM
many thanks for your reply GerdW and thob
thob: are u sure because I think if for example u divide 10sin(10t) / (4+3j) the answer will be 2sin(10t - arctg(3/4)) .I expect to get this answer.also if 1.6 is correct there is no phase shift.
GredW: u are right about the red dots .I havnt seen these red dots before this post .I think somthing is wrong there and it is not possible to use a simple / function to divide a signal by complex number.any help on another solution really appericiated.
thob I havnt opened your vi yet.I hope to find the answer there.
06-26-2010 05:03 PM - edited 06-26-2010 05:05 PM
Dividing the sine wave by a complex number in Labview may not be what you want. The way Labview handles it, it treats the waveform as an array of data points. It does not take into account any phase shifting. So without phase shift, and dividing each data point by the complex number, you will get a collection of data points as shown in the graph. At max amplitude of 10, 10+0j divided by 4+3j will give 1.6+1.2j. I would not know how to divide an enitre waveform by one complex number. What does this gain anyway?
I didn't attach a vi, but it is the same as yours, and I got the same results. The coercion dots are there to change the waveform data type to a DBL. The divide funtion must have a floating point input. So the Y values of the waveform are extracted and used for the divide, hence the red dot. Of course, if only the Y values are used, the dt is ignored. So you are not getting any useful results.
06-26-2010 05:30 PM
I am designing some exercises for first year students .they supposed to make a three phase delta connected circuit and measure voltage,current and power for 1 phase and 3 phase
In one of the exercises the loads consist of a resistor and inductor ( z is complex number ) so they have to plot both voltage and current on the same graph.This is what I want to do.I see how labview do the job .do u have any advice for another solution. I was thinking I can first find the phase shift then generate a sin wave by knowing the amplitude and phase of current instead of dividing voltage by impedance