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
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 timevarying sinusoidal signals without having to do a simulation.
Your task is to write a program that calculates the steadystate currents in a twoloop 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 sources 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 Hz sqrt Hz Hz sqrt Hz Hz and at each frequency, display logoutputWatts 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 lowfrequency and tweeter highfrequency loudspeakers. Heres the circuit, and the values to use for your demonstration:
For the voltage source, use V volts. For the resistors, use the typical audio values of R Rw Rt Ohms. For the woofer legs inductor, use Lw millihenrys. For the tweeter legs capacitor use Ct microfarads. This results in a crossover frequency of fc pi sqrtLC Hz
The current through the tweeter loudspeaker the Rt resistance is the second loop current, I The current through the woofer loudspeaker the Rw resistance is the difference between the two loop currents, Iw I IIf we had drawn the second loop current in the counterclockwise 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 logloudspeaker 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
Enter resistor r capacitorc or inductori: r
Enter component name: R
Enter value in Ohms:
Enter resistor r capacitorc or inductori: i
Enter component name: Lw
Enter value in Henrys: e
Enter resistor r capacitorc or inductori: r
Enter component name: Rw
Enter value in Ohms:
Enter resistor r capacitorc or inductori: c
Enter component name: Ct
Enter value in Farads: e
Enter resistor r capacitorc or inductori: r
Enter component name: Rt
Enter value in Ohms:
Loop number :
Voltage source? yn: y
Enter magnitude in volts:
Enter angle in degrees:
Coefficient number :
Number of components minus for opposing current:
Enter component name: R
Enter component name: Lw
Enter component name: Rw
Coefficient number :
Number of components minus for opposing current:
Enter component name: Lw
Enter component name: Rw
Loop number :
Voltage source? yn: n
Coefficient number :
Number of components minus for opposing current:
Enter component name: Lw
Enter component name: Rw
Coefficient number :
Number of components minus for opposing current:
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
T W
T W
T W
T W
T W
T W
T W
T W
T W
T W
T W
T W
W
W T
W T
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
