Thread: Clueless, dont know where to start.

  1. #1
    Registered User
    Join Date
    Nov 2013
    Posts
    8

    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. #2
    Registered User
    Join Date
    Jun 2011
    Posts
    4,513
    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. #3
    Registered User
    Join Date
    Nov 2013
    Posts
    8
    Quote Originally Posted by Matticus View Post
    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. #4
    Registered User
    Join Date
    Jun 2011
    Posts
    4,513
    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.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. clueless
    By asdfgtrew in forum C++ Programming
    Replies: 10
    Last Post: 02-15-2012, 11:14 AM
  2. i dont know where to start!!!
    By tonymontana_320 in forum C++ Programming
    Replies: 1
    Last Post: 11-13-2011, 01:15 AM
  3. dont know were to start
    By kaijuu in forum C Programming
    Replies: 7
    Last Post: 02-19-2008, 03:30 AM
  4. if you dont like linux threads, dont read...
    By ... in forum A Brief History of Cprogramming.com
    Replies: 4
    Last Post: 02-03-2003, 11:26 AM
  5. dont know where to start!! help
    By playboy1620 in forum C Programming
    Replies: 1
    Last Post: 02-24-2002, 10:07 AM