Hi,
Please could I have a simple program written in C++ to perform the
following:
Calculates the complex ratio, Vout/Vin, for given values of R1, R2,
C1, C2, and a range of frequencies, ù.
The program should take the values of R1, R2, C1, C2, and the details
of the frequency range from a text file.
Complex numbers should be represented by a structure.
Separate functions should be written for all necessary complex
arithmetic operations, e.g. a function that performs complex addition,
a function that performs complex multiplication, etc.
The results should be written to a text file.
The basic calculations are:
R1 / ( jwC1R1 + 1 ) -(1)
R2 / ( jwC2R2 + 1 ) -(2)
(R2 + jwR1R2C1) / { (R1 + R2) + jwR1R2 (C1 + C2) } (R2 + jwR1R2C1) / {
(R1 + R2) + jwR1R2 (C1 + C2) } -(3)
in all above instances, 'j' is the imaginary number 'square root of
(-1)'.
Additional information which may be of some benefit to understanding
what I wish to do here is that the program is in relevence to the
following circuit:
http://answers.google.com/answers/main?cmd=threadview&id=156343
Thanks! |