Bode Plot
Time limit1sMemory limit128 MB
Given source voltage, resistance, capacitance, and several angular frequencies, compute the resistor voltage magnitude from the RC low-pass circuit equations.
- Level
Easy3 of 10
- Topics
- Math, Simulation, Implementation, Brute force
- Solved
- No attempts yet
Problem
Consider an alternating-current (AC) circuit that is assumed to be in steady state. The circuit consists of a voltage source, a capacitor, and a resistor. Node 1 is the source terminal, and node 2 is the point between the capacitor and the resistor. The voltages at the two nodes are
where is the source voltage, is the angular frequency (in radians per second), and is time. is the magnitude of the voltage drop across the resistor, and is its phase.
Write a program that determines for different values of . You will need two laws of electricity. The first is Ohm's Law: if is the current in the circuit, oriented clockwise, then . The second relates the current to the voltages on either side of the capacitor: , where denotes the derivative with respect to .
Input
The input consists of one or more lines. The first line contains three real numbers and a non-negative integer. The real numbers are , , and , in that order. The integer is the number of queries. Each of the following lines contains a single real number, the angular frequency .
Output
For each angular frequency, output the corresponding on its own line. Round each value to three digits after the decimal point.