Ok so hers the deal im in a programming class and i am attempting to solve this problem but i have no idea how to go at it really. Its due tomorrow and i had no Idea where else to go. Thanks in advance.
Write analysis program to read the circuit
components from a file. The format of the input file is:
"number of resistors in circuit"
"voltage source name" "source volts" "source rating"
"resistor name" "resistor ohms" "resistor rating"
"load resistor name" "load lower ohms" "load upper ohms" "load average watts"
An example file named input6.dat is attached.
Solve the following problem for the circuit data in the
If the power dissipated in resistor r1 goes above 35
watts, the resistor will burn and its resistance will jump
to 1000000 ohms.
Solve the circuit 100,000 times (using random values for the
During the 100,000 simulations, count the number of times that
the 2 ohm resistor burns up. Also, calculate the average
voltage delivered to the load resistor when the 2 ohm
resistor has burned up.
Your program should output only two numbers on separate lines
1-Number of times that the 2 ohm resistor burns
2-Average voltage delivered to the load resistor calculated
over the cases where the 2 ohm resistor has burned up
The seed to use for the random number generator is 100000
*The way the resistors are paired are as follows, r1 and r2, r3 and r4, r5 and r6 are in parallel with each other, and in series as a group. so r1=r2 is in series with r3=r4... etc.
This is What is in the Dat file that they gave us:
vs 100.0 1000.0
r1 2.0 20.0
r2 4.0 100000.0
r3 3.0 100000.0
r4 6.0 100000.0
r5 4.0 100000.0
r6 8.0 100000.0
rL 10.0 20.0 77.5