Question: 3 . For this project s program, you will derive subordinate classes from a base class, and you will create a class that provides static

3. For this projects program, you will derive subordinate classes from a base class, and you will create a class that provides static methods that are not provided in Javas Math class. These new methods will perform addition, subtraction, multiplication, and division of complex numbers numbers that have two components, a real double value, and an imaginary double value that is orthogonal to it. Complex numbers enable you to analyze a system having time-varying sinusoidal signals without having to do a simulation.
Your task is to write a program that calculates the steady-state currents in a two-loop electric circuit that has an arbitrary combination of discrete resistors, inductors, capacitors, and voltage sources in the legs of the circuit. For any one solution, assume the voltage source(s) oscillate at a particular frequency, but write the program so that after a user has defined the circuit, the calculation can be repeated with everything the same except for the frequency. In the driver, provide a loop that steps through the frequencies 16 Hz,16* sqrt(2) Hz,32 Hz,32* sqrt(2) Hz,...46341 Hz, and at each frequency, display 10* log10(outputWatts) for two selected resistors in the circuit, by printing W or T at a horizontal distance that is proportional to the log of the output power.
Demonstrate the program for the specific example of a loudspeaker crossover network that splits an audio signal between woofer (low-frequency) and tweeter (high-frequency) loudspeakers. Heres the circuit, and the values to use for your demonstration:
For the voltage source, use V0=4 volts. For the resistors, use the typical audio values of R0= Rw = Rt =8 Ohms. For the woofer legs inductor, use Lw =1.3 millihenrys. For the tweeter legs capacitor use Ct =10 microfarads. This results in a crossover frequency of fc =1/(2\pi * sqrt(LC))=987 Hz.
The current through the tweeter loudspeaker (the Rt resistance) is the second loop current, I1. The current through the woofer loudspeaker (the Rw resistance) is the difference between the two loop currents, Iw = I0 I1.(If we had drawn the second loop current in the counter-clockwise direction, the current through the woofer loudspeaker would have been the sum of the two loop currents.) The power into either one of the loudspeakers is the square of the magnitude of the net current into that loudspeaker times the resistance of that loudspeaker. The value 10* log10(loudspeaker power in watts) is called the decibel level, and that is what your program will display, like this:
Sample session:
Total number of circuit elements=5
Enter resistor (r), capacitor(c), or inductor(i): r
Enter component name: R0
Enter value in Ohms: 8
Enter resistor (r), capacitor(c), or inductor(i): i
Enter component name: Lw
Enter value in Henrys: 1.3e-3
Enter resistor (r), capacitor(c), or inductor(i): r
Enter component name: Rw
Enter value in Ohms: 8
Enter resistor (r), capacitor(c), or inductor(i): c
Enter component name: Ct
Enter value in Farads: 20e-6
Enter resistor (r), capacitor(c), or inductor(i): r
Enter component name: Rt
Enter value in Ohms: 8
Loop number 0:
Voltage source? (y,n): y
Enter magnitude in volts: 4.0
Enter angle in degrees: 0.0
Coefficient number 0:
Number of components (minus for opposing current): 3
Enter component name: R0
Enter component name: Lw
Enter component name: Rw
Coefficient number 1:
Number of components (minus for opposing current): -2
Enter component name: Lw
Enter component name: Rw
Loop number 1:
Voltage source? (y,n): n
Coefficient number 0:
Number of components (minus for opposing current): -2
Enter component name: Lw
Enter component name: Rw
Coefficient number 1:
Number of components (minus for opposing current): 4
Enter component name: Rw
Enter component name: Lw
Enter component name: Ct
Enter component name: Rt
Enter woofer resistance name: Rw
Enter tweeter resistance name: Rt
frequency decibels
(Hz)-40-30-20-100
16.T ... W .
23. T ... W .
32. T ... W .
45. T .. W .
64.. T .. W .
91.. T .. W .
128.. T.. W .
181... T . W .
256... T . W .
362... T . W .
512... T W .
724.... T W .
1024.... W .
1448.... W T .
2048... W T .
2896.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!