- #1

- 7

- 0

You are using an out of date browser. It may not display this or other websites correctly.

You should upgrade or use an alternative browser.

You should upgrade or use an alternative browser.

- Engineering
- Thread starter andreasoro
- Start date

- #1

- 7

- 0

- #2

Curious3141

Homework Helper

- 2,843

- 87

I wanted to quote the Wiki, but it's been blacked-out. :grumpy:

Anyway...the complex number representations are the neatest representation, and I think C++ can handle complex variables, right?

Capacitance: [itex]Z_C = \frac{1}{j{\omega}C} = \frac{-j}{{\omega}C}[/itex]

Inductance: [itex]Z_L = j{\omega}L[/itex]

Resistance: [itex]Z_R = R[/itex]

For the resistance, the impedance is just the usual resistance. [itex]\omega[/itex] (angular frequency) is equal to [itex]2{\pi}f[/itex], where f is the usual frequency of the alternating current.

Series and parallel arrangements can be treated in the usual fashion, substituting the imaginary/complex reactances and impedances for the usual real resistances.

- #3

- 7

- 0

- #4

Curious3141

Homework Helper

- 2,843

- 87

I'm pretty sure (ages ago, when I was programming for fun) that C (not even C++) can handle complex variables. I used it in a fractal generation program I wrote. You have to import the correct library, #include<complex.h> or something of the sort and probably #include<math.h> as well.

- #5

gneill

Mentor

- 20,925

- 2,866

... what is weird is that we're not given ω but just one value for each component (for example "condenser = 4)

What is the exact phrasing of the problem statement? Is it possible that you're being given the

- #6

- 7

- 0

- #7

- 7

- 0

By the way, I really appreciate it that you're putting so much effort in helping me :)

- #8

- 7

- 0

- #9

Curious3141

Homework Helper

- 2,843

- 87

They did mention complex numbers, so they clearly want you to manipulate imaginary reactances and complex impedances. But they did not provide any frequency of the voltage source, etc. which is very important in determining the reactances of those components.

This assignment really needs to be clarified. Judging by the dates, unfortunately, it's not a current assignment.

With regard to the programming part, it looks like they want you to build complex arithmetic capabilities into your program, rather than using predefined library functions.

- #10

Curious3141

Homework Helper

- 2,843

- 87

Then it's just a matter of defining the structure "complex", constructing functions that add, subtract, multiply and divide, then define the series operation as just the sum of two impedances, and the parallel operation as [itex]\frac{Z_1Z_2}{Z_1 + Z_2}[/itex].

- #11

- 7

- 0

- #12

gneill

Mentor

- 20,925

- 2,866

The assignment is in the attachment

The assignment is poorly written. It is apparent that whoever created the problem didn't fully understand impedance and its dependance on frequency.

I suggest that you add another set of tags, <freq> and </freq>, which allows you to specify the operating frequency of the circuit. This tag set would occur immediately following the <circuit> tag prior to any component specification, and only one per circuit, and would be required for any circuit that contains reactive components (coil or condenser).

With the circuit operating frequency known you can then calculate the impedances of the components given their component values.

Good luck!

- #13

Curious3141

Homework Helper

- 2,843

- 87

- #14

- 7

- 0

Ok I will! Thanks so much! It was very nice of you!

Share:

- Replies
- 18

- Views
- 1K

- Replies
- 13

- Views
- 3K