# Thread: Clueless, dont know where to start.

1. ## Clueless, dont know where to start.

The question i have received is this:

Assuming you have a serial RC circuit fed with a AC voltage at frequency f. Using equations provided in the introduction and material learned from your own research, you are required to write a C program that enables the user to

§ Input the value of resistance and capacitance.
§ Enter the input frequency f.
§ Calculate and display the resistance and reactance of the combined RC impedance.
§ Calculate and display the phase difference between the current wave and the voltage wave. Test with different input values, i.e. cases of pure resistance, pure reactance and combination of resistance and reactance (RC circuit).

Could anyone advise me on what it is asking of me, and explain what i would need to enter into the program to fufill the programs need?

Many Thanks, help would be appreciated.

2. Step 1: Write code to read three values from the user; R, C, and F
Step 2: Using these values, and the proper equations, calculate the requested values

Don't proceed to step 2 until to complete step 1.

3. Originally Posted by Matticus
Step 1: Write code to read three values from the user; R, C, and F
Step 2: Using these values, and the proper equations, calculate the requested values

Don't proceed to step 2 until to complete step 1.
Thank you! Ive completed step one, ive worked out these formulas, are these correct? If so which ones will calculate what?

Omega=2*Pi*F
XC = 1 / Omega*C [Ω] REACTANCE
Z = √R2 +(1/Omega*C)2 [Ω] IMPEDANCE
θ = tan−1 (Xc / R)= tan−1 ((1/Omega*C)/ R) PHASE ANGLE

Just trying to figure out what to tell the program to do.

4. My AC knowledge is terribly rusty, after years of focusing on digital design, but it appears that you have the right formulae. Whether or not you want to find the intermediary values (i.e. omega) during calculations is up to you. It might make each formula easier to calculate, with fewer terms in each equation.

Resistance of an RC circuit with an AC voltage is just the resistance value (the real part).

The reactance of an RC circuit with an AC voltage is the XC formula you have (the imaginary part).

The impedance can either be comprised of the real and imaginary parts, but it looks like you need the phase angle, which requires more computation.

I believe the magnitude is simple the square root of (R2 + XC2). The phase angle would be the arctan of of (XC/R).

Pay careful attention to the angle units used by the math functions - they work in radians, not degrees.

Needless to say, this should all be verified independently yourself - it's been years since I learned this stuff, so some of it may very well be wrong.